@vercel/cli-support 65.9.0 → 65.10.0-snapshot-b8e5bb846796
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-4VXTYDC7.js +8 -0
- package/dist/chunks/add-K3ZHVAYL.js +8 -0
- package/dist/chunks/add-M26FXXGH.js +8 -0
- package/dist/chunks/build-ESY72OCS.js +7 -0
- package/dist/chunks/chunk-2AMO2VMV.js +68 -0
- package/dist/chunks/{chunk-U6KJOCXX.js → chunk-2DHDKWYN.js} +1 -1
- package/dist/chunks/chunk-2VBFQZ72.js +7 -0
- package/dist/chunks/{chunk-BZNRYQ6U.js → chunk-37LESFVW.js} +1 -1
- package/dist/chunks/{chunk-CMHL66LK.js → chunk-3F5BOG4A.js} +1 -1
- package/dist/chunks/{chunk-ZCXKEZS4.js → chunk-3HC4F32I.js} +1 -1
- package/dist/chunks/{chunk-VZKQP67Q.js → chunk-4FV4I3KH.js} +1 -1
- package/dist/chunks/{chunk-R5ZLTWKB.js → chunk-4LGAV2WN.js} +1 -1
- package/dist/chunks/{chunk-DUJAQS7I.js → chunk-4MPQZWQV.js} +1 -1
- package/dist/chunks/{chunk-7WY7ASKE.js → chunk-56UH6NQ3.js} +1 -1
- package/dist/chunks/{chunk-QQA2OMXJ.js → chunk-5KE67O45.js} +1 -1
- package/dist/chunks/chunk-6EQWP4LZ.js +10 -0
- package/dist/chunks/{chunk-USYEDO7R.js → chunk-6SJHJBJH.js} +1 -1
- package/dist/chunks/{chunk-TRZDIAX3.js → chunk-77LSSWXL.js} +1 -1
- package/dist/chunks/{chunk-DASHFOKO.js → chunk-7DA25VTX.js} +1 -1
- package/dist/chunks/chunk-7DP4DHQW.js +7 -0
- package/dist/chunks/{chunk-ZERZX6BZ.js → chunk-7JY4LSW4.js} +2 -2
- package/dist/chunks/{chunk-EW62WSXG.js → chunk-7NNA4VRN.js} +1 -1
- package/dist/chunks/{chunk-EXLKCL5I.js → chunk-7VICILSF.js} +1 -1
- package/dist/chunks/{chunk-4XJVEKTD.js → chunk-7XRM7NEF.js} +1 -1
- package/dist/chunks/chunk-A5D7MVRH.js +7 -0
- package/dist/chunks/{chunk-EVH5524J.js → chunk-A5NC6IDR.js} +1 -1
- package/dist/chunks/{chunk-EDOTKQ7L.js → chunk-ADQRYOJK.js} +1 -1
- package/dist/chunks/{chunk-D2JHIOVH.js → chunk-AEYIIPUZ.js} +1 -1
- package/dist/chunks/{chunk-GHEGWXH2.js → chunk-ANCWFEOM.js} +1 -1
- package/dist/chunks/{chunk-IFCMWIRB.js → chunk-APM4DYNZ.js} +1 -1
- package/dist/chunks/chunk-BB3N7F4F.js +7 -0
- package/dist/chunks/{chunk-7ULVGK67.js → chunk-BB5UMZMF.js} +1 -1
- package/dist/chunks/{chunk-4Z3APEBF.js → chunk-BJXLR2RE.js} +1 -1
- package/dist/chunks/{chunk-Y6WXTTZS.js → chunk-BPRGAX62.js} +1 -1
- package/dist/chunks/{chunk-43P35KUA.js → chunk-BQVKEPOO.js} +1 -1
- package/dist/chunks/{chunk-MXURT5TX.js → chunk-BRKI6NTF.js} +1 -1
- package/dist/chunks/{chunk-G6HUSV7F.js → chunk-BZV2S4H6.js} +1 -1
- package/dist/chunks/chunk-C4N4LKPM.js +7 -0
- package/dist/chunks/{chunk-WFOJ2LEA.js → chunk-CCMABJKN.js} +1 -1
- package/dist/chunks/chunk-CFYTFXX6.js +7 -0
- package/dist/chunks/chunk-CKTLP5GX.js +7 -0
- package/dist/chunks/{chunk-OZPBJWYU.js → chunk-CSOIXUCL.js} +7 -7
- package/dist/chunks/{chunk-GCPPL24C.js → chunk-CUBRYWA2.js} +1 -1
- package/dist/chunks/{chunk-M73W4XNR.js → chunk-CZOD25BC.js} +1 -1
- package/dist/chunks/{chunk-UIJYRI3G.js → chunk-DBPN2VGJ.js} +1 -1
- package/dist/chunks/{chunk-XBWISZCG.js → chunk-EJ34DLV4.js} +1 -1
- package/dist/chunks/{chunk-T5TOBY4D.js → chunk-EJZNJN4N.js} +1 -1
- package/dist/chunks/{chunk-TMXIVQ45.js → chunk-F2LNGJOZ.js} +1 -1
- package/dist/chunks/{chunk-G3LWP5CH.js → chunk-FAVZ6WVS.js} +1 -1
- package/dist/chunks/{chunk-5K4UTJSY.js → chunk-FHGWXXAS.js} +1 -1
- package/dist/chunks/{chunk-2DODPQ5J.js → chunk-FI2N3SE5.js} +1 -1
- package/dist/chunks/{chunk-D4ZEJM3T.js → chunk-FI5O4WHD.js} +1 -1
- package/dist/chunks/chunk-FTACGWII.js +14 -0
- package/dist/chunks/chunk-FUYVYZWT.js +7 -0
- package/dist/chunks/{chunk-FWTBSC7Z.js → chunk-FY4ORPZH.js} +1 -1
- package/dist/chunks/{chunk-VBKFCR5W.js → chunk-G5T6UQAL.js} +1 -1
- package/dist/chunks/chunk-G7H33IKQ.js +10 -0
- package/dist/chunks/{chunk-33U57CNE.js → chunk-GKALP6QD.js} +1 -1
- package/dist/chunks/{chunk-DUPAU76G.js → chunk-HJ45TAM4.js} +1 -1
- package/dist/chunks/{chunk-E5CN62HO.js → chunk-I6TWYNZF.js} +1 -1
- package/dist/chunks/{chunk-JOXGYP5S.js → chunk-JVNIDSP5.js} +1 -1
- package/dist/chunks/chunk-K6T65WB2.js +7 -0
- package/dist/chunks/chunk-KCJ7RU5I.js +10 -0
- package/dist/chunks/{chunk-TCB4XM23.js → chunk-L3YSOZTP.js} +1 -1
- package/dist/chunks/chunk-LNVODBR2.js +8 -0
- package/dist/chunks/{chunk-32AS5X7G.js → chunk-MUNGQJGO.js} +1 -1
- package/dist/chunks/{chunk-SNCQOAFU.js → chunk-MWEC2PBL.js} +1 -1
- package/dist/chunks/{chunk-UZTDRGCW.js → chunk-NAEY6HG5.js} +1 -1
- package/dist/chunks/{chunk-GN5IAG3M.js → chunk-NGHFFOD2.js} +1 -1
- package/dist/chunks/{chunk-4BZ3DNGM.js → chunk-NLKM5LR5.js} +1 -1
- package/dist/chunks/{chunk-UOQGI6CL.js → chunk-NNGNQNGM.js} +1 -1
- package/dist/chunks/{chunk-7PGGP2QT.js → chunk-NT5ITDTD.js} +1 -1
- package/dist/chunks/{chunk-NEUQZYBL.js → chunk-PMEYNJU2.js} +1 -1
- package/dist/chunks/{chunk-BWS3ZOHJ.js → chunk-Q4GX2UTG.js} +1 -1
- package/dist/chunks/{chunk-4SJU5QSD.js → chunk-QBEIKXKY.js} +1 -1
- package/dist/chunks/{chunk-CBVVVYUP.js → chunk-QCIIUQV3.js} +1 -1
- package/dist/chunks/{chunk-UVE5COCG.js → chunk-QR2Y6RI6.js} +1 -1
- package/dist/chunks/chunk-QSMWJAN7.js +7 -0
- package/dist/chunks/{chunk-GCXUSXB4.js → chunk-QVMU7ZKQ.js} +1 -1
- package/dist/chunks/{chunk-ZGKJLJ47.js → chunk-R2P4PNRQ.js} +1 -1
- package/dist/chunks/{chunk-Y5YXAXK3.js → chunk-R3D4M5RE.js} +1 -1
- package/dist/chunks/{chunk-QJAIUZVZ.js → chunk-ROOOBR3O.js} +5 -5
- package/dist/chunks/{chunk-H34SGIVS.js → chunk-S5JBQCBA.js} +1 -1
- package/dist/chunks/{chunk-PBX7RJ2K.js → chunk-SAIROH4Y.js} +1 -1
- package/dist/chunks/{chunk-2JNDJISE.js → chunk-SIN64EHW.js} +1 -1
- package/dist/chunks/{chunk-QBOY2CXL.js → chunk-SODZSOOL.js} +1 -1
- package/dist/chunks/{chunk-KV2DYFUG.js → chunk-T7HE23VK.js} +1 -1
- package/dist/chunks/{chunk-2JXQWOK5.js → chunk-TKJUKKR6.js} +1 -1
- package/dist/chunks/{chunk-2H4DUZJZ.js → chunk-TL4ZLZ2Q.js} +1 -1
- package/dist/chunks/{chunk-WGWGDC3N.js → chunk-TRYRN6OD.js} +1 -1
- package/dist/chunks/chunk-UWJ3UPS5.js +11 -0
- package/dist/chunks/{chunk-6RCFEJZK.js → chunk-UXRXHNSX.js} +1 -1
- package/dist/chunks/chunk-V32V4SXB.js +7 -0
- package/dist/chunks/{chunk-ECQKK4JU.js → chunk-VD2FK6OF.js} +1 -1
- package/dist/chunks/{chunk-QKWJN6OE.js → chunk-VDKY5KRE.js} +1 -1
- package/dist/chunks/chunk-VPUYTI5E.js +25 -0
- package/dist/chunks/{chunk-EBBDSEEU.js → chunk-VS3S5CU4.js} +1 -1
- package/dist/chunks/{chunk-JMAXX2I6.js → chunk-VU4PHRVP.js} +1 -1
- package/dist/chunks/{chunk-ZBZPCKTW.js → chunk-W5GHMAHP.js} +1 -1
- package/dist/chunks/{chunk-QY5RG6BB.js → chunk-WYFRVK6K.js} +1 -1
- package/dist/chunks/{chunk-BRETAWE7.js → chunk-XEXOSJIU.js} +1 -1
- package/dist/chunks/{chunk-5M3WBT3N.js → chunk-XXEGRTU6.js} +1 -1
- package/dist/chunks/{chunk-4OTI552J.js → chunk-Y45SSWNH.js} +1 -1
- package/dist/chunks/{chunk-WKYFWE37.js → chunk-YO6SJCZP.js} +1 -1
- package/dist/chunks/{chunk-TGPYWWX3.js → chunk-Z57NF2SA.js} +1 -1
- package/dist/chunks/chunk-ZUI5EMXD.js +11 -0
- package/dist/chunks/clear-56POXUP7.js +8 -0
- package/dist/chunks/{compile-vercel-config-DRTOWZK6.js → compile-vercel-config-ZO4Q4DSX.js} +1 -1
- package/dist/chunks/{config-MNRKCDQA.js → config-3BJHSDR3.js} +1 -1
- package/dist/chunks/config-BQPB2VFM.js +8 -0
- package/dist/chunks/delete-2IZGMSOT.js +9 -0
- package/dist/chunks/delete-32N2EHLH.js +10 -0
- package/dist/chunks/{detect-services-GXKWIX52.js → detect-services-JFILAIAL.js} +1 -1
- package/dist/chunks/disable-U2L3EAT3.js +7 -0
- package/dist/chunks/discard-LCQCHKT3.js +14 -0
- package/dist/chunks/edit-7UYV2SKA.js +8 -0
- package/dist/chunks/edit-IE6MRAGU.js +9 -0
- package/dist/chunks/enable-TRHJ4KBM.js +7 -0
- package/dist/chunks/{export-N5F7EY7B.js → export-FCEURR7W.js} +1 -1
- package/dist/chunks/future-MJBIKCOK.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-CFEVTFEH.js +7 -0
- package/dist/chunks/image-47MBJMHO.js +7 -0
- package/dist/chunks/{import-builders-OAGJKQNW.js → import-builders-2DIXZXHK.js} +1 -1
- package/dist/chunks/inspect-BEBHGVAE.js +13 -0
- package/dist/chunks/{inspect-UDUI3ETL.js → inspect-C6XCE3L6.js} +1 -1
- package/dist/chunks/{inspect-35WHAXL2.js → inspect-FZJIVQKV.js} +1 -1
- package/dist/chunks/{inspect-GX34WQGR.js → inspect-KHEUFRVD.js} +1 -1
- package/dist/chunks/inspect-VHDOPOMX.js +9 -0
- package/dist/chunks/{list-BINT67HQ.js → list-IU7VXCG3.js} +1 -1
- package/dist/chunks/{list-VVND632B.js → list-ULHYVEMI.js} +1 -1
- package/dist/chunks/list-VRPHMTAV.js +12 -0
- package/dist/chunks/login-333JR3X5.js +7 -0
- package/dist/chunks/login-N3AJJ2TI.js +9 -0
- package/dist/chunks/logs-QCK5IEZ6.js +7 -0
- package/dist/chunks/{ls-6HYUGM62.js → ls-324AYCJH.js} +1 -1
- package/dist/chunks/{ls-YT3MWU4U.js → ls-7PMEAWRR.js} +1 -1
- package/dist/chunks/{ls-2MJY6EKD.js → ls-EKSX4DUZ.js} +1 -1
- package/dist/chunks/ls-K27L6SBM.js +11 -0
- package/dist/chunks/ls-Q6XVCKO3.js +8 -0
- package/dist/chunks/{ls-7OZ5TSNW.js → ls-S6RG3GU3.js} +1 -1
- package/dist/chunks/{ls-HTNWWU45.js → ls-WSX4L6GY.js} +1 -1
- package/dist/chunks/mutate-VQBALKRN.js +9 -0
- package/dist/chunks/{native-self-update-75UJCHGZ.js → native-self-update-7OAY4AVR.js} +1 -1
- package/dist/chunks/notifications-OQQ3ELSK.js +7 -0
- package/dist/chunks/open-ULGKVY4O.js +7 -0
- package/dist/chunks/{openapi-KYC6JIXI.js → openapi-YAZA3237.js} +1 -1
- package/dist/chunks/permissions-FCZAXNBP.js +7 -0
- package/dist/chunks/{plugin-offer-URT5JNEU.js → plugin-offer-REA2ZSBW.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-AENJOWAN.js +7 -0
- package/dist/chunks/{publish-LH5CIXCP.js → publish-LUVUXRPN.js} +1 -1
- package/dist/chunks/pull-734D2SIQ.js +7 -0
- package/dist/chunks/purchase-domain-if-available-J32OZAAB.js +7 -0
- package/dist/chunks/push-7N63IRGS.js +7 -0
- package/dist/chunks/{query-POTX2HYL.js → query-ZRFRACJR.js} +1 -1
- package/dist/chunks/reauthenticate-A5TEIS2T.js +7 -0
- package/dist/chunks/reorder-A2GYXTE5.js +10 -0
- package/dist/chunks/reply-VRPDRYSF.js +9 -0
- package/dist/chunks/resolve-5IVOTHCA.js +12 -0
- package/dist/chunks/resolve-agent-team-U7H6YKBF.js +7 -0
- package/dist/chunks/{restore-L3T5KOG7.js → restore-2UIAA4WJ.js} +1 -1
- package/dist/chunks/rm-2VW3MMXV.js +8 -0
- package/dist/chunks/rm-KVDVCRHH.js +8 -0
- package/dist/chunks/rm-QLWZ7DR3.js +8 -0
- package/dist/chunks/rm-QTZDIV5M.js +8 -0
- package/dist/chunks/rm-RNC3IRNA.js +8 -0
- package/dist/chunks/{routes-S75L7Z7A.js → routes-4WGST7VN.js} +1 -1
- package/dist/chunks/rule-inspect-B6R3WIIR.js +8 -0
- package/dist/chunks/{schema-P4T4GQBF.js → schema-HIEZSFBL.js} +1 -1
- package/dist/chunks/{schema-TOVLKRPJ.js → schema-RP3BSWFK.js} +1 -1
- package/dist/chunks/select-org-A2QMWNDE.js +7 -0
- package/dist/chunks/set-VV3OH6P6.js +7 -0
- package/dist/chunks/setup-and-link-F5DSGQMW.js +7 -0
- package/dist/chunks/{skills-DZYJV7BE.js → skills-X5TPVYXW.js} +1 -1
- package/dist/chunks/{statuspage-45LJ2XYT.js → statuspage-KHTMA4WL.js} +1 -1
- package/dist/chunks/tags-KDAQZ5W2.js +7 -0
- package/dist/chunks/{types-YA6BOCRV.js → types-SENK43U4.js} +1 -1
- package/dist/chunks/{update-YSAO36V7.js → update-VT4MVVJF.js} +1 -1
- package/dist/chunks/zod-Y3ZBY67C.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +30 -23
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +7 -7
- package/dist/commands-account.js +18 -3
- package/dist/commands-ai.js +2 -2
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +6 -6
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +7 -9
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +5 -5
- package/dist/commands-routing.js +2 -2
- package/dist/help.js +1 -1
- package/dist/index.js +4 -4
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/launcher-errors.js +11 -0
- package/dist/native-download.js +1 -1
- package/dist/package.json +26 -26
- package/dist/vc.js +355 -86
- package/dist/version.mjs +1 -1
- package/package.json +19 -19
- package/dist/chunks/add-6YFDZCAK.js +0 -8
- package/dist/chunks/add-QDZPCCUD.js +0 -8
- package/dist/chunks/add-Z24IIQDY.js +0 -8
- package/dist/chunks/build-HLU4YO37.js +0 -7
- package/dist/chunks/chunk-2CSCY66I.js +0 -11
- package/dist/chunks/chunk-2NABMKFV.js +0 -29
- package/dist/chunks/chunk-2TRNHR72.js +0 -7
- package/dist/chunks/chunk-32NXYHYC.js +0 -10
- package/dist/chunks/chunk-4CQKN5TW.js +0 -10
- package/dist/chunks/chunk-7DM3IJ7L.js +0 -10
- package/dist/chunks/chunk-AUCTNGW2.js +0 -7
- package/dist/chunks/chunk-C6525MLX.js +0 -10
- package/dist/chunks/chunk-CGTD4QFC.js +0 -7
- package/dist/chunks/chunk-DSNIVABS.js +0 -7
- package/dist/chunks/chunk-F53OKXYI.js +0 -7
- package/dist/chunks/chunk-K5YO4UD7.js +0 -7
- package/dist/chunks/chunk-NAU6URTI.js +0 -25
- package/dist/chunks/chunk-NNIQPNGP.js +0 -7
- package/dist/chunks/chunk-NTUDWWSL.js +0 -14
- package/dist/chunks/chunk-RZY54T7B.js +0 -7
- package/dist/chunks/chunk-SR2SHYJA.js +0 -7
- package/dist/chunks/chunk-WGVIQTOI.js +0 -8
- package/dist/chunks/chunk-YPPDRKVC.js +0 -7
- package/dist/chunks/clear-RU72IUXU.js +0 -8
- package/dist/chunks/config-PIFTR3UF.js +0 -8
- package/dist/chunks/delete-47BF6SIO.js +0 -9
- package/dist/chunks/delete-QNSKEIGO.js +0 -10
- package/dist/chunks/disable-SBFW3F7B.js +0 -7
- package/dist/chunks/discard-DUZR3OWZ.js +0 -14
- package/dist/chunks/edit-6BQ7FZC4.js +0 -8
- package/dist/chunks/edit-WO7FLNW2.js +0 -9
- package/dist/chunks/enable-OK4MR3Z6.js +0 -7
- package/dist/chunks/future-5AQIYILU.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-7ERAHVOV.js +0 -7
- package/dist/chunks/image-IRC2NJVA.js +0 -7
- package/dist/chunks/inspect-5FKOSDTK.js +0 -13
- package/dist/chunks/inspect-ACNGICEF.js +0 -9
- package/dist/chunks/list-TRFGY6WP.js +0 -12
- package/dist/chunks/login-MYVTOBRG.js +0 -9
- package/dist/chunks/login-SOZ5ME3D.js +0 -7
- package/dist/chunks/logs-EMAGPMIZ.js +0 -7
- package/dist/chunks/ls-KU35N6DP.js +0 -8
- package/dist/chunks/ls-WFC636QK.js +0 -11
- package/dist/chunks/mutate-JVDDZLVE.js +0 -9
- package/dist/chunks/notifications-CXDBNBHU.js +0 -7
- package/dist/chunks/open-3CD5ZNKU.js +0 -7
- package/dist/chunks/permissions-PNBST4WN.js +0 -7
- package/dist/chunks/prompt-missing-credentials-Q5JCRP3R.js +0 -7
- package/dist/chunks/pull-XLZXPTLS.js +0 -7
- package/dist/chunks/purchase-domain-if-available-PDJGZ6MY.js +0 -7
- package/dist/chunks/push-XB57XK6H.js +0 -7
- package/dist/chunks/reauthenticate-CRI4D2BQ.js +0 -7
- package/dist/chunks/reorder-KUQ5EQBV.js +0 -10
- package/dist/chunks/reply-LO76EKEE.js +0 -9
- package/dist/chunks/resolve-KZJYJJLA.js +0 -12
- package/dist/chunks/resolve-agent-team-N7QMB7UO.js +0 -7
- package/dist/chunks/rm-7UKXTIZW.js +0 -8
- package/dist/chunks/rm-AKKEQN32.js +0 -8
- package/dist/chunks/rm-ELC57ULY.js +0 -8
- package/dist/chunks/rm-K7XEZ7TY.js +0 -8
- package/dist/chunks/rm-MOYCAXNO.js +0 -8
- package/dist/chunks/rule-inspect-ZCS4EBKR.js +0 -8
- package/dist/chunks/select-org-6NEM7F25.js +0 -7
- package/dist/chunks/set-NXFB6JXG.js +0 -7
- package/dist/chunks/setup-and-link-L67MMSUD.js +0 -7
- package/dist/chunks/tags-5AV6WAOF.js +0 -7
- package/dist/chunks/zod-2C2SXNIK.js +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-VRH7LWOC.js";import{jsonOption,limitOption,projectOption,yesOption}from"./chunk-YPPDRKVC.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"query",description:"Search by name, description, source, or destination",shorthand:"q",type:String,argument:"TEXT",deprecated:!1},{name:"search",description:"Deprecated alias for `--query`",shorthand:"s",type:String,argument:"QUERY",deprecated:!0},{name:"type",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"filter",description:"Deprecated alias for `--type`",shorthand:"f",type:String,argument:"TYPE",deprecated:!0},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"routes-version",description:"List routes from a specific version",shorthand:null,type:String,argument:"VERSION",deprecated:!1},{name:"version-id",description:"Deprecated alias for `--routes-version`",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!0},{name:"diff",description:"Compare staged changes against production. Use with --routes-version to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:null,deprecatedShorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --query "api"`},{name:"Filter by type",value:`${packageName} routes list --type rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{...limitOption,description:"Number of versions to fetch (default: 20, max: 100)"},{name:"count",description:"Deprecated alias for `--limit`",shorthand:null,type:Number,argument:"NUMBER",deprecated:!0}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --limit 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex, path-to-regexp, equals (default: regex)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"no-enable",description:"Add the route turned off (default: on)",shorthand:null,type:Boolean,deprecated:!1},{name:"disabled",description:"Deprecated alias for `--no-enable`",shorthand:null,type:Boolean,deprecated:!0},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when removing"}],examples:[{name:"Remove a route by name",value:`${packageName} routes remove "Old Redirect"`},{name:"Remove a route by ID",value:`${packageName} routes remove abc123`},{name:"Remove multiple routes",value:`${packageName} routes remove "Route A" "Route B"`},{name:"Remove without confirmation",value:`${packageName} routes remove "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"move",aliases:["reorder"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when moving"}],examples:[{name:"Move to first position",value:`${packageName} routes move "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes move "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes move "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes move "API Proxy" --position after:route-id-123`},{name:"Interactive move (prompts for position)",value:`${packageName} routes move "API Proxy"`}]},editSubcommand={name:"update",aliases:["edit"],description:"Update an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes update "API Proxy"`},{name:"Update with AI",value:`${packageName} routes update "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes update "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes update "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes update "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes update "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json or .ts (default: .json)",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
7
|
+
import{packageName}from"./chunk-VRH7LWOC.js";import{jsonOption,limitOption,projectOption,yesOption}from"./chunk-CKTLP5GX.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"query",description:"Search by name, description, source, or destination",shorthand:"q",type:String,argument:"TEXT",deprecated:!1},{name:"search",description:"Deprecated alias for `--query`",shorthand:"s",type:String,argument:"QUERY",deprecated:!0},{name:"type",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"filter",description:"Deprecated alias for `--type`",shorthand:"f",type:String,argument:"TYPE",deprecated:!0},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"routes-version",description:"List routes from a specific version",shorthand:null,type:String,argument:"VERSION",deprecated:!1},{name:"version-id",description:"Deprecated alias for `--routes-version`",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!0},{name:"diff",description:"Compare staged changes against production. Use with --routes-version to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:null,deprecatedShorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --query "api"`},{name:"Filter by type",value:`${packageName} routes list --type rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{...limitOption,description:"Number of versions to fetch (default: 20, max: 100)"},{name:"count",description:"Deprecated alias for `--limit`",shorthand:null,type:Number,argument:"NUMBER",deprecated:!0}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --limit 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex, path-to-regexp, equals (default: regex)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"no-enable",description:"Add the route turned off (default: on)",shorthand:null,type:Boolean,deprecated:!1},{name:"disabled",description:"Deprecated alias for `--no-enable`",shorthand:null,type:Boolean,deprecated:!0},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when removing"}],examples:[{name:"Remove a route by name",value:`${packageName} routes remove "Old Redirect"`},{name:"Remove a route by ID",value:`${packageName} routes remove abc123`},{name:"Remove multiple routes",value:`${packageName} routes remove "Route A" "Route B"`},{name:"Remove without confirmation",value:`${packageName} routes remove "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"move",aliases:["reorder"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when moving"}],examples:[{name:"Move to first position",value:`${packageName} routes move "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes move "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes move "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes move "API Proxy" --position after:route-id-123`},{name:"Interactive move (prompts for position)",value:`${packageName} routes move "API Proxy"`}]},editSubcommand={name:"update",aliases:["edit"],description:"Update an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes update "API Proxy"`},{name:"Update with AI",value:`${packageName} routes update "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes update "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes update "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes update "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes update "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json or .ts (default: .json)",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getResolvedOrderMetadata,getRollupColumnName}from"./chunk-WKYFWE37.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{ellipsizeMiddle}from"./chunk-TOTTVS5P.js";import{table}from"./chunk-375JVQYK.js";import{elapsed}from"./chunk-Q7D7RGXM.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var CANONICAL_AGGREGATIONS=["count","sum","avg","min","max","p50","p75","p90","p95","p99","stddev"];function isCanonicalAggregation(aggregation){return CANONICAL_AGGREGATIONS.includes(aggregation)}var DURATION_UNITS=new Set(["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"]);function normalizeMetricUnit(unit){return unit.trim().toLowerCase().replace(/[_\s]+/g," ")}function getPreferredCustomMetricAggregation(unit){let normalizedUnit=normalizeMetricUnit(unit);return DURATION_UNITS.has(normalizedUnit)?"p75":normalizedUnit==="percent"?"avg":"sum"}function getDefaultCustomMetricAggregation(unit,aggregations){let preferredAggregation=getPreferredCustomMetricAggregation(unit);return aggregations?.includes(preferredAggregation)?preferredAggregation:aggregations?.includes("sum")?"sum":aggregations?.find(isCanonicalAggregation)}var import_ms=__toESM(require_ms(),1),MINUTE_MS=60*1e3,HOUR_MS=60*MINUTE_MS,DAY_MS=24*HOUR_MS;function toGranularityDuration(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}". Use 1m, 5m, 15m, 1h, 4h, 1d.`);return milliseconds>=DAY_MS?{days:milliseconds/DAY_MS}:milliseconds>=HOUR_MS?{hours:milliseconds/HOUR_MS}:{minutes:milliseconds/MINUTE_MS}}function toGranularityMs(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}".`);return milliseconds}var GRANULARITY_THRESHOLDS=[[1*HOUR_MS,"1m","1m"],[2*HOUR_MS,"5m","5m"],[12*HOUR_MS,"15m","5m"],[3*DAY_MS,"1h","1h"],[30*DAY_MS,"4h","4h"]],FALLBACK_GRANULARITY="1d";function getAutoGranularity(rangeMs){for(let[maxRange,defaultG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return defaultG;return FALLBACK_GRANULARITY}function getMinGranularity(rangeMs){for(let[maxRange,,minG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return minG;return FALLBACK_GRANULARITY}function computeGranularity(rangeMs,explicit){if(!explicit){let auto=getAutoGranularity(rangeMs);return{duration:toGranularityDuration(auto),adjusted:!1}}let minG=getMinGranularity(rangeMs),explicitMs=toGranularityMs(explicit),minMs=toGranularityMs(minG);if(explicitMs<minMs){let rangeDays=Math.round(rangeMs/DAY_MS),rangeHours=Math.round(rangeMs/HOUR_MS),rangeLabel=rangeDays>=1?`${rangeDays}-day`:`${rangeHours}-hour`;return{duration:toGranularityDuration(minG),adjusted:!0,notice:`Granularity adjusted from ${explicit} to ${minG} for a ${rangeLabel} time range.`}}return{duration:toGranularityDuration(explicit),adjusted:!1}}function toGranularityMsFromDuration(duration){return"minutes"in duration?duration.minutes*MINUTE_MS:"hours"in duration?duration.hours*HOUR_MS:duration.days*DAY_MS}var import_chalk=__toESM(require_source(),1);var GROUP_KEY_DELIMITER="",MAX_SPARKLINE_LENGTH=120,DURATION_SCALE_MS={seconds:1e3,minutes:6e4,hours:36e5,days:864e5},BYTE_SCALE={bytes:1,kilobytes:1e3,megabytes:1e6,gigabytes:1e9,terabytes:1e12,petabytes:1e15},COMPACT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short"}),TWO_FRACTION_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),TWO_SIGNIFICANT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{minimumSignificantDigits:2,maximumSignificantDigits:2,maximumFractionDigits:2}),PERCENTAGE_FORMATTER=new Intl.NumberFormat("en-US",{style:"unit",unit:"percent",unitDisplay:"narrow",maximumFractionDigits:1}),USD_FORMATTER=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),BLOCKS=["\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],MISSING_CHAR="\xB7";function isAggregationWithDimension(aggregation){let[,dimension]=aggregation.split("/");return!!dimension}function toGroupKey(groupValues){return groupValues.length===0?"":groupValues.join(GROUP_KEY_DELIMITER)}function pad2(n){return String(n).padStart(2,"0")}function pad4(n){return String(n).padStart(4,"0")}function formatHumanMinute(date){return`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function formatPeriodBound(input){let date=new Date(input);return isNaN(date.getTime())?input:formatHumanMinute(date)}function formatPeriodSpan(startInput,endInput){let start=Date.parse(startInput),durationMs=Date.parse(endInput)-start;return!Number.isFinite(durationMs)||durationMs<=0?null:elapsed(durationMs)}function getStatColumns(aggregation){return aggregation==="sum"||aggregation==="count"?["total","avg","min","max"]:["avg","min","max"]}function toNumericValue(value){if(value==null)return null;if(typeof value=="number")return Number.isFinite(value)?value:null;let parsed=Number(value);return Number.isFinite(parsed)?parsed:null}function isNonNullNumber(value){return value!==null}function isPointWithValue(point){return point.value!==null}function getOrCreate(map,key,make){let existing=map.get(key);if(existing!==void 0)return existing;let created=make();return map.set(key,created),created}function getGroupFieldValue(row,field){let value=row[field];return value==null||value===""?"(not set)":String(value)}function normalizeTimestampToIso(timestamp){let parsed=Date.parse(timestamp);return isNaN(parsed)?null:new Date(parsed).toISOString()}function formatStatCell(column,stats,periodStart,periodEnd,formatValue){switch(column){case"total":return formatValue(stats.total);case"avg":return formatValue(stats.avg,{preserveFractionalCount:!0});case"min":{let ts=formatMinMaxTimestamp(new Date(stats.min.timestamp),periodStart,periodEnd);return`${formatValue(stats.min.value)} at ${ts}`}case"max":{let ts=formatMinMaxTimestamp(new Date(stats.max.timestamp),periodStart,periodEnd);return`${formatValue(stats.max.value)} at ${ts}`}}}function buildExpectedTimestamps(periodStart,periodEnd,granularityMs){let start=Date.parse(periodStart),end=Date.parse(periodEnd);if(isNaN(start)||isNaN(end)||granularityMs<=0||end<=start)return[];let timestamps=[];for(let current=start;current<end;current+=granularityMs)timestamps.push(new Date(current).toISOString());return timestamps}function buildObservedTimestamps(observedTimestamps,granularityMs){let timestamps=[...observedTimestamps].map(timestamp=>Date.parse(timestamp)).filter(Number.isFinite).sort((a,b)=>a-b);if(timestamps.length===0||granularityMs<=0)return[];let start=timestamps[0],end=timestamps[timestamps.length-1]+granularityMs;return buildExpectedTimestamps(new Date(start).toISOString(),new Date(end).toISOString(),granularityMs)}function buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps){let expectedTimestamps=buildExpectedTimestamps(periodStart,periodEnd,granularityMs);return observedTimestamps.size===0||expectedTimestamps.some(timestamp=>observedTimestamps.has(timestamp))?expectedTimestamps:buildObservedTimestamps(observedTimestamps,granularityMs)}function formatCount(n){return Math.round(n).toLocaleString("en-US")}function formatDecimal(n){if(!Number.isFinite(n))return String(n);if(n===0||Object.is(n,-0))return"0";let sign=n<0?"-":"",abs=Math.abs(n);if(abs>=1)return`${sign}${abs.toFixed(1)}`;let exponent=Math.floor(Math.log10(abs)),decimals=Math.min(20,Math.max(2,-exponent+1)),trimmed=abs.toFixed(decimals).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,"");return`${sign}${trimmed}`}function formatDuration(durationMs){let durationSeconds=durationMs/1e3;return durationMs<1e3?`${durationMs.toFixed(0)}ms`:durationMs<5e3?`${Math.round(durationSeconds*100)/100}s`:durationSeconds<60?`${durationSeconds.toFixed(0)}s`:durationSeconds<3600?`${(durationSeconds/60).toFixed(0)}m`:`${(durationSeconds/3600).toFixed(0)}h`}function formatBytes(bytes){if(bytes===0)return"0 Bytes";let units=["Bytes","KB","MB","GB","TB","PB"],absoluteBytes=Math.abs(bytes),unitIndex=Math.min(units.length-1,Math.max(0,Math.floor(Math.log(absoluteBytes)/Math.log(1e3)))),value=bytes/1e3**unitIndex;return(unitIndex===1||unitIndex===2)&&(value=Math.round(value),Math.abs(value)===1e3&&unitIndex<units.length-1&&(value/=1e3,unitIndex+=1)),`${TWO_FRACTION_NUMBER_FORMATTER.format(value)} ${units[unitIndex]}`}function formatMetricValue(value,baseUnit,aggregation,opts){let formatCountValue=()=>opts?.preserveFractionalCount&&!Number.isInteger(value)?formatDecimal(value):formatCount(value);if(isAggregationWithDimension(aggregation)||aggregation==="count")return formatCountValue();let unit=normalizeMetricUnit(baseUnit??"units");if(aggregation==="percent"||unit==="percent")return PERCENTAGE_FORMATTER.format(value);if(aggregation==="unique")return COMPACT_NUMBER_FORMATTER.format(value);let withRateSuffix=formatted2=>aggregation==="persecond"?`${formatted2}/s`:formatted2;if(unit==="milliseconds")return withRateSuffix(formatDuration(value));let durationScale=DURATION_SCALE_MS[unit];if(durationScale)return withRateSuffix(formatDuration(value*durationScale));if(unit==="nanoseconds"||unit==="microseconds"){let suffix=unit==="nanoseconds"?" ns":" \xB5s",formatted2=TWO_FRACTION_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2}${suffix}`)}let byteScale=BYTE_SCALE[unit];if(byteScale)return withRateSuffix(formatBytes(value*byteScale));if(unit==="gigabyte hour"||unit==="gigabyte hours"){let formatted2=TWO_SIGNIFICANT_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2} GB-hrs`)}if(unit==="usd"||unit==="us dollars"||unit==="dollars")return withRateSuffix(USD_FORMATTER.format(value));if(unit==="count"&&aggregation==="sum")return formatCountValue();let formatted=COMPACT_NUMBER_FORMATTER.format(value),unitLabel=baseUnit?.trim();return withRateSuffix(!unitLabel||unit==="units"||unit==="count"||unit==="ratio"?formatted:`${formatted} ${unitLabel}`)}function formatMinMaxTimestamp(date,periodStart,periodEnd){return periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()&&periodStart.getUTCMonth()===periodEnd.getUTCMonth()&&periodStart.getUTCDate()===periodEnd.getUTCDate()?`${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()?`${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function extractGroupedSeries(data,groupBy,rollupColumn,periodStart,periodEnd,granularityMs){let groups=[],groupValues=new Map,valueByGroup=new Map,observedTimestamps=new Set;for(let row of data){let values=groupBy.map(field=>getGroupFieldValue(row,field)),key=toGroupKey(values);groupValues.has(key)||(groups.push(key),groupValues.set(key,values));let groupMap=getOrCreate(valueByGroup,key,()=>new Map),rawTimestamp=row.timestamp;if(rawTimestamp.length===0)continue;let timestamp=normalizeTimestampToIso(rawTimestamp);if(!timestamp)continue;observedTimestamps.add(timestamp);let numeric=toNumericValue(row[rollupColumn]);groupMap.set(timestamp,numeric)}let expectedTimestamps=buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps),series=new Map;for(let key of groups){let byTimestamp=valueByGroup.get(key);if(!byTimestamp)continue;let points=expectedTimestamps.map(timestamp=>({timestamp,value:byTimestamp.has(timestamp)?byTimestamp.get(timestamp)??null:null}));series.set(key,points)}return{groups,series,groupValues}}function computeGroupStats(points){let present=points.filter(isPointWithValue);if(present.length===0)return{total:0,avg:0,min:{value:0,timestamp:""},max:{value:0,timestamp:""},count:0,allMissing:!0};let total=0,min=present[0],max=present[0];for(let point of present)total+=point.value,point.value<min.value&&(min=point),point.value>max.value&&(max=point);return{total,avg:total/present.length,min:{value:min.value,timestamp:min.timestamp},max:{value:max.value,timestamp:max.timestamp},count:present.length,allMissing:!1}}var MAX_GROUP_VALUE_LENGTH=60;function downsample(values,maxLen){if(maxLen<=0)return[];if(values.length<=maxLen)return[...values];let result=[];for(let i=0;i<maxLen;i++){let start=Math.floor(i*values.length/maxLen),end=Math.floor((i+1)*values.length/maxLen),bucket=values.slice(start,Math.max(start+1,end)),nullCount=bucket.filter(value=>value===null).length;if(nullCount===bucket.length||nullCount>bucket.length/2){result.push(null);continue}let present=bucket.filter(isNonNullNumber),avg=present.reduce((sum,value)=>sum+value,0)/present.length;result.push(avg)}return result}function generateSparkline(values){let sampled=downsample(values,MAX_SPARKLINE_LENGTH);if(sampled.length===0)return"";let present=sampled.filter(isNonNullNumber);if(present.length===0)return sampled.map(()=>MISSING_CHAR).join("");let min=Math.min(...present),max=Math.max(...present);if(min===max){let block=min===0?BLOCKS[0]:BLOCKS[BLOCKS.length-1];return sampled.map(value=>value===null?MISSING_CHAR:block).join("")}let range=max-min;return sampled.map(value=>{if(value===null)return MISSING_CHAR;let ratio=(value-min)/range,index=Math.max(0,Math.min(BLOCKS.length-1,Math.round(ratio*(BLOCKS.length-1))));return BLOCKS[index]}).join("")}function formatMetadataHeader(opts){let periodSpan=opts.compact?formatPeriodSpan(opts.periodStart,opts.periodEnd):null,rows=[];return opts.compact||rows.push({key:"Metric",value:`${opts.metric} ${opts.aggregation}`}),rows.push({key:"Period",value:`${formatPeriodBound(opts.periodStart)} to ${formatPeriodBound(opts.periodEnd)} (UTC)${periodSpan?` ${periodSpan}`:""}`},{key:"Interval",value:"days"in opts.granularity?`${formatGranularity(opts.granularity)} (${opts.bucketTimezone??"UTC"})`:formatGranularity(opts.granularity)}),typeof opts.periodUnique=="number"&&rows.push({key:"Unique (period)",value:formatCount(opts.periodUnique)}),!opts.compact&&opts.filter&&rows.push({key:"Filter",value:opts.filter}),!opts.compact&&opts.orderBy&&opts.orderDirection&&rows.push({key:"Order By",value:`${opts.orderBy} ${opts.orderDirection}${opts.orderBy==="count"?" (default)":""}`}),opts.scope.type==="project"?rows.push({key:"Project",value:`${opts.projectName??opts.scope.projectIds[0]} (${opts.teamName??opts.scope.ownerId})`}):rows.push({key:"Team",value:`${opts.teamName??opts.scope.ownerId} (all projects)`}),!opts.compact&&typeof opts.groupCount=="number"&&rows.push({key:"Groups",value:String(opts.groupCount)}),rows.map(row=>`> ${import_chalk.default.gray(`${row.key}:`)} ${row.value}`).join(`
|
|
7
|
+
import{getResolvedOrderMetadata,getRollupColumnName}from"./chunk-YO6SJCZP.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{ellipsizeMiddle}from"./chunk-TOTTVS5P.js";import{table}from"./chunk-375JVQYK.js";import{elapsed}from"./chunk-Q7D7RGXM.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var CANONICAL_AGGREGATIONS=["count","sum","avg","min","max","p50","p75","p90","p95","p99","stddev"];function isCanonicalAggregation(aggregation){return CANONICAL_AGGREGATIONS.includes(aggregation)}var DURATION_UNITS=new Set(["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"]);function normalizeMetricUnit(unit){return unit.trim().toLowerCase().replace(/[_\s]+/g," ")}function getPreferredCustomMetricAggregation(unit){let normalizedUnit=normalizeMetricUnit(unit);return DURATION_UNITS.has(normalizedUnit)?"p75":normalizedUnit==="percent"?"avg":"sum"}function getDefaultCustomMetricAggregation(unit,aggregations){let preferredAggregation=getPreferredCustomMetricAggregation(unit);return aggregations?.includes(preferredAggregation)?preferredAggregation:aggregations?.includes("sum")?"sum":aggregations?.find(isCanonicalAggregation)}var import_ms=__toESM(require_ms(),1),MINUTE_MS=60*1e3,HOUR_MS=60*MINUTE_MS,DAY_MS=24*HOUR_MS;function toGranularityDuration(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}". Use 1m, 5m, 15m, 1h, 4h, 1d.`);return milliseconds>=DAY_MS?{days:milliseconds/DAY_MS}:milliseconds>=HOUR_MS?{hours:milliseconds/HOUR_MS}:{minutes:milliseconds/MINUTE_MS}}function toGranularityMs(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}".`);return milliseconds}var GRANULARITY_THRESHOLDS=[[1*HOUR_MS,"1m","1m"],[2*HOUR_MS,"5m","5m"],[12*HOUR_MS,"15m","5m"],[3*DAY_MS,"1h","1h"],[30*DAY_MS,"4h","4h"]],FALLBACK_GRANULARITY="1d";function getAutoGranularity(rangeMs){for(let[maxRange,defaultG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return defaultG;return FALLBACK_GRANULARITY}function getMinGranularity(rangeMs){for(let[maxRange,,minG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return minG;return FALLBACK_GRANULARITY}function computeGranularity(rangeMs,explicit){if(!explicit){let auto=getAutoGranularity(rangeMs);return{duration:toGranularityDuration(auto),adjusted:!1}}let minG=getMinGranularity(rangeMs),explicitMs=toGranularityMs(explicit),minMs=toGranularityMs(minG);if(explicitMs<minMs){let rangeDays=Math.round(rangeMs/DAY_MS),rangeHours=Math.round(rangeMs/HOUR_MS),rangeLabel=rangeDays>=1?`${rangeDays}-day`:`${rangeHours}-hour`;return{duration:toGranularityDuration(minG),adjusted:!0,notice:`Granularity adjusted from ${explicit} to ${minG} for a ${rangeLabel} time range.`}}return{duration:toGranularityDuration(explicit),adjusted:!1}}function toGranularityMsFromDuration(duration){return"minutes"in duration?duration.minutes*MINUTE_MS:"hours"in duration?duration.hours*HOUR_MS:duration.days*DAY_MS}var import_chalk=__toESM(require_source(),1);var GROUP_KEY_DELIMITER="",MAX_SPARKLINE_LENGTH=120,DURATION_SCALE_MS={seconds:1e3,minutes:6e4,hours:36e5,days:864e5},BYTE_SCALE={bytes:1,kilobytes:1e3,megabytes:1e6,gigabytes:1e9,terabytes:1e12,petabytes:1e15},COMPACT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short"}),TWO_FRACTION_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),TWO_SIGNIFICANT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{minimumSignificantDigits:2,maximumSignificantDigits:2,maximumFractionDigits:2}),PERCENTAGE_FORMATTER=new Intl.NumberFormat("en-US",{style:"unit",unit:"percent",unitDisplay:"narrow",maximumFractionDigits:1}),USD_FORMATTER=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),BLOCKS=["\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],MISSING_CHAR="\xB7";function isAggregationWithDimension(aggregation){let[,dimension]=aggregation.split("/");return!!dimension}function toGroupKey(groupValues){return groupValues.length===0?"":groupValues.join(GROUP_KEY_DELIMITER)}function pad2(n){return String(n).padStart(2,"0")}function pad4(n){return String(n).padStart(4,"0")}function formatHumanMinute(date){return`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function formatPeriodBound(input){let date=new Date(input);return isNaN(date.getTime())?input:formatHumanMinute(date)}function formatPeriodSpan(startInput,endInput){let start=Date.parse(startInput),durationMs=Date.parse(endInput)-start;return!Number.isFinite(durationMs)||durationMs<=0?null:elapsed(durationMs)}function getStatColumns(aggregation){return aggregation==="sum"||aggregation==="count"?["total","avg","min","max"]:["avg","min","max"]}function toNumericValue(value){if(value==null)return null;if(typeof value=="number")return Number.isFinite(value)?value:null;let parsed=Number(value);return Number.isFinite(parsed)?parsed:null}function isNonNullNumber(value){return value!==null}function isPointWithValue(point){return point.value!==null}function getOrCreate(map,key,make){let existing=map.get(key);if(existing!==void 0)return existing;let created=make();return map.set(key,created),created}function getGroupFieldValue(row,field){let value=row[field];return value==null||value===""?"(not set)":String(value)}function normalizeTimestampToIso(timestamp){let parsed=Date.parse(timestamp);return isNaN(parsed)?null:new Date(parsed).toISOString()}function formatStatCell(column,stats,periodStart,periodEnd,formatValue){switch(column){case"total":return formatValue(stats.total);case"avg":return formatValue(stats.avg,{preserveFractionalCount:!0});case"min":{let ts=formatMinMaxTimestamp(new Date(stats.min.timestamp),periodStart,periodEnd);return`${formatValue(stats.min.value)} at ${ts}`}case"max":{let ts=formatMinMaxTimestamp(new Date(stats.max.timestamp),periodStart,periodEnd);return`${formatValue(stats.max.value)} at ${ts}`}}}function buildExpectedTimestamps(periodStart,periodEnd,granularityMs){let start=Date.parse(periodStart),end=Date.parse(periodEnd);if(isNaN(start)||isNaN(end)||granularityMs<=0||end<=start)return[];let timestamps=[];for(let current=start;current<end;current+=granularityMs)timestamps.push(new Date(current).toISOString());return timestamps}function buildObservedTimestamps(observedTimestamps,granularityMs){let timestamps=[...observedTimestamps].map(timestamp=>Date.parse(timestamp)).filter(Number.isFinite).sort((a,b)=>a-b);if(timestamps.length===0||granularityMs<=0)return[];let start=timestamps[0],end=timestamps[timestamps.length-1]+granularityMs;return buildExpectedTimestamps(new Date(start).toISOString(),new Date(end).toISOString(),granularityMs)}function buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps){let expectedTimestamps=buildExpectedTimestamps(periodStart,periodEnd,granularityMs);return observedTimestamps.size===0||expectedTimestamps.some(timestamp=>observedTimestamps.has(timestamp))?expectedTimestamps:buildObservedTimestamps(observedTimestamps,granularityMs)}function formatCount(n){return Math.round(n).toLocaleString("en-US")}function formatDecimal(n){if(!Number.isFinite(n))return String(n);if(n===0||Object.is(n,-0))return"0";let sign=n<0?"-":"",abs=Math.abs(n);if(abs>=1)return`${sign}${abs.toFixed(1)}`;let exponent=Math.floor(Math.log10(abs)),decimals=Math.min(20,Math.max(2,-exponent+1)),trimmed=abs.toFixed(decimals).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,"");return`${sign}${trimmed}`}function formatDuration(durationMs){let durationSeconds=durationMs/1e3;return durationMs<1e3?`${durationMs.toFixed(0)}ms`:durationMs<5e3?`${Math.round(durationSeconds*100)/100}s`:durationSeconds<60?`${durationSeconds.toFixed(0)}s`:durationSeconds<3600?`${(durationSeconds/60).toFixed(0)}m`:`${(durationSeconds/3600).toFixed(0)}h`}function formatBytes(bytes){if(bytes===0)return"0 Bytes";let units=["Bytes","KB","MB","GB","TB","PB"],absoluteBytes=Math.abs(bytes),unitIndex=Math.min(units.length-1,Math.max(0,Math.floor(Math.log(absoluteBytes)/Math.log(1e3)))),value=bytes/1e3**unitIndex;return(unitIndex===1||unitIndex===2)&&(value=Math.round(value),Math.abs(value)===1e3&&unitIndex<units.length-1&&(value/=1e3,unitIndex+=1)),`${TWO_FRACTION_NUMBER_FORMATTER.format(value)} ${units[unitIndex]}`}function formatMetricValue(value,baseUnit,aggregation,opts){let formatCountValue=()=>opts?.preserveFractionalCount&&!Number.isInteger(value)?formatDecimal(value):formatCount(value);if(isAggregationWithDimension(aggregation)||aggregation==="count")return formatCountValue();let unit=normalizeMetricUnit(baseUnit??"units");if(aggregation==="percent"||unit==="percent")return PERCENTAGE_FORMATTER.format(value);if(aggregation==="unique")return COMPACT_NUMBER_FORMATTER.format(value);let withRateSuffix=formatted2=>aggregation==="persecond"?`${formatted2}/s`:formatted2;if(unit==="milliseconds")return withRateSuffix(formatDuration(value));let durationScale=DURATION_SCALE_MS[unit];if(durationScale)return withRateSuffix(formatDuration(value*durationScale));if(unit==="nanoseconds"||unit==="microseconds"){let suffix=unit==="nanoseconds"?" ns":" \xB5s",formatted2=TWO_FRACTION_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2}${suffix}`)}let byteScale=BYTE_SCALE[unit];if(byteScale)return withRateSuffix(formatBytes(value*byteScale));if(unit==="gigabyte hour"||unit==="gigabyte hours"){let formatted2=TWO_SIGNIFICANT_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2} GB-hrs`)}if(unit==="usd"||unit==="us dollars"||unit==="dollars")return withRateSuffix(USD_FORMATTER.format(value));if(unit==="count"&&aggregation==="sum")return formatCountValue();let formatted=COMPACT_NUMBER_FORMATTER.format(value),unitLabel=baseUnit?.trim();return withRateSuffix(!unitLabel||unit==="units"||unit==="count"||unit==="ratio"?formatted:`${formatted} ${unitLabel}`)}function formatMinMaxTimestamp(date,periodStart,periodEnd){return periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()&&periodStart.getUTCMonth()===periodEnd.getUTCMonth()&&periodStart.getUTCDate()===periodEnd.getUTCDate()?`${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()?`${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function extractGroupedSeries(data,groupBy,rollupColumn,periodStart,periodEnd,granularityMs){let groups=[],groupValues=new Map,valueByGroup=new Map,observedTimestamps=new Set;for(let row of data){let values=groupBy.map(field=>getGroupFieldValue(row,field)),key=toGroupKey(values);groupValues.has(key)||(groups.push(key),groupValues.set(key,values));let groupMap=getOrCreate(valueByGroup,key,()=>new Map),rawTimestamp=row.timestamp;if(rawTimestamp.length===0)continue;let timestamp=normalizeTimestampToIso(rawTimestamp);if(!timestamp)continue;observedTimestamps.add(timestamp);let numeric=toNumericValue(row[rollupColumn]);groupMap.set(timestamp,numeric)}let expectedTimestamps=buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps),series=new Map;for(let key of groups){let byTimestamp=valueByGroup.get(key);if(!byTimestamp)continue;let points=expectedTimestamps.map(timestamp=>({timestamp,value:byTimestamp.has(timestamp)?byTimestamp.get(timestamp)??null:null}));series.set(key,points)}return{groups,series,groupValues}}function computeGroupStats(points){let present=points.filter(isPointWithValue);if(present.length===0)return{total:0,avg:0,min:{value:0,timestamp:""},max:{value:0,timestamp:""},count:0,allMissing:!0};let total=0,min=present[0],max=present[0];for(let point of present)total+=point.value,point.value<min.value&&(min=point),point.value>max.value&&(max=point);return{total,avg:total/present.length,min:{value:min.value,timestamp:min.timestamp},max:{value:max.value,timestamp:max.timestamp},count:present.length,allMissing:!1}}var MAX_GROUP_VALUE_LENGTH=60;function downsample(values,maxLen){if(maxLen<=0)return[];if(values.length<=maxLen)return[...values];let result=[];for(let i=0;i<maxLen;i++){let start=Math.floor(i*values.length/maxLen),end=Math.floor((i+1)*values.length/maxLen),bucket=values.slice(start,Math.max(start+1,end)),nullCount=bucket.filter(value=>value===null).length;if(nullCount===bucket.length||nullCount>bucket.length/2){result.push(null);continue}let present=bucket.filter(isNonNullNumber),avg=present.reduce((sum,value)=>sum+value,0)/present.length;result.push(avg)}return result}function generateSparkline(values){let sampled=downsample(values,MAX_SPARKLINE_LENGTH);if(sampled.length===0)return"";let present=sampled.filter(isNonNullNumber);if(present.length===0)return sampled.map(()=>MISSING_CHAR).join("");let min=Math.min(...present),max=Math.max(...present);if(min===max){let block=min===0?BLOCKS[0]:BLOCKS[BLOCKS.length-1];return sampled.map(value=>value===null?MISSING_CHAR:block).join("")}let range=max-min;return sampled.map(value=>{if(value===null)return MISSING_CHAR;let ratio=(value-min)/range,index=Math.max(0,Math.min(BLOCKS.length-1,Math.round(ratio*(BLOCKS.length-1))));return BLOCKS[index]}).join("")}function formatMetadataHeader(opts){let periodSpan=opts.compact?formatPeriodSpan(opts.periodStart,opts.periodEnd):null,rows=[];return opts.compact||rows.push({key:"Metric",value:`${opts.metric} ${opts.aggregation}`}),rows.push({key:"Period",value:`${formatPeriodBound(opts.periodStart)} to ${formatPeriodBound(opts.periodEnd)} (UTC)${periodSpan?` ${periodSpan}`:""}`},{key:"Interval",value:"days"in opts.granularity?`${formatGranularity(opts.granularity)} (${opts.bucketTimezone??"UTC"})`:formatGranularity(opts.granularity)}),typeof opts.periodUnique=="number"&&rows.push({key:"Unique (period)",value:formatCount(opts.periodUnique)}),!opts.compact&&opts.filter&&rows.push({key:"Filter",value:opts.filter}),!opts.compact&&opts.orderBy&&opts.orderDirection&&rows.push({key:"Order By",value:`${opts.orderBy} ${opts.orderDirection}${opts.orderBy==="count"?" (default)":""}`}),opts.scope.type==="project"?rows.push({key:"Project",value:`${opts.projectName??opts.scope.projectIds[0]} (${opts.teamName??opts.scope.ownerId})`}):rows.push({key:"Team",value:`${opts.teamName??opts.scope.ownerId} (all projects)`}),!opts.compact&&typeof opts.groupCount=="number"&&rows.push({key:"Groups",value:String(opts.groupCount)}),rows.map(row=>`> ${import_chalk.default.gray(`${row.key}:`)} ${row.value}`).join(`
|
|
8
8
|
`)}function formatSummaryTable(opts){let statColumns=getStatColumns(opts.aggregation),header=[...opts.groupByFields,...statColumns],rows=[header.map(name=>import_chalk.default.bold(import_chalk.default.cyan(name)))];for(let row of opts.rows){let nextRow=row.groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,opts.ansiAwareGroupValues));if(row.stats.allMissing){nextRow.push(...statColumns.map(()=>"--")),rows.push(nextRow);continue}nextRow.push(...statColumns.map(column=>formatStatCell(column,row.stats,opts.periodStart,opts.periodEnd,opts.formatValue))),rows.push(nextRow)}let centeredColumns=new Set(["min","max"]),align=header.map(col=>centeredColumns.has(col)?"c":"r");return indent_default(table(rows,{align,hsep:2}),2)}function formatSparklineSection(groupRows,sparklines,groupByFields,compact=!1){if(groupRows.length===0){let sparkline=sparklines[0],chart2=sparkline?indent_default(sparkline,2):"";return compact?chart2:["sparklines:",chart2].filter(Boolean).join(`
|
|
9
9
|
`)}let rows=[[...groupByFields,compact?"":"sparkline"].map(name=>import_chalk.default.bold(import_chalk.default.cyan(name))),...groupRows.map((groupValues,index)=>[...groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,compact)),sparklines[index]??""])],align=groupByFields.map(()=>"r");align.push("l");let chart=indent_default(table(rows,{align,hsep:2}),2);return compact?chart:`sparklines:
|
|
10
10
|
${chart}`}function formatText(response,opts){let rollupColumn=getRollupColumnName(opts.metric,opts.aggregation),formatValue=(value,formatOptions)=>formatMetricValue(value,opts.metricUnit,opts.aggregation,formatOptions),granularityMs=toGranularityMsFromDuration(opts.granularity),orderMetadata=getResolvedOrderMetadata(opts,response),{groups,series,groupValues}=extractGroupedSeries(response.data??[],opts.groupBy,rollupColumn,opts.periodStart,opts.periodEnd,granularityMs),periodUnique;if(isAggregationWithDimension(opts.aggregation)&&opts.groupBy.length===0){let summaryValue=toNumericValue(response.summary?.[0]?.[rollupColumn]);summaryValue!==null&&(periodUnique=summaryValue)}let metadata=formatMetadataHeader({metric:opts.metric,aggregation:opts.aggregation,periodStart:opts.periodStart,periodEnd:opts.periodEnd,granularity:opts.granularity,periodUnique,bucketTimezone:opts.bucketTimezone,filter:opts.filter,...opts.groupBy.length>0?orderMetadata:{},scope:opts.scope,projectName:opts.projectName,teamName:opts.teamName,groupCount:opts.groupBy.length>0?groups.length:void 0,compact:opts.presentation?.compact});if(groups.length===0)return`${metadata}
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{buildCommandWithGlobalFlags}from"./chunk-
|
|
7
|
+
import{buildCommandWithGlobalFlags}from"./chunk-ZUI5EMXD.js";import{printAlignedLabel}from"./chunk-64UCX5JM.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{quoteArg}from"./chunk-CKTLP5GX.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var CRITICAL_DELIVERY_DESCRIPTION="Critical only (escalated by Vercel Agent)";function formatMinimumSeverity(notification){let level=notification.minimumSeverityLevel;return level==="critical"?CRITICAL_DELIVERY_DESCRIPTION:level?`${level[0].toUpperCase()}${level.slice(1)} and above`:notification.type==="webhook"&&!("url"in notification.webhook)?"Details unavailable":"Monitor setting"}function formatProjectScope(scope){return scope.type==="all"?"all projects":`${scope.projectName} (${scope.projectId})`}function formatNotificationExpanded(notification,index){if(notification.type==="slack")return[` ${index+1}. ${import_chalk.default.bold("Slack")} ${import_chalk.default.cyan(`#${notification.channelName}`)}`,` ${import_chalk.default.dim("Project scope:")} ${formatProjectScope(notification.projectScope)}`,` ${import_chalk.default.dim("Channel ID:")} ${notification.channelId}`,` ${import_chalk.default.dim("Slack installation ID:")} ${notification.configId}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
8
8
|
`);let{webhook}=notification;return[` ${index+1}. ${import_chalk.default.bold("Webhook")}`,` ${import_chalk.default.dim("Webhook ID:")} ${webhook.id}`,` ${import_chalk.default.dim("URL:")} ${"url"in webhook?webhook.url:"Details unavailable"}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
9
9
|
`)}function formatRuleExpanded(ruleId,notifications){let lines=[` ${import_chalk.default.bold(ruleId)}`];return notifications.length===0?lines.push(` ${import_chalk.default.dim("No notification destinations")}`):lines.push(notifications.map((notification,index)=>formatNotificationExpanded(notification,index)).join(`
|
|
10
10
|
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-CKTLP5GX.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:[{command:"vercel monitors schema --type built-in"}]},monitorsAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope option, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",preformatted:!0,body:[...JSON.stringify(builtInBody,null,2).split(`
|
|
8
8
|
`),"",{command:"vercel monitors add --project my-app --body ./rule.json"}]},authoringReference],monitorsUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored monitor.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the monitor to team-wide scope."]},{title:"Partial body (patch.json)",preformatted:!0,body:[...JSON.stringify(patchBody,null,2).split(`
|
|
9
9
|
`),"",{command:"vercel monitors update ar_abc123 --body ./patch.json"},{command:"vercel monitors update ar_abc123 --project my-app"}]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible monitors in the selected team"},mutationAllOption={...listAllOption,description:"Apply the monitor to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the monitor body from a JSON file"},monitorsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List monitors for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by monitor type"},formatOption,jsonOption],examples:[{name:"List monitors affecting the linked project",value:`${packageName} monitors ls`},{name:"List all monitors in the selected team",value:`${packageName} monitors ls --all`},{name:"Write JSON output",value:`${packageName} monitors ls --all --json`}]},monitorsSchemaSubcommand={name:"schema",aliases:[],description:"Show monitor request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Monitor type to describe"},formatOption,jsonOption],examples:[{name:"List supported monitor types",value:`${packageName} monitors schema`},{name:"Show the built-in monitor schema",value:`${packageName} monitors schema --type built-in`}]},monitorsAddSubcommand={name:"add",aliases:["create"],description:"Add a monitor from a JSON body",helpSections:monitorsAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in monitor",value:`${packageName} monitors add --all --body ./rule.json`}]},monitorsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one monitor by ID",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors inspect ar_abc123 --json`}]},monitorsRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove a monitor",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Remove with confirmation",value:`${packageName} monitors remove ar_abc123`},{name:"Remove without a prompt",value:`${packageName} monitors remove ar_abc123 --yes`}]},monitorsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a monitor's settings or scope",helpSections:monitorsUpdateHelpSections,arguments:[{name:"monitorId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Move a monitor to a project",value:`${packageName} monitors update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the monitor"},monitorsNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable monitors or one monitor",arguments:[{name:"monitorId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable monitors",value:`${packageName} monitors notifications ls`},{name:"List notification destinations for one monitor",value:`${packageName} monitors notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors notifications ar_abc123 --json`}]},monitorsNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to a monitor",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},monitorsNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} monitors notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the monitor",value:`${packageName} monitors notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},monitorsNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from a monitor",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} monitors notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} monitors notifications unlink ar_abc123 --webhook wh_abc123`}]},monitorsNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for monitors",arguments:[],subcommands:[monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable monitors",value:`${packageName} monitors notifications`},{name:"List destinations for one monitor",value:`${packageName} monitors notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`}]},monitorsCommand={name:"monitors",aliases:[],description:"Add, inspect, list, update, and remove monitors, and manage their notification destinations",arguments:[],subcommands:[monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsAggregateCommand],options:monitorsLsSubcommand.options,examples:[{name:"List monitors for the linked project",value:`${packageName} monitors ls`},{name:"Add a monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Update a monitor",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Remove a monitor",value:`${packageName} monitors remove ar_abc123`},{name:"List notification destinations for a monitor",value:`${packageName} monitors notifications ar_abc123`}]};export{monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand,monitorsNotificationsAggregateCommand,monitorsCommand};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-
|
|
7
|
+
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-ZUI5EMXD.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-C4N4LKPM.js";import{getCommandNamePlain}from"./chunk-VRH7LWOC.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{getFlagsSpecification}from"./chunk-CKTLP5GX.js";function handleCommandTypo({command,availableCommands,threshold=.7,helpCommand="--help",client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(output_manager_default.fatal(payload.message),corrected&&output_manager_default.print(` ${corrected}
|
|
8
8
|
`),output_manager_default.print(`
|
|
9
9
|
See all commands:
|
|
10
10
|
${getCommandNamePlain(helpCommand)}
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-VRH7LWOC.js";import{allOption,confirmOption,formatOption,jsonOption,limitOption,nextCursorOption,yesOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-VRH7LWOC.js";import{allOption,confirmOption,formatOption,jsonOption,limitOption,nextCursorOption,yesOption}from"./chunk-CKTLP5GX.js";var listCommand={name:"list",aliases:["ls"],description:"List deployments.",arguments:[{name:"app",required:!1}],options:[allOption,{name:"meta",description:"Filter deployments by metadata (e.g. `--meta KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"m",type:[String],deprecated:!1},{name:"policy",description:"See deployments with provided Deployment Retention policies (e.g. `--policy KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"Filter deployments by environment",argument:"ENVIRONMENT",shorthand:"e",type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:null,deprecatedShorthand:"s",type:String,deprecated:!1},nextCursorOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!0},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list --meta key1=value1 --meta key2=value2`},{name:"Show the next page, using the cursor from the previous output",placeholders:["<CURSOR>"],value:`${packageName} list my-app --next <CURSOR>`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-
|
|
7
|
+
import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-CSOIXUCL.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-NIS66BFX.js";import{pullEnvRecords}from"./chunk-A5NC6IDR.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{external_exports}from"./chunk-
|
|
7
|
+
import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-PMEYNJU2.js";var positionSchema=external_exports.object({cursor:external_exports.string().min(1).optional(),offset:external_exports.number().int().min(0)});function encodeListCursor(position){return Buffer.from(JSON.stringify(position)).toString("base64url")}function decodeListCursor(value){try{let decoded=JSON.parse(Buffer.from(value,"base64url").toString()),parsed=positionSchema.safeParse(decoded);return parsed.success?parsed.data:void 0}catch{return}}function sliceList(items,start,limit){if(start.cursor!==void 0)return;let end=start.offset+limit;return{items:items.slice(start.offset,end),next:end<items.length?encodeListCursor({offset:end}):null}}async function collectList(fetchPage,start,limit,{maxPages=100}={}){let items=[],seen=new Set,position=start;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(position.cursor),remaining=page.items.slice(position.offset),taken=remaining.slice(0,limit-items.length);if(items.push(...taken),taken.length<remaining.length){let offset=position.offset+taken.length;return{items,next:encodeListCursor({cursor:position.cursor,offset})}}if(!page.cursor)return{items,next:null};if(seen.has(page.cursor))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");if(seen.add(page.cursor),position={cursor:page.cursor,offset:0},items.length===limit)return{items,next:encodeListCursor(position)}}return{items,next:encodeListCursor(position)}}export{decodeListCursor,sliceList,collectList};
|