@vercel/cli-support 65.15.0 → 65.16.0-snapshot-579f9b2619d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-WGP6UVQN.js → add-7QN52B57.js} +1 -1
- package/dist/chunks/{add-6T3KGMEH.js → add-F6E3N6EL.js} +1 -1
- package/dist/chunks/{add-LULORXI7.js → add-MC6ZRFQX.js} +1 -1
- package/dist/chunks/{alerts-IFUWVZU4.js → alerts-LVINUFWK.js} +1 -1
- package/dist/chunks/{build-H5WTYJH4.js → build-IU3F645C.js} +1 -1
- package/dist/chunks/{chunk-X5LOHZT5.js → chunk-26NZS3ME.js} +1 -1
- package/dist/chunks/{chunk-HFVCKK5P.js → chunk-2DP7BD4A.js} +1 -1
- package/dist/chunks/{chunk-6737KAJP.js → chunk-2GBU6ULJ.js} +1 -1
- package/dist/chunks/{chunk-QEZ6KFSY.js → chunk-2QAXUK5X.js} +1 -1
- package/dist/chunks/{chunk-DETGGKXT.js → chunk-2R3K7FYA.js} +1 -1
- package/dist/chunks/{chunk-UZXQY5X5.js → chunk-2Y5X7IPM.js} +1 -1
- package/dist/chunks/{chunk-5DEAFZBT.js → chunk-33P2H5LU.js} +1 -1
- package/dist/chunks/{chunk-KVDSSSSF.js → chunk-34RN7PH7.js} +1 -1
- package/dist/chunks/{chunk-PL6TMRQZ.js → chunk-3FXGAG5H.js} +1 -1
- package/dist/chunks/{chunk-XDBRJ7H3.js → chunk-4K2IT6C4.js} +1 -1
- package/dist/chunks/{chunk-P333Z5AT.js → chunk-5MZ7JZY7.js} +1 -1
- package/dist/chunks/{chunk-3JFPC5MK.js → chunk-5S6VTCXQ.js} +1 -1
- package/dist/chunks/{chunk-W25UARQV.js → chunk-5ZCSFPWG.js} +1 -1
- package/dist/chunks/{chunk-6MFLATDD.js → chunk-5ZJ6UU6P.js} +1 -1
- package/dist/chunks/{chunk-ODM3YKPR.js → chunk-62EY3VOP.js} +1 -1
- package/dist/chunks/{chunk-4TD2KH46.js → chunk-63FPHKCJ.js} +1 -1
- package/dist/chunks/{chunk-SP6E7PHW.js → chunk-6CJFPT4F.js} +1 -1
- package/dist/chunks/{chunk-2LOA3LC6.js → chunk-6FYPSSL4.js} +1 -1
- package/dist/chunks/{chunk-BYJQPGPK.js → chunk-6IT3XN6I.js} +1 -1
- package/dist/chunks/chunk-6IZ2TU4N.js +12 -0
- package/dist/chunks/{chunk-2OQD274E.js → chunk-6UI3ZNHM.js} +7 -7
- package/dist/chunks/{chunk-UXRRYYSD.js → chunk-7HLAWGY2.js} +1 -1
- package/dist/chunks/{chunk-6C5KUHQP.js → chunk-7KCRYDGK.js} +1 -1
- package/dist/chunks/{chunk-SQ76HIB6.js → chunk-AB4WXRCO.js} +1 -1
- package/dist/chunks/{chunk-HVZ5OOOP.js → chunk-AFQLIDZC.js} +1 -1
- package/dist/chunks/{chunk-HVQEYQWF.js → chunk-AXKC5J52.js} +1 -1
- package/dist/chunks/{chunk-3EHJOZJB.js → chunk-BBQ4XOTI.js} +1 -1
- package/dist/chunks/{chunk-HVBSYQDN.js → chunk-BKHJUBCA.js} +1 -1
- package/dist/chunks/{chunk-JVGENO2R.js → chunk-BMIYC2MH.js} +1 -1
- package/dist/chunks/{chunk-26EJ4FM6.js → chunk-BPIGFKNN.js} +1 -1
- package/dist/chunks/{chunk-VBGL7MZR.js → chunk-BPM6HU7K.js} +1 -1
- package/dist/chunks/{chunk-CJ6XPDSS.js → chunk-BPQUJWX5.js} +1 -1
- package/dist/chunks/{chunk-YE245S4O.js → chunk-C35SG42R.js} +1 -1
- package/dist/chunks/{chunk-XHPIQGUS.js → chunk-CBEMES2R.js} +1 -1
- package/dist/chunks/{chunk-JZ4NMX3Z.js → chunk-CC36LXTT.js} +1 -1
- package/dist/chunks/chunk-CFJBDBYH.js +7 -0
- package/dist/chunks/{chunk-JQHS743O.js → chunk-CM7I3U5I.js} +1 -1
- package/dist/chunks/{chunk-MSJA64LL.js → chunk-D44WCAOX.js} +1 -1
- package/dist/chunks/chunk-D66BF5UU.js +7 -0
- package/dist/chunks/{chunk-2V6UURUN.js → chunk-DDPH26ZO.js} +1 -1
- package/dist/chunks/{chunk-PRNTZKYB.js → chunk-DJIBJVEQ.js} +1 -1
- package/dist/chunks/{chunk-T7XSLFZ6.js → chunk-DMPINPWB.js} +1 -1
- package/dist/chunks/{chunk-Z5FNUSWW.js → chunk-DOBV3XLO.js} +1 -1
- package/dist/chunks/{chunk-7GSB5AQE.js → chunk-DSHWUXYY.js} +1 -1
- package/dist/chunks/{chunk-OFZUWHZW.js → chunk-DTUEHPME.js} +1 -1
- package/dist/chunks/{chunk-WKSXBH7X.js → chunk-DY643UZ7.js} +2 -1
- package/dist/chunks/{chunk-O3DAPRJ3.js → chunk-EJLYDHT7.js} +1 -1
- package/dist/chunks/{chunk-4OO6TXBM.js → chunk-ELM2KPYX.js} +1 -1
- package/dist/chunks/{chunk-7OJMANDL.js → chunk-EVZCOEPD.js} +1 -1
- package/dist/chunks/{chunk-XEISEISC.js → chunk-FBLGDSCA.js} +6 -6
- package/dist/chunks/{chunk-U3J3SJJ5.js → chunk-FZ5XTMGO.js} +2 -2
- package/dist/chunks/{chunk-AR3ADTVY.js → chunk-GDOKUFG3.js} +1 -1
- package/dist/chunks/chunk-GLCSWIB4.js +7 -0
- package/dist/chunks/{chunk-RWK4YZLO.js → chunk-GV4XVRPN.js} +1 -1
- package/dist/chunks/{chunk-MTJLZGL5.js → chunk-HQGD4PEO.js} +1 -1
- package/dist/chunks/{chunk-UDKIA6WN.js → chunk-HXEXHXD4.js} +1 -1
- package/dist/chunks/{chunk-KAYGNWHX.js → chunk-I4QLOG2Z.js} +1 -1
- package/dist/chunks/{chunk-W45KFKUW.js → chunk-IG5ACFU6.js} +1 -1
- package/dist/chunks/{chunk-5L566FZB.js → chunk-IIK6GUVI.js} +1 -1
- package/dist/chunks/chunk-IJHT5BPS.js +12 -0
- package/dist/chunks/{chunk-3JM374FP.js → chunk-INICCBM4.js} +1 -1
- package/dist/chunks/{chunk-O3I6OKIE.js → chunk-IOQZ7HZM.js} +1 -1
- package/dist/chunks/chunk-IVZF2PMV.js +11 -0
- package/dist/chunks/chunk-JNA6LHLT.js +24 -0
- package/dist/chunks/{chunk-ATUJAOUR.js → chunk-JNXPL4Y4.js} +1 -1
- package/dist/chunks/{chunk-XF3327G6.js → chunk-JP2TYFG4.js} +1 -1
- package/dist/chunks/chunk-JWKFVECK.js +7 -0
- package/dist/chunks/{chunk-7O2W7ILO.js → chunk-K2IVJE2G.js} +1 -1
- package/dist/chunks/{chunk-X5I33MJS.js → chunk-K7ZPHS55.js} +1 -1
- package/dist/chunks/{chunk-ONXOTUO6.js → chunk-KBON4ISC.js} +1 -1
- package/dist/chunks/{chunk-2W4ND5DH.js → chunk-KEGZOZE5.js} +1 -1
- package/dist/chunks/{chunk-PSPPENIK.js → chunk-KLII7LME.js} +1 -1
- package/dist/chunks/{chunk-Z2HYNJLC.js → chunk-KNVMEDGC.js} +1 -1
- package/dist/chunks/{chunk-GTOSMVDY.js → chunk-L7MSHLII.js} +1 -1
- package/dist/chunks/{chunk-VTZH5DW3.js → chunk-LAFP5A4S.js} +1 -1
- package/dist/chunks/{chunk-NHB43235.js → chunk-LYL26S3N.js} +1 -1
- package/dist/chunks/{chunk-IDHH6QTJ.js → chunk-LYRSA2EI.js} +13 -3
- package/dist/chunks/{chunk-554TYJKV.js → chunk-M2J4MIKF.js} +1 -1
- package/dist/chunks/{chunk-4TAAEP5J.js → chunk-MCKKADC2.js} +1 -1
- package/dist/chunks/{chunk-TDHFWPK5.js → chunk-MKXE2IE4.js} +1 -1
- package/dist/chunks/{chunk-SPV6M2GS.js → chunk-MNRHYWPJ.js} +1 -1
- package/dist/chunks/{chunk-6TYBUUO4.js → chunk-MXAXD5DQ.js} +1 -1
- package/dist/chunks/{chunk-A7YTYTWM.js → chunk-MXN736AL.js} +1 -1
- package/dist/chunks/{chunk-EZ7CJF5G.js → chunk-N5MSOEHD.js} +1 -1
- package/dist/chunks/{chunk-5THEFDOZ.js → chunk-NJFTAKDY.js} +1 -1
- package/dist/chunks/{chunk-7RAGU3PA.js → chunk-NPROMJAU.js} +1 -1
- package/dist/chunks/{chunk-O47OWLP7.js → chunk-OKRQ2XLR.js} +1 -1
- package/dist/chunks/chunk-PDPX7546.js +12 -0
- package/dist/chunks/{chunk-VHRQW57O.js → chunk-PDUIYEMP.js} +1 -1
- package/dist/chunks/{chunk-OKKG2FUS.js → chunk-PIDEH4SJ.js} +1 -1
- package/dist/chunks/{chunk-QFCYM4RS.js → chunk-PY4WWD6Z.js} +1 -1
- package/dist/chunks/{chunk-B6WYIUOW.js → chunk-Q2PXJ55R.js} +1 -1
- package/dist/chunks/{chunk-LT3Z7YQX.js → chunk-QM2VCL36.js} +1 -1
- package/dist/chunks/{chunk-UZQJQXGJ.js → chunk-QOLGACFD.js} +1 -1
- package/dist/chunks/{chunk-N7NTAYBS.js → chunk-R5EPF72H.js} +1 -1
- package/dist/chunks/{chunk-KRZBZ7PB.js → chunk-RDO7G5LL.js} +1 -1
- package/dist/chunks/{chunk-U6P3UM3Z.js → chunk-RUGX7ONC.js} +1 -1
- package/dist/chunks/{chunk-YVIAN4VL.js → chunk-SCXMZVZ4.js} +1 -1
- package/dist/chunks/{chunk-A3C67PNC.js → chunk-SKYIWHB5.js} +1 -1
- package/dist/chunks/{chunk-HR66URIC.js → chunk-SYJXONEV.js} +1 -1
- package/dist/chunks/chunk-T3SXUNB7.js +21 -0
- package/dist/chunks/{chunk-TA4HB2ZR.js → chunk-TKF4SYCC.js} +1 -1
- package/dist/chunks/{chunk-YEQ7BBOS.js → chunk-TWHV3M4I.js} +1 -1
- package/dist/chunks/{chunk-ABSFPYM4.js → chunk-UDZJCD5W.js} +1 -1
- package/dist/chunks/{chunk-C35XH6YM.js → chunk-UJKEX77T.js} +1 -1
- package/dist/chunks/chunk-UQZZX2J7.js +7 -0
- package/dist/chunks/{chunk-6Q2XEYCJ.js → chunk-VHSAI6FS.js} +1 -1
- package/dist/chunks/chunk-VRYJNBOR.js +7 -0
- package/dist/chunks/chunk-WJX5PGNN.js +7 -0
- package/dist/chunks/chunk-WZCLCG4J.js +7 -0
- package/dist/chunks/{chunk-GUSOYIW6.js → chunk-XDYVJWGX.js} +1 -1
- package/dist/chunks/{chunk-E7CEQ2PO.js → chunk-XECELSF5.js} +1 -1
- package/dist/chunks/chunk-XKPB27SC.js +8 -0
- package/dist/chunks/{chunk-2QYOZU6E.js → chunk-XPFVO6C6.js} +1 -1
- package/dist/chunks/{chunk-DCUWC7WP.js → chunk-XTLEX3PJ.js} +1 -1
- package/dist/chunks/chunk-Y3F3TOOX.js +10 -0
- package/dist/chunks/{chunk-6VUD3LZP.js → chunk-ZKQ47ZXI.js} +1 -1
- package/dist/chunks/chunk-ZRA5BQXP.js +27 -0
- package/dist/chunks/{chunk-MCLT57FD.js → chunk-ZTLBMY3L.js} +1 -1
- package/dist/chunks/{chunk-HIK5CJTT.js → chunk-ZUDCZSDX.js} +1 -1
- package/dist/chunks/{chunk-OFOZ5DBA.js → chunk-ZZD5W5KT.js} +1 -1
- package/dist/chunks/{clear-L4HSULAA.js → clear-GJJUFB2T.js} +1 -1
- package/dist/chunks/{cli-embedded-NCWN74UF.js → cli-embedded-6SKYFUXJ.js} +2 -3
- package/dist/chunks/{compile-vercel-config-3AD57TKS.js → compile-vercel-config-6X6PGKDP.js} +1 -1
- package/dist/chunks/{config-N4SB5PPU.js → config-PJG22P4Z.js} +1 -1
- package/dist/chunks/{config-E7OJDF2P.js → config-S5V6CZRI.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{contract-EULMKZS4.js → contract-R7ZFR2S3.js} +1 -1
- package/dist/chunks/{delete-33WIMH3P.js → delete-K4E77OOH.js} +1 -1
- package/dist/chunks/{delete-45EEPRWI.js → delete-NPYVDIFP.js} +1 -1
- package/dist/chunks/{describe-QAF4MI7I.js → describe-P4GM6EO2.js} +1 -1
- package/dist/chunks/{detect-projects-XGIE3YBG.js → detect-projects-4GK5I7QF.js} +1 -1
- package/dist/chunks/{detect-services-AAVP4EBS.js → detect-services-RPRW33BU.js} +1 -1
- package/dist/chunks/{disable-H3Z7OJJE.js → disable-OVOL3LWV.js} +1 -1
- package/dist/chunks/{discard-KIEAG7NI.js → discard-WOXNVSDS.js} +1 -1
- package/dist/chunks/{edit-YQJNSZTX.js → edit-G4DQQ4RV.js} +1 -1
- package/dist/chunks/{edit-3Q36ZYIA.js → edit-TSHEL2Y4.js} +1 -1
- package/dist/chunks/{enable-BMB5D7AO.js → enable-TDASZXQQ.js} +1 -1
- package/dist/chunks/{engine-DkdkXQEy-FDYYIXY7.js → engine-DkdkXQEy-VKQPUSSO.js} +1 -1
- package/dist/chunks/{export-QQAZAQOU.js → export-3EX2GKDG.js} +1 -1
- package/dist/chunks/{future-TZACZMSV.js → future-JZGOH3V2.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-EZM5MW2G.js → generate-cert-for-deploy-C7O33LOJ.js} +1 -1
- package/dist/chunks/{image-YAMHIRFF.js → image-OVUBWPST.js} +1 -1
- package/dist/chunks/{import-builders-DE7NPR7N.js → import-builders-FKD73NYP.js} +1 -1
- package/dist/chunks/{inspect-MFVWIQT4.js → inspect-AJR3QIH5.js} +1 -1
- package/dist/chunks/{inspect-QNZWH5O3.js → inspect-AV5FVCCK.js} +1 -1
- package/dist/chunks/{inspect-OHNQUBKI.js → inspect-SEXVZS4G.js} +1 -1
- package/dist/chunks/{inspect-DIH47SML.js → inspect-TBSVBZUN.js} +1 -1
- package/dist/chunks/{inspect-VCJDESUJ.js → inspect-V4SPH2NB.js} +1 -1
- package/dist/chunks/{inspect-Y5LG6JUC.js → inspect-ZJD2MJWC.js} +1 -1
- package/dist/chunks/{list-AYUHH7TO.js → list-C6FS72S5.js} +1 -1
- package/dist/chunks/{list-KB6YGNJZ.js → list-EBCMDKJS.js} +1 -1
- package/dist/chunks/{list-C7GYUVSJ.js → list-M77FQQFX.js} +1 -1
- package/dist/chunks/{list-YJSC2ST6.js → list-QJZEUHZD.js} +1 -1
- package/dist/chunks/{login-T2VKRCUS.js → login-6PBI6PM2.js} +1 -1
- package/dist/chunks/{login-E47LQVJN.js → login-XYSPQU6N.js} +1 -1
- package/dist/chunks/{logs-BLMH6Y45.js → logs-ANETOSUR.js} +1 -1
- package/dist/chunks/{ls-V6KTI55Z.js → ls-26I7XZBC.js} +1 -1
- package/dist/chunks/{ls-BPRVNFEB.js → ls-2YN4PHE6.js} +1 -1
- package/dist/chunks/{ls-CBV4C474.js → ls-AXYPC5JY.js} +1 -1
- package/dist/chunks/{ls-JOOH2AF2.js → ls-DK6563EC.js} +1 -1
- package/dist/chunks/{ls-GI4HMBK6.js → ls-OUPL2GET.js} +1 -1
- package/dist/chunks/{ls-EBJTSOO7.js → ls-W7P3L76L.js} +1 -1
- package/dist/chunks/{ls-5KNEE66N.js → ls-XXK4CXFN.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-ZMZITRD4.js → migrate-experimental-services-MSGNPCL7.js} +1 -1
- package/dist/chunks/{mutate-5AQS53DH.js → mutate-IBPZFKJ5.js} +1 -1
- package/dist/chunks/{notifications-T74YEQUZ.js → notifications-D2EQYROT.js} +1 -1
- package/dist/chunks/{open-GUNAPG6S.js → open-CXDBD72L.js} +1 -1
- package/dist/chunks/openapi-XZOI5Q7B.js +7 -0
- package/dist/chunks/{permissions-BISSYSWA.js → permissions-BPXSQD6I.js} +1 -1
- package/dist/chunks/{plugin-offer-NIDPSYYJ.js → plugin-offer-SQNMTIYE.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-YR5RBSGW.js → prompt-missing-credentials-QM4NGCZD.js} +1 -1
- package/dist/chunks/{publish-D7EXNS3C.js → publish-5BKJUDF2.js} +1 -1
- package/dist/chunks/{pull-NQ2FQBCM.js → pull-L7VY77Y4.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-YG3AOXZ7.js → purchase-domain-if-available-P66IAKLA.js} +1 -1
- package/dist/chunks/{push-OCU3RUHV.js → push-ZDALENLW.js} +1 -1
- package/dist/chunks/query-N4C5TD22.js +7 -0
- package/dist/chunks/raw-query-A7U4PTQZ.js +8 -0
- package/dist/chunks/{reauthenticate-S7ZZYONP.js → reauthenticate-ZX6AMGZ6.js} +1 -1
- package/dist/chunks/{remove-LZTO47IA.js → remove-TRI7VSFC.js} +1 -1
- package/dist/chunks/{reorder-TMBGWMPR.js → reorder-BCRI7RUZ.js} +1 -1
- package/dist/chunks/{reply-55HPMB6K.js → reply-SFW3HYUS.js} +1 -1
- package/dist/chunks/{resolve-BTBTAK33.js → resolve-QK4KE7FE.js} +1 -1
- package/dist/chunks/{resolve-agent-team-3QXPCCT7.js → resolve-agent-team-Z7ZHCMLX.js} +1 -1
- package/dist/chunks/{restore-K6LCLHTG.js → restore-LWBDMFH2.js} +1 -1
- package/dist/chunks/{rm-CEUCQRIX.js → rm-7CDYQOBQ.js} +1 -1
- package/dist/chunks/{rm-I5PRDQHP.js → rm-KIPL54AA.js} +1 -1
- package/dist/chunks/{rm-UOP7BPBQ.js → rm-OWZAM6LM.js} +1 -1
- package/dist/chunks/{rm-LL6X65SS.js → rm-PMS5WEEL.js} +1 -1
- package/dist/chunks/{rm-4PSIPJUA.js → rm-WBSH2FU4.js} +1 -1
- package/dist/chunks/{rule-inspect-DKODR7X2.js → rule-inspect-O544YVJS.js} +1 -1
- package/dist/chunks/{schema-L3YB2LQE.js → schema-UYWLZVGF.js} +1 -1
- package/dist/chunks/{schema-LRVPWIYU.js → schema-XKG4E3TS.js} +1 -1
- package/dist/chunks/{select-org-JQBD5NDP.js → select-org-SGAC2GQ5.js} +1 -1
- package/dist/chunks/{serving-DKny38LK-UNINNTL5.js → serving-DKny38LK-WG5QDDEJ.js} +1 -1
- package/dist/chunks/{set-YBCB2ZLD.js → set-J4UEV5IF.js} +1 -1
- package/dist/chunks/{set-UMNUZAGG.js → set-NRTRIRMB.js} +1 -1
- package/dist/chunks/{setup-and-link-JRQ5DLOI.js → setup-and-link-ZXJW6CB4.js} +1 -1
- package/dist/chunks/{skills-DDFYTBGG.js → skills-GICDAOI2.js} +3 -1
- package/dist/chunks/{tags-WRH47Z4W.js → tags-5BLLDHDY.js} +1 -1
- package/dist/chunks/token-MYYNOUIT.js +7 -0
- package/dist/chunks/{token-util-KL35LHLQ.js → token-util-OJHS52JP.js} +1 -1
- package/dist/chunks/{types-NQECZN4K.js → types-HBXTZZAC.js} +1 -1
- package/dist/chunks/{update-FAMBH7PW.js → update-NXJ7PC5H.js} +1 -1
- package/dist/chunks/{usage-YACGLTPY.js → usage-6U2JZOPE.js} +1 -1
- package/dist/chunks/{validate-config-X6DF35VG.js → validate-config-6RVSBIWX.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +11 -10
- package/dist/commands/dev/index.js +5 -5
- package/dist/commands/env/index.js +3 -3
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +31 -29
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +18 -18
- package/dist/commands-ai.js +130 -80
- package/dist/commands-blob.js +16 -16
- package/dist/commands-core.js +9 -9
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +165 -142
- package/dist/commands-integrations.js +6 -6
- package/dist/commands-observability.js +3 -3
- package/dist/commands-routing.js +7 -7
- package/dist/help.js +1 -1
- package/dist/index.js +4 -4
- package/dist/internal-build.js +1 -1
- package/dist/package.json +41 -41
- package/dist/version.mjs +1 -1
- package/package.json +43 -43
- package/dist/chunks/chunk-3S7H6NCV.js +0 -20
- package/dist/chunks/chunk-5PAMKYPV.js +0 -14
- package/dist/chunks/chunk-AY523IYR.js +0 -7
- package/dist/chunks/chunk-DIHB5BUY.js +0 -8
- package/dist/chunks/chunk-EB7744O7.js +0 -24
- package/dist/chunks/chunk-EI4CUIVA.js +0 -7
- package/dist/chunks/chunk-EZVNGJN5.js +0 -7
- package/dist/chunks/chunk-HOGVBY6Q.js +0 -11
- package/dist/chunks/chunk-HSCWCGL7.js +0 -7
- package/dist/chunks/chunk-IIMHD3FA.js +0 -7
- package/dist/chunks/chunk-KRVZKKJV.js +0 -12
- package/dist/chunks/chunk-LNQAOLNW.js +0 -10
- package/dist/chunks/chunk-MZ7ITRVR.js +0 -12
- package/dist/chunks/chunk-SEHERY6U.js +0 -7
- package/dist/chunks/chunk-U2ZNF6HN.js +0 -8
- package/dist/chunks/chunk-UIGZMWS6.js +0 -16
- package/dist/chunks/chunk-YANOBY2G.js +0 -7
- package/dist/chunks/openapi-5WTF7EXK.js +0 -7
- package/dist/chunks/query-FM6SRTQP.js +0 -12
- package/dist/chunks/token-3ILJZPAZ.js +0 -7
- package/dist/chunks/token-JJLQVXPI.js +0 -7
- package/dist/chunks/token-util-A4BSB3KP.js +0 -7
- /package/dist/chunks/{chunk-WFS3XBAA.js → chunk-MRCM5VF5.js} +0 -0
- /package/dist/chunks/{chunk-SNGM6NSO.js → chunk-TK7K6GCG.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
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{require_dist as require_dist2}from"./chunk-MTJLZGL5.js";import{require_dist}from"./chunk-ISSNEDG5.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=500,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string",minLength:1,maxLength:4096},{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=entrypoint=>/(docker|container)file/i.test((0,import_build_utils.splitDockerfileEntrypoint)(entrypoint).path.split(/[\\/]/).pop()??""),hasInvalidDockerfileStage=entrypoint=>{let{buildTarget}=(0,import_build_utils.splitDockerfileEntrypoint)(entrypoint);return buildTarget!==void 0&&!(0,import_build_utils.isValidDockerfileStage)(buildTarget)};function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),scheduleServices=getScheduleServiceNames(config),destinationServices=new Set(getDestinationServices(config)),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(hasInvalidDockerfileStage(schedule.entrypoint))return invalidCommand(`\`${path}.entrypoint\` "${schedule.entrypoint}" is invalid. ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}if(scheduleServices.has(name)){if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidScheduleService(config,`\`${path}\` runs as a service, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidScheduleService(config,`\`${path}\` runs as service "${name}", which is already the name of a service or daemon.`);if(destinationServices.has(name))return invalidScheduleService(config,`Rewrites and routes cannot target schedule "${name}" because schedules do not receive traffic.`)}if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Service "${serviceName}"`,binding.service):new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons)),scheduleServices=getScheduleServiceNames(config);for(let[name,daemon]of Object.entries(daemons)){if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);if(hasInvalidDockerfileStage(daemon.entrypoint))return invalid(`Daemon "${name}" has invalid \`entrypoint\` "${daemon.entrypoint}". ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Daemon "${name}"`,binding.service):invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let daemonTarget=getDestinationServices(config).find(isDaemonTarget);return daemonTarget?invalid(`Rewrites and routes cannot target daemon "${daemonTarget}" because daemons do not receive traffic.`):null}function getScheduleServiceNames(config){return new Set(Object.entries(config.schedules??{}).filter(([,schedule])=>"entrypoint"in schedule||"command"in schedule).map(([name])=>name))}function invalidScheduleService(config,message){return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_SERVICE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`})}function scheduleBindingError(config,binder,schedule){return invalidScheduleService(config,`${binder} cannot bind to schedule "${schedule}" because schedules do not receive traffic.`)}function getDestinationServices(config){let services={...config.experimentalServicesV2,...config.services};return[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].flatMap(entry=>{let destination="destination"in entry?entry.destination:void 0;return typeof destination=="object"&&destination!==null?[destination.service]:[]})}export{buildVercelConfigSchema,validateConfig};
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
var DEPRECATED_SHORTHANDS=Symbol("deprecated shorthands"),SHORT_FLAG_LONG_NAMES={"-p":"--project","-n":"--limit"},commandFlagsSpecification;function setCommandFlagsSpecification(spec){commandFlagsSpecification=spec}function getShortFlagLongName(flag,spec=commandFlagsSpecification){if(!/^-[A-Za-z]+$/.test(flag))return;let letter=`-${flag.slice(-1)}`,name=SHORT_FLAG_LONG_NAMES[letter];if(!(name===void 0||spec!==void 0&&spec[letter]!==name))return name}function getShortFlags(option){return[option.shorthand,option.deprecatedShorthand].filter(letter=>!!letter).map(letter=>`-${letter}`)}function getFlagsSpecification(options){let flagsSpecification={},deprecatedShorthands=new Set;for(let option of options)flagsSpecification[`--${option.name}`]=option.type,option.shorthand&&(flagsSpecification[`-${option.shorthand}`]=`--${option.name}`),option.deprecatedShorthand&&(flagsSpecification[`-${option.deprecatedShorthand}`]=`--${option.name}`,deprecatedShorthands.add(`-${option.deprecatedShorthand}`));return flagsSpecification["--next"]&&!flagsSpecification["-N"]&&(flagsSpecification["-N"]="--next",deprecatedShorthands.add("-N")),deprecatedShorthands.size>0&&(flagsSpecification[DEPRECATED_SHORTHANDS]=[...deprecatedShorthands]),flagsSpecification}function quoteArg(value){return/^[A-Za-z0-9_./@:-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}var SENSITIVE_AUTH_FLAG_NAMES=new Set(["--token","-t"]),SDK_KEY_PATTERN=/^vf_(?:server|client)_/,ENV_PAIR_FLAG_NAMES=new Set(["--env","-e","--build-env","-b"]),ATTACHED_TOKEN=/^-t[^-=]/,SHORT_FLAG_CLUSTER=/^-[A-Za-z]{2,}$/;function normalizeFlagName(flag){return flag.includes("=")?flag.slice(0,flag.indexOf("=")):flag}var ENV_PLACEHOLDER="<VALUE>";function withoutEnvValue(pair){let equals=pair.indexOf("=");return equals<0||equals===pair.length-1?pair:`${pair.slice(0,equals+1)}${ENV_PLACEHOLDER}`}function quoteEnvPlaceholder(arg){return arg.endsWith(`=${ENV_PLACEHOLDER}`)?quoteArg(arg):arg}function stripSensitiveAuthArgs(args){let out=[],passthrough=!1;for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--"&&(passthrough=!0),!passthrough&&(arg.startsWith("--sdk-key=")||SDK_KEY_PATTERN.test(arg)))continue;if(!passthrough&&ATTACHED_TOKEN.test(arg)){SHORT_FLAG_CLUSTER.test(arg)&&i+1<args.length&&i++;continue}if(!passthrough&&SHORT_FLAG_CLUSTER.test(arg)){let letters=arg.slice(1),token=letters.indexOf("t");if(token>0){out.push(`-${letters.slice(0,token)}`),token===letters.length-1&&i+1<args.length&&i++;continue}out.push(arg);let last=`-${letters[letters.length-1]}`;ENV_PAIR_FLAG_NAMES.has(last)&&i+1<args.length&&!args[i+1].startsWith("-")&&out.push(withoutEnvValue(args[++i]));continue}let name=normalizeFlagName(arg);if(SENSITIVE_AUTH_FLAG_NAMES.has(name)){!arg.includes("=")&&i+1<args.length&&i++;continue}if(!passthrough&&ENV_PAIR_FLAG_NAMES.has(name)){if(arg.includes("=")){out.push(`${name}=${withoutEnvValue(arg.slice(name.length+1))}`);continue}out.push(arg),i+1<args.length&&!args[i+1].startsWith("-")&&out.push(withoutEnvValue(args[++i]));continue}out.push(arg)}return out}var globalCommandOptions=[{name:"help",shorthand:"h",type:Boolean,description:"Output usage information",deprecated:!1},{name:"version",shorthand:"v",type:Boolean,description:"Output the version number",deprecated:!1},{name:"cwd",shorthand:null,type:String,argument:"DIR",description:"Run the command in another directory",deprecated:!1},{name:"local-config",shorthand:"A",type:String,argument:"FILE",description:"Path to the local `vercel.json` file",deprecated:!1},{name:"global-config",shorthand:"Q",type:String,argument:"DIR",description:"Path to the global `.vercel` directory",deprecated:!1},{name:"debug",shorthand:"d",type:Boolean,description:"Debug mode (default: off)",deprecated:!1},{name:"no-color",shorthand:null,type:Boolean,description:"No color mode (default: off)",deprecated:!1},{name:"non-interactive",shorthand:null,type:Boolean,description:"Run without interactive prompts (default: on when an agent is detected)",deprecated:!1},{name:"scope",shorthand:"S",type:String,argument:"TEAM",description:"Team to run the command in (slug or ID)",deprecated:!1},{name:"token",shorthand:"t",type:String,argument:"TOKEN",description:"Login token",deprecated:!1},{name:"team",shorthand:"T",type:String,deprecated:!1},{name:"api",shorthand:null,type:String,deprecated:!1}],GLOBAL_CLI_FLAG_NAMES=(()=>{let set=new Set;for(let opt of globalCommandOptions){set.add(`--${opt.name}`);for(let flag of getShortFlags(opt))set.add(flag)}return set})();function globalCliFlagTakesValue(flagName){let normalized=normalizeFlagName(flagName);for(let opt of globalCommandOptions)if(`--${opt.name}`===normalized||getShortFlags(opt).includes(normalized))return opt.type===String;return!1}var SUGGESTION_FLAGS_TAKING_VALUE=new Set(["--config","--deployment","--environment","--git-branch","--id","--value","--status","--name","--slug","--version","--search","--format","--project","--page","--per-page","--type","--visibility"]);function suggestionFlagTakesSeparateValue(flagName){let name=normalizeFlagName(flagName);return globalCliFlagTakesValue(name)?!0:SUGGESTION_FLAGS_TAKING_VALUE.has(getShortFlagLongName(name)??name)}function getSameSubcommandSuggestionFlags(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(!a.startsWith("-")||(out.push(a),a.includes("=")))continue;suggestionFlagTakesSeparateValue(a)&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&out.push(safeArgs[++i])}return out}var GLOBAL_OPTIONS=getFlagsSpecification(globalCommandOptions),arg_common_default=()=>GLOBAL_OPTIONS,yesOption={name:"yes",shorthand:"y",type:Boolean,deprecated:!1,description:"Accept default value for all prompts"},nextCursorOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},confirmOption={name:"confirm",shorthand:"c",type:Boolean,deprecated:!0},confirmNameOption={name:"confirm-name",shorthand:null,type:String,deprecated:!1,description:"Approve by naming what this acts on, without its team",argument:"NAME"},effectsDigestOption={name:"effects-digest",shorthand:null,type:String,deprecated:!1,description:"The effects digest from the preview. Agents must pass it; nothing changes if the effects changed since",argument:"DIGEST"},chargeAmountOption={name:"amount",shorthand:null,type:String,argument:"USD",deprecated:!1,description:"Exact price a person approved for this charge, in USD. Not a maximum: any other amount charges nothing. Required without a terminal"},limitOption={name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Number of results to return per page (default: 20, max: 100)",argument:"NUMBER"},sinceOption={name:"since",shorthand:"s",type:String,argument:"TIME",deprecated:!1,description:"Start time: ISO 8601 or relative, like 1h or 7d"},untilOption={name:"until",shorthand:"u",type:String,argument:"TIME",deprecated:!1,description:"End time: ISO 8601 or relative (default: now)"},environmentOption={name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production, preview, development, or a custom environment"},targetOption={name:"target",shorthand:null,type:String,argument:"ENVIRONMENT",deprecated:!0,description:"Deprecated alias for `--environment`"},gitBranchOption={name:"git-branch",shorthand:null,type:String,argument:"BRANCH",deprecated:!1,description:"Git branch"},userOption={name:"user",shorthand:null,type:String,argument:"USER",deprecated:!1,description:"User"},forceOption={name:"force",shorthand:null,type:Boolean,deprecated:!1},formatOption={name:"format",shorthand:"F",type:String,argument:"FORMAT",description:"Specify the output format (json)",deprecated:!0},jsonOption={name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output as JSON"};var allOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List resources across all projects"},projectOption={name:"project",shorthand:"p",type:String,argument:"NAME_OR_ID",description:"Project name or ID (default: linked project)",deprecated:!1},deploymentOption={name:"deployment",shorthand:null,type:String,deprecated:!1,description:"The deployment ID or URL to target",argument:"DEPLOYMENT"},protectionBypassOption={name:"protection-bypass",shorthand:null,type:String,deprecated:!1,description:"Protection bypass secret for accessing protected deployments",argument:"SECRET"},GLOBAL_LONG_TO_OPT=new Map,GLOBAL_SHORT_TO_OPT=new Map;for(let opt of globalCommandOptions){GLOBAL_LONG_TO_OPT.set(`--${opt.name}`,opt);for(let flag of getShortFlags(opt))GLOBAL_SHORT_TO_OPT.set(flag,opt)}function getGlobalFlagsFromArgs(args,options){let delimiterIndex=args.indexOf("--"),cliArgs=delimiterIndex===-1?args:args.slice(0,delimiterIndex),safeArgs=stripSensitiveAuthArgs(cliArgs),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(options?.preserveYes&&(a==="--yes"||a==="-y")){out.push(a);continue}if(options?.preserveConfig&&(a==="--config"||a.startsWith("--config="))){if(out.push(a),a==="--config"){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}continue}let opt;if(a.startsWith("--")&&a.includes("=")){let name=a.slice(2).split("=")[0];opt=GLOBAL_LONG_TO_OPT.get(`--${name}`),opt&&out.push(a);continue}if(opt=GLOBAL_LONG_TO_OPT.get(a)||GLOBAL_SHORT_TO_OPT.get(a),!!opt&&(out.push(a),opt.type===String&&!a.includes("="))){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}}if(options?.preserveProject){let projectOption2=findProjectOption(safeArgs);projectOption2&&out.push(...projectOption2.args)}return out}function findProjectOption(args){for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--")return;if(arg.startsWith("--project="))return{value:arg.slice(10),args:[arg]};if(arg==="--project"||getShortFlagLongName(arg)==="--project"){let value=args[i+1];return value&&!value.startsWith("-")?{value,args:["--project",value]}:void 0}}}function getProjectOptionFromArgs(args){return findProjectOption(args)?.value}export{DEPRECATED_SHORTHANDS,setCommandFlagsSpecification,getShortFlagLongName,getShortFlags,getFlagsSpecification,quoteArg,SDK_KEY_PATTERN,normalizeFlagName,quoteEnvPlaceholder,stripSensitiveAuthArgs,globalCommandOptions,GLOBAL_CLI_FLAG_NAMES,globalCliFlagTakesValue,suggestionFlagTakesSeparateValue,getSameSubcommandSuggestionFlags,arg_common_default,yesOption,nextCursorOption,confirmOption,confirmNameOption,effectsDigestOption,chargeAmountOption,limitOption,sinceOption,untilOption,environmentOption,targetOption,gitBranchOption,userOption,forceOption,formatOption,jsonOption,allOption,projectOption,deploymentOption,protectionBypassOption,getGlobalFlagsFromArgs,getProjectOptionFromArgs};
|
|
@@ -1,11 +0,0 @@
|
|
|
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{linkCommand}from"./chunk-OFZUWHZW.js";import{teamCache}from"./chunk-2VBFQZ72.js";import{InvalidToken,LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{recordCliError}from"./chunk-AP6DZGTK.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{arg_common_default,getFlagsSpecification,getGlobalFlagsFromArgs,normalizeFlagName,quoteArg,quoteEnvPlaceholder,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-EZVNGJN5.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",AGENT_CANNOT_SWITCH:"agent_cannot_switch",API_ERROR:"api_error",STDIN_ERROR:"stdin_error",RATE_LIMITED:"rate_limited",NETWORK_ERROR:"network_error",NATIVE_BINARY_UNAVAILABLE:"native_binary_unavailable",PLATFORM_UNSUPPORTED:"platform_unsupported",SPAWN_FAILED:"spawn_failed",UNKNOWN_COMMAND:"unknown_command",MISSING_COMMAND:"missing_command",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",PRICE_CHANGED:"price_changed",EFFECTS_CHANGED:"effects_changed",CONFLICT:"conflict",DOMAIN_NOT_AVAILABLE:"domain_not_available",TLD_NOT_SUPPORTED:"tld_not_supported",PAYMENT_FAILED:"payment_failed",PAYMENT_AUTHENTICATION_REQUIRED:"payment_authentication_required",UNKNOWN_OUTCOME:"unknown_outcome",PURCHASE_IN_PROGRESS:"purchase_in_progress",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",PAGE_INTEGRITY_NOT_AVAILABLE:"page_integrity_not_available",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_SINGLE_AT_PASSED:"schedule_single_at_passed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",REDIRECT_FAILED:"redirect_failed",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",TARGET_CONFLICT:"target_conflict",BOARD_NOT_FOUND:"board_not_found",CHANNEL_NOT_FOUND:"channel_not_found",MESSAGE_NOT_FOUND:"message_not_found",DEPLOYMENT_PROTECTED:"deployment_protected",WRONG_PROJECT:"wrong_project",WRONG_URL:"wrong_url",AMBIGUOUS_AGENT:"ambiguous_agent",UNKNOWN_OPTION:"unknown_option",FILE_NOT_FOUND:"file_not_found",BOARD_OUTDATED:"board_outdated",TIMEOUT:"timeout",FIRST_DEPLOYMENT_PRODUCTION:"first_deployment_production",BLOB_PREFLIGHT_FAILED:"blob_preflight_failed",BLOB_SETUP_REQUIRED:"blob_setup_required",CONNECT_METHOD_UNAVAILABLE:"connect_method_unavailable",CONNECT_PREFLIGHT_FAILED:"connect_preflight_failed",CONNECT_PRODUCTION_REQUIRED:"connect_production_required",CONNECT_SETUP_FAILED:"connect_setup_failed",CONNECT_SETUP_INCOMPLETE:"connect_setup_incomplete",CONNECT_SETUP_REQUIRED:"connect_setup_required",CONNECT_TRIGGER_LIMIT:"connect_trigger_limit",CONNECT_TRIGGERS_UNSUPPORTED:"connect_triggers_unsupported",CONNECTION_CHANGED:"connection_changed",CONNECTOR_CHANGED:"connector_changed",CONNECTOR_MISMATCH:"connector_mismatch",COPY_UNVERIFIED:"copy_unverified",DEPLOYMENT_CHANGED:"deployment_changed",DEPLOYMENT_ENVIRONMENT_MISMATCH:"deployment_environment_mismatch",DEPLOYMENT_FAILED:"deployment_failed",ENVIRONMENT_INCOMPLETE:"environment_incomplete",GITHUB_SETUP_REQUIRED:"github_setup_required",GROUP_CHANGED:"group_changed",INVALID_CONFIG:"invalid_config",INVALID_GROUP_NAME:"invalid_group_name",INVALID_MICROFRONTENDS:"invalid_microfrontends",INVALID_RESOURCE:"invalid_resource",INVALID_RESOURCE_METADATA:"invalid_resource_metadata",INVALID_RUN:"invalid_run",INVALID_SOURCE:"invalid_source",MISSING_RESOURCE_INPUT:"missing_resource_input",MISSING_RESOURCE_METADATA:"missing_resource_metadata",PROJECT_CHANGED:"project_changed",REPOSITORY_MISMATCH:"repository_mismatch",REPOSITORY_REQUIRED:"repository_required",REQUIRED_RESOURCE:"required_resource",RESOURCE_CHANGED:"resource_changed",RESOURCE_UNVERIFIED:"resource_unverified",RUN_LOCKED:"run_locked",RUN_MISMATCH:"run_mismatch",SOURCE_CHANGED:"source_changed",SOURCE_UNAVAILABLE:"source_unavailable",TEMPLATE_NOT_DEPLOYABLE:"template_not_deployable",UNSUPPORTED_PROTOCOL_SETTINGS:"unsupported_protocol_settings",DEPRECATED:"deprecated",LIMIT_CLAMPED:"limit_clamped",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap",INCOMPLETE_RESULTS:"incomplete_results",COMMAND_FAILED:"command_failed",INTERNAL_ERROR:"internal_error"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url","unknown_option","wrong_url","ambiguous_agent","file_not_found","repository_required"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus",PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro",PROJECT_ENABLE_COMMAND="project observability enable";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function observabilityPlusDenialReason(error){if(!error||typeof error!="object"||!("meta"in error))return;let meta=error.meta;if(meta&&typeof meta=="object"&&"reason"in meta&&typeof meta.reason=="string")return meta.reason}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function isHobbyLikePlan(plan){return plan==="hobby"||plan==="oss"}function isProOrEnterprisePlan(plan){return plan==="pro"||plan==="enterprise"}function currentTeamPlan(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.billing?.plan}function planForTeam(idOrSlug){return teamCache.get(idOrSlug)?.billing?.plan}function buyProFix(hint){return{command:BUY_PRO_COMMAND,hint:hint??`Upgrade with ${getCommandName(BUY_PRO_COMMAND)}.`,when:"a person has approved upgrading the plan"}}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function inferDenialReason(message){if(/(?:disabled|switched off|re-enable)/i.test(message))return"subscription_disabled";if(/excluded from it|include the project/i.test(message))return"project_excluded";if(/upgrade your plan/i.test(message)&&/pro and enterprise/i.test(message))return"plan_upgrade_required";if(/(?:quota|usage limit|query limit)/i.test(message))return"quota"}function plusNeedsPlanUpgradeHint(){return`Observability Plus is available on Pro and Enterprise. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}. The add-on cannot be purchased on Hobby.`}function observabilityPlusRecovery(message,denialReason,plan){if(mentionsObservabilityPlus(message))switch(denialReason??inferDenialReason(message)){case"subscription_disabled":return{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."};case"project_excluded":return{command:PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:`Observability Plus is on for the team, but this project is excluded. Enable it with ${getCommandName(PROJECT_ENABLE_COMMAND)}. A new subscription is not needed.`,preserveProject:!1,when:"a person has approved enabling Observability Plus for this project"};case"plan_upgrade_required":return buyProFix(plusNeedsPlanUpgradeHint());case"quota":return{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."};default:return isHobbyLikePlan(plan)?buyProFix(plusNeedsPlanUpgradeHint()):{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}}function priorityProjectRecovery(message,plan){if(mentionsPriorityProject(message))return isHobbyLikePlan(plan)?buyProFix(`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}, then run ${getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND)}.`):{command:PRIORITY_PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND),preserveProject:!1,when:"user runs this command in an interactive terminal"}}function observabilityPlanRecovery(message,denialReason,plan){return priorityProjectRecovery(message,plan)??observabilityPlusRecovery(message,denialReason,plan)}var PROJECT_POSITIONAL_COMMANDS=new Set([PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND]);function currentTeamScope(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.slug??id}function targetRecovery(fix,target){if(!fix)return;let targeted=command=>{let out=command;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(command)&&(out+=` ${quoteArg(target.projectName)}`),target.scope&&(out+=` --scope ${quoteArg(target.scope)}`),out},hint=fix.hint;for(let command of[BUY_PRO_COMMAND,OBSERVABILITY_PLUS_PURCHASE_COMMAND,PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND])hint=hint.split(getCommandName(command)).join(getCommandName(targeted(command)));if(!fix.command)return{...fix,hint};let excludeFlags=new Set(fix.excludeFlags??[]),preserveProject=fix.preserveProject;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(fix.command)&&(excludeFlags.add("--project"),preserveProject=!1),fix.command===BUY_PRO_COMMAND&&excludeFlags.add("--project"),target.scope&&(excludeFlags.add("--scope"),excludeFlags.add("--team")),{...fix,command:targeted(fix.command),hint,...excludeFlags.size?{excludeFlags:Array.from(excludeFlags)}:{},...preserveProject!==void 0?{preserveProject}:{}}}function clientObservabilityPlanRecovery(client,error,message,projectName,scope){return targetRecovery(observabilityPlanRecovery(message,observabilityPlusDenialReason(error),scope?planForTeam(scope):currentTeamPlan(client)),{projectName,scope:scope??currentTeamScope(client)})}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}var TOKENS_URL="https://vercel.com/account/tokens";function isInvalidTokenApiError(error){if(typeof error!="object"||error===null)return!1;let{status,invalidToken,missingToken}=error;return(status===401||status===403)&&(invalidToken===!0||missingToken===!0)}function isInvalidTokenError(error){return error instanceof InvalidToken||isInvalidTokenApiError(error)}function getInvalidTokenRecovery(client){let source=client?.authConfig?.tokenSource,create=`Create a token at ${TOKENS_URL}.`;return{hint:source==="env"?`Replace the token in VERCEL_TOKEN with a valid one, or unset it to use the saved login, then retry. ${create}`:source==="flag"?`Pass a valid token with --token, or set VERCEL_TOKEN, then retry. ${create}`:`Run \`${getCommandNamePlain("login")}\`. It prints a URL and a code. A person opens the URL to approve the login. Or set VERCEL_TOKEN or pass --token with a valid token, then retry. ${create}`,retryable:!1,userActionRequired:!0}}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(isInvalidTokenApiError(error))return getInvalidTokenRecovery(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlanRecovery(message,observabilityPlusDenialReason(error),currentTeamPlan(client))?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}var import_error_utils=__toESM(require_dist(),1),import_strip_ansi=__toESM(require_strip_ansi(),1);import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function isHelpInvocation(argv){let args=argv.slice(2),separator=args.indexOf("--");return args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h")}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let help=isHelpInvocation(client.argv);client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.map(quoteEnvPlaceholder).join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){let flag=arg==="-e"?"--environment":arg;preserved.push(flag),!flag.includes("=")&&suggestionFlagTakesSeparateValue(flag)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}var LINK_FLAGS={...arg_common_default(),...getFlagsSpecification(linkCommand.options)};function getLinkSuggestionArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.startsWith("-"))continue;let spec=LINK_FLAGS[normalizeFlagName(arg)],handler=typeof spec=="string"?LINK_FLAGS[spec]:spec,hasSeparateValue=!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-");if(handler===void 0){hasSeparateValue&&suggestionFlagTakesSeparateValue(arg)&&i++;continue}out.push(arg),hasSeparateValue&&handler!==Boolean&&out.push(args[++i])}return out}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.map(quoteEnvPlaceholder).join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkCommand2=buildCommandWithGlobalFlags(argv,"link",packageName,{preserveProject:!0,excludeFlags:["--scope","--team"]});for(let choice of payload.choices){let slug=choice.name;next.push({command:`${linkCommand2} --scope ${slug}`,when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeActionRequired(client,payload),process.exit(exitCode))}function writeActionRequired(client,payload){let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),recordCliError({code:payload.reason}),writeErrorDocument(client,enriched)}function writeErrorDocument(client,document){if(!client.jsonMode){client.stdout.write(`${JSON.stringify(document,null,2)}
|
|
8
|
-
`);return}client.jsonMode.errorWritten=!0;let plain={...document,message:(0,import_strip_ansi.default)(document.message),...document.hint?{hint:(0,import_strip_ansi.default)(document.hint)}:{}};client.stderr.write(`${JSON.stringify(plain)}
|
|
9
|
-
`)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function buildInvalidTokenAgentError(client){let source=client.authConfig?.tokenSource;return{status:"error",reason:AGENT_REASON.LOGIN_REQUIRED,message:source==="flag"?"The token passed with --token is not valid.":source==="env"?"The token in VERCEL_TOKEN is not valid.":"The saved login is not valid or has expired.",...getInvalidTokenRecovery(client),...source!=="flag"&&source!=="env"&&{next:[{command:withGlobalFlags(client,"login"),when:"To sign in again; a person approves it in a browser"}]}}}function outputAgentError(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client),...client.isAgent&&payload.reason!==AGENT_REASON.LOGIN_REQUIRED&&{feedback:{message:"Please send one brief feedback report about this error while helping the user resolve it. Don't delay the user's request for feedback.",command:"Run the 'vercel feedback --help' command to see how to report feedback. Make sure all feedback, including text copied from errors or logs, excludes personal data, account identifiers (e.g., usernames, team IDs, project names), and secrets (e.g., API keys, tokens, env values, credentials)."}}};recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,enriched),writeErrorDocument(client,enriched)}function writeTrackedActionRequired(client,payload){let enriched={...payload,...agentErrorMetadata(client)};recordCliError({code:payload.reason,reportOnSuccess:!0}),payload.reason&&trackAgentError(client,{reason:payload.reason,userActionRequired:payload.userActionRequired}),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
10
|
-
`)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
11
|
-
`),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --query ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --query <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isInvalidTokenError(err)){writeAgentErrorPayloadAndExit(client,buildInvalidTokenAgentError(client),exitCode,variant);return}if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{AGENT_STATUS,AGENT_REASON,getExitCodeForReason,AGENT_ACTION,PRIORITY_PROJECT_ENABLE_COMMAND,BUY_PRO_COMMAND,isProOrEnterprisePlan,buyProFix,targetRecovery,clientObservabilityPlanRecovery,TOKENS_URL,isInvalidTokenApiError,isInvalidTokenError,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getLinkSuggestionArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,writeActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,buildInvalidTokenAgentError,outputAgentError,writeAgentError,writeTrackedActionRequired,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{toGranularityMsFromDuration}from"./chunk-UIGZMWS6.js";var VALUE_ALIAS="value",COUNT_ALIAS="__seriesCount";function alignTimeRangeToGranularity(startTime,endTime,granularity){let bucketMs=toGranularityMsFromDuration(granularity);return{startTime:new Date(Math.floor(startTime.getTime()/bucketMs)*bucketMs),endTime:new Date(Math.ceil(endTime.getTime()/bucketMs)*bucketMs)}}function createCanonicalMetricsRequest(options){let metrics={[VALUE_ALIAS]:options.selection},rankMetric=VALUE_ALIAS;return options.groupBy.length>0&&options.orderBy==="count"&&options.selection.aggregation!=="count"&&(metrics[COUNT_ALIAS]={metric:options.metric,aggregation:"count"},rankMetric=COUNT_ALIAS),{scope:{ownerId:options.scope.ownerId,...options.scope.type==="project"?{projectIds:options.scope.projectIds}:{}},timeRange:{start:options.startTime.toISOString(),end:options.endTime.toISOString()},bucketSeconds:toGranularityMsFromDuration(options.granularity)/1e3,...options.groupBy.length>0?{groupBy:options.groupBy}:{},...options.filter?{filter:options.filter}:{},metrics,outputs:[VALUE_ALIAS],...options.groupBy.length>0?{seriesSelection:{limit:options.limit,mode:"exact",rankBy:[{metric:rankMetric,direction:options.orderDirection??"desc"}]}}:{}}}function canonicalResponseToMetricsResponse(response,rollupColumn,orderBy,orderDirection){let toRow=point=>({...point.dimensions,[rollupColumn]:point.values[VALUE_ALIAS]??null});return{...response.series?{data:response.series.map(point=>({timestamp:point.timestamp,...toRow(point)}))}:{},summary:response.summary.map(toRow),statistics:{rowsRead:response.meta.statistics.rowsRead,bytesRead:response.meta.statistics.bytesRead,dbTimeSeconds:response.meta.statistics.databaseElapsedMs/1e3,engineTimeSeconds:response.meta.statistics.elapsedMs/1e3,queryTable:[...new Set(response.meta.sources.map(source=>source.id))].sort().join(",")},...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}var FILTER_DEPRECATION_WARNING="OData support in --query is deprecated and will be removed soon. KQL will be the only supported filter syntax.";function usesODataSyntax(filters){return filters?.some(filter=>{let unquoted=filter.replace(/"(?:\\.|[^"\\])*"|'(?:''|[^'])*'/g,"");return/\s(?:eq|ne|gt|ge|lt|le|in)\s/i.test(unquoted)||/\b(?:contains|startswith|endswith)\s*\(/i.test(unquoted)})??!1}export{alignTimeRangeToGranularity,createCanonicalMetricsRequest,canonicalResponseToMetricsResponse,FILTER_DEPRECATION_WARNING,usesODataSyntax};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{getGlobalPathConfig}from"./chunk-UXRRYYSD.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";var OPENAPI_URL="https://openapi.vercel.sh/",SSO_API_URL="https://vercel.com/sso-api",CACHE_FILE="openapi-spec.json",CACHE_TTL_MS=864e5,FETCH_TIMEOUT_MS=1e4,MAX_OPENAPI_SPEC_BYTES=52428800,VERCEL_CLI_ROOT_DISPLAY_KEY="__root__";async function readSpecResponse(response,url,maxBytes=52428800){let contentLength=response.headers.get("content-length");if(contentLength){let bytes=Number(contentLength);if(Number.isFinite(bytes)&&bytes>maxBytes)throw new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`)}if(!response.body)throw new Error(`OpenAPI spec from ${url} returned an empty response.`);let reader=response.body.getReader(),chunks=[],totalBytes=0;for(;;){let{done,value}=await reader.read();if(done)break;if(value){if(totalBytes+=value.byteLength,totalBytes>maxBytes)throw await reader.cancel(),new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`);chunks.push(value)}}let buffer=new Uint8Array(totalBytes),offset=0;for(let chunk of chunks)buffer.set(chunk,offset),offset+=chunk.byteLength;return JSON.parse(new TextDecoder().decode(buffer))}var ALLOWED_SPEC_HOSTS=["vercel.sh","vercel.tools"];function assertAllowedSpecUrl(specUrl){let parsedUrl=new URL(specUrl);if(parsedUrl.protocol!=="https:")throw new Error("OpenAPI spec URL must use https");if(!ALLOWED_SPEC_HOSTS.some(host=>isHostOrSubdomain(parsedUrl,host)))throw new Error("OpenAPI spec URL must be on an allowed origin.");return parsedUrl}function isHostOrSubdomain(url,host){return url.hostname===host||url.hostname.endsWith(`.${host}`)}import{join}from"path";import{readFile,writeFile,mkdir}from"fs/promises";var OpenApiCache=class{constructor(options){this.spec=null;this.error=null;this.cachePath=join(getGlobalPathConfig(),CACHE_FILE),this.specUrl=options?.specUrl,this.fetchSpecUrl=options?.fetchSpecUrl}get isLoaded(){return this.spec!==null}get loadError(){return this.error}async load(forceRefresh=!1){return this.loadSpec(forceRefresh)}async loadSpec(forceRefresh=!1){if(this.error=null,this.specUrl)return this.loadCustomSpec(this.specUrl);if(!forceRefresh){let cached=await this.readCache(this.cachePath);if(cached&&!this.isExpired(cached.fetchedAt))return output_manager_default.debug("Using cached OpenAPI spec"),this.spec=cached.spec,!0}try{return output_manager_default.debug("Fetching OpenAPI spec from "+OPENAPI_URL),this.spec=await this.fetchSpec(OPENAPI_URL),await this.saveCache(this.cachePath,this.spec),!0}catch(err){output_manager_default.debug(`Failed to fetch OpenAPI spec: ${err}`);let stale=await this.readCache(this.cachePath);return stale?(output_manager_default.debug("Using stale cached OpenAPI spec"),this.spec=stale.spec,!0):!1}}async loadCustomSpec(specUrl){try{assertAllowedSpecUrl(specUrl),output_manager_default.debug("Fetching OpenAPI spec from "+specUrl);let spec=this.fetchSpecUrl?await this.fetchSpecUrl(specUrl):await this.fetchSpec(specUrl);return spec?(this.validateSpec(spec,specUrl),this.spec=spec,!!this.spec):(this.error=`Could not load OpenAPI spec from ${specUrl}.`,!1)}catch(err){let message=err instanceof Error?err.message:String(err);return this.error=message,output_manager_default.debug(`Failed to fetch OpenAPI spec from ${specUrl}: ${message}`),!1}}async loadWithSpinner(forceRefresh=!1){output_manager_default.spinner(forceRefresh?"Refreshing API endpoints...":"Loading API endpoints...");let success=await this.load(forceRefresh);return output_manager_default.stopSpinner(),success}getEndpoints(){this.ensureLoaded();let endpoints=this.extractEndpoints();return this.sortEndpoints(endpoints)}getBodyFields(endpoint){if(this.ensureLoaded(),!endpoint.requestBody?.content)return[];let jsonContent=endpoint.requestBody.content["application/json"];if(!jsonContent?.schema)return[];let schema=this.resolveSchemaRef(jsonContent.schema);if(!schema?.properties)return[];let requiredFields=new Set(schema.required||[]),fields=[];for(let[name,propSchema]of Object.entries(schema.properties)){let resolvedProp=this.resolveSchemaRef(propSchema),enumValues=resolvedProp?.enum||propSchema.enum;if(!enumValues&&(resolvedProp?.type==="array"||propSchema.type==="array")){let items=resolvedProp?.items||propSchema.items;items&&(enumValues=this.resolveSchemaRef(items)?.enum||items.enum)}fields.push({name,required:requiredFields.has(name),description:resolvedProp?.description||propSchema.description,type:resolvedProp?.type||propSchema.type,enumValues})}return fields.sort((a,b)=>a.required!==b.required?a.required?-1:1:a.name.localeCompare(b.name)),fields}getDisplayColumns(endpoint){this.ensureLoaded();let pathItem=this.spec.paths[endpoint.path];if(!pathItem)return null;let operation=pathItem[endpoint.method.toLowerCase()];if(!operation?.responses)return null;let ok=operation.responses[200]||operation.responses[201];if(!ok)return null;let jsonContent=ok.content?.["application/json"];return jsonContent?.schema?this.findDisplayColumns(jsonContent.schema):null}findDisplayColumns(schema){let xCli=schema["x-vercel-cli"];if(xCli?.displayColumns)return xCli.displayColumns;for(let key of["oneOf","allOf","anyOf"]){let variants=schema[key];if(variants)for(let sub of variants){let found=this.findDisplayColumns(sub);if(found)return found}}return null}ensureLoaded(){if(!this.spec)throw new Error("OpenAPI spec not loaded. Call load() or loadWithSpinner() first.")}async readCache(cachePath){try{let content=await readFile(cachePath,"utf-8");return JSON.parse(content)}catch{return null}}async saveCache(cachePath,spec){let cached={fetchedAt:Date.now(),spec},dir=join(cachePath,"..");await mkdir(dir,{recursive:!0}),await writeFile(cachePath,JSON.stringify(cached)),output_manager_default.debug("Saved OpenAPI spec to cache")}async fetchSpec(url){let controller=new AbortController,timeoutId=setTimeout(()=>controller.abort(),1e4);try{let response=await fetch(url,{signal:controller.signal});if(!response.ok)throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);let spec=await readSpecResponse(response,url);return this.validateSpec(spec,url),spec}finally{clearTimeout(timeoutId)}}validateSpec(spec,url){if(!spec||typeof spec!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a JSON object.`);if(typeof spec.openapi!="string"||!spec.openapi.startsWith("3."))throw new Error(`Invalid OpenAPI spec from ${url}: expected an OpenAPI 3.x document with an "openapi" field.`);if(!spec.paths||typeof spec.paths!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a "paths" object.`);for(let path of Object.keys(spec.paths))if(!path.startsWith("/")||path.startsWith("//"))throw new Error(`Invalid OpenAPI spec from ${url}: path "${path}" must be a relative API path.`)}isExpired(fetchedAt){return Date.now()-fetchedAt>864e5}sortEndpoints(endpoints){return endpoints.sort((a,b)=>{let pathCompare=a.path.localeCompare(b.path);return pathCompare!==0?pathCompare:a.method.localeCompare(b.method)})}extractEndpoints(){let endpoints=[];for(let[path,pathItem]of Object.entries(this.spec.paths)){let methods=["get","post","put","patch","delete"];for(let method of methods){let operation=pathItem[method];if(operation){let pathParams=pathItem.parameters||[],opParams=operation.parameters||[],allParams=[...pathParams,...opParams];endpoints.push({path,method:method.toUpperCase(),summary:operation.summary||pathItem.summary||"",description:operation.description||pathItem.description||"",operationId:operation.operationId||"",tags:operation.tags||[],parameters:allParams,requestBody:operation.requestBody})}}}return endpoints}resolveSchemaRef(schema,spec=this.spec){if(schema){if(schema.$ref){let match=schema.$ref.match(/^#\/components\/schemas\/(.+)$/);if(match&&spec.components?.schemas){let resolved=spec.components.schemas[match[1]];return this.resolveSchemaRef(resolved,spec)}return}if(schema.allOf&&schema.allOf.length>0){let merged={type:"object",properties:{},required:[]};for(let subSchema of schema.allOf){let resolved=this.resolveSchemaRef(subSchema,spec);resolved&&(resolved.properties&&(merged.properties={...merged.properties,...resolved.properties}),resolved.required&&(merged.required=[...merged.required||[],...resolved.required]))}return merged}return schema}}};async function matchesCliApiTag(tagHint){if(!tagHint||tagHint.startsWith("-")||tagHint.includes("/"))return!1;let cache=new OpenApiCache;if(!await cache.load())return!1;let endpoints=cache.getEndpoints(),lower=tagHint.toLowerCase();return endpoints.some(ep=>ep.tags.some(t=>t.toLowerCase()===lower))}async function resolveOpenApiTagForProjectsCli(){return await matchesCliApiTag("projects")?"projects":await matchesCliApiTag("project")?"project":null}async function resolveOpenApiTagForTeamsCli(){return await matchesCliApiTag("teams")?"teams":await matchesCliApiTag("team")?"team":null}export{OPENAPI_URL,SSO_API_URL,CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,VERCEL_CLI_ROOT_DISPLAY_KEY,readSpecResponse,assertAllowedSpecUrl,OpenApiCache,matchesCliApiTag,resolveOpenApiTagForProjectsCli,resolveOpenApiTagForTeamsCli};
|
|
@@ -1,12 +0,0 @@
|
|
|
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{withWarnings}from"./chunk-6MFLATDD.js";import{remoteText}from"./chunk-GLIQ4KNY.js";import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-HOGVBY6Q.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getApiIssues(error){if(typeof error!="object"||error===null)return[];let issues=error.issues;if(!Array.isArray(issues))return[];let result=[];for(let issue of issues){if(typeof issue!="object"||issue===null)continue;let{message,path}=issue;typeof message!="string"||message.length===0||result.push(typeof path=="string"?{path,message}:{message})}return result}function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response,warnings=[]){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify(withWarnings({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata},warnings),null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}var MAX_HUMAN_ISSUES=5;function projectSelectorFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg.startsWith("--project="))return arg.slice(10);if(arg==="--project"&&i+1<args.length)return args[i+1]}}function hintRestatesCommand(hint,steps){if(!steps?.length)return!1;let plain=(0,import_strip_ansi.default)(hint).replace(/`/g,"").trim();return steps.some(step=>{let command=step.command.trim();return command===plain||command.startsWith(`${plain} `)})}function handleApiError(err,jsonOutput,client,overrides={},target={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let billing=err.status===402?clientObservabilityPlanRecovery(client,err,message,target.projectName??projectSelectorFromArgv(client.argv),target.scope):void 0,recovery={...getErrorRecovery({...err,serverMessage:message},client),...billing&&{hint:billing.hint}},next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command,void 0,{excludeFlags:billing.excludeFlags,preserveProject:billing.preserveProject}),when:billing.when}]:void 0;recovery.hint&&hintRestatesCommand(recovery.hint,next)&&delete recovery.hint;let issues=getApiIssues(err),details={...recovery,...next&&{next},...issues.length>0&&{issues},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{let issueRows=issues.slice(0,MAX_HUMAN_ISSUES).map(issue=>remoteText(issue.message));issues.length>MAX_HUMAN_ISSUES&&issueRows.push(`and ${issues.length-MAX_HUMAN_ISSUES} more`),output_manager_default.fatal([message,...issueRows].join(`
|
|
8
|
-
`)),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
9
|
-
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
10
|
-
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
11
|
-
Available values: ${err.allowedValues.join(", ")}
|
|
12
|
-
`)}return 1}var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchSchemaOrExit(client,jsonOutput,operation,accountId){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}},accountId?.startsWith("team_")?{scope:accountId}:{});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince),accountId)}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))),accountId)}export{getApiIssues,getRollupColumnName,getResolvedOrderMetadata,formatQueryJson,formatErrorJson,handleApiError,OBSERVABILITY_METRICS_PATH,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit};
|
|
@@ -1,10 +0,0 @@
|
|
|
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{readJSONFile}from"./chunk-HVBSYQDN.js";import{getScope}from"./chunk-HVZ5OOOP.js";import{humanizePath,readConfigFile}from"./chunk-2OQD274E.js";import{getArgs}from"./chunk-NHB43235.js";import{fetch}from"./chunk-MY4MONOH.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunk-GOI2VVI7.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-AP6DZGTK.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});function isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var CAUSES={ENOTFOUND:"The hostname could not be resolved.",EAI_AGAIN:"The hostname could not be resolved.",ECONNREFUSED:"The connection was refused.",ECONNRESET:"The connection was reset.",EPIPE:"The connection was reset.",UND_ERR_SOCKET:"The connection was reset.",ETIMEDOUT:"The connection timed out.",UND_ERR_CONNECT_TIMEOUT:"The connection timed out.",EHOSTUNREACH:"The network is unreachable.",ENETUNREACH:"The network is unreachable.",ENETDOWN:"The network is unreachable."};function getNetworkFailureCause(err){if(!(err instanceof TypeError))return;let current=err.cause;for(let depth=0;current&&typeof current=="object"&&depth<5;depth++){let code=current.code;if(typeof code=="string"&&Object.hasOwn(CAUSES,code))return CAUSES[code];current=current.cause}}var import_error_utils=__toESM(require_dist(),1),CRASH_REPORT_TIMEOUT_MS=2e3;async function reportError(client,error){if(ignoreError(error)||!telemetryEnabled(client))return;let user,team,scopeError;if(client&&!getNetworkFailureCause(error))try{({user,team}=await getScope(client))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}let crashReport={cli_version:pkg_default.version,invocation_id:client?.telemetryEventStore?.currentInvocationId,error:(0,import_error_utils.isError)(error)?{kind:error.name,message:error.message,stack:stackOf(error)}:{kind:"NonError",message:String(error)},user:user?{id:user.id,email:user.email,username:user.username,name:user.name}:void 0,team_id:team?.id,scope_error:scopeError?{name:scopeError.name,message:scopeError.message,stack:scopeError.stack}:void 0,args:redactedArgs(),node:{execPath:process.execPath,version:process.version,platform:process.platform}};try{(await fetch(process.env.VERCEL_TELEMETRY_BRIDGE_URL||"https://telemetry.vercel.com/api/vercel-cli/v1/events",{method:"POST",headers:{"Content-Type":"application/json","x-vercel-cli-crash-report":"1"},body:JSON.stringify({version:1,crashReport}),signal:AbortSignal.timeout(CRASH_REPORT_TIMEOUT_MS)})).body?.cancel().catch(()=>{})}catch{}}function telemetryEnabled(client){if(process.env.VERCEL_TELEMETRY_DISABLED)return!1;if(client?.telemetryEventStore)return client.telemetryEventStore.enabled;try{return readConfigFile().telemetry?.enabled!==!1}catch(err){return(0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"}}function stackOf(error){let stacks=[],current=error;for(;(0,import_error_utils.isError)(current)&&stacks.length<5;)stacks.push(current.stack??`${current.name}: ${current.message}`),current=current.cause;return stacks.join(`
|
|
8
|
-
Caused by: `)}function redactedArgs(){try{let args=getArgs(process.argv.slice(2),{});for(let flag of["--env","--build-env","--token"])args[flag]&&(args[flag]="REDACTED");return args._.length>=4&&args._[0].startsWith("secret")&&args._[1]==="add"&&(args._[3]="REDACTED"),args}catch(err){return`Unable to parse args${(0,import_error_utils.isError)(err)?`: ${err}`:""}`}}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){output_manager_default.error(`An unexpected error occurred!
|
|
9
|
-
${err.stack}`),await reportError(client,err)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
|
|
10
|
-
${err}`),await reportError(getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error),await exitWithUnexpectedError(error)})}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}export{isOutputDebugEnabled,installProcessGuards,getNetworkFailureCause,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes};
|