vercel 64.5.0 → 65.0.0

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.
Files changed (309) hide show
  1. package/dist/chunks/add-2HOGPYWC.js +8 -0
  2. package/dist/chunks/add-2RYLJ442.js +8 -0
  3. package/dist/chunks/add-PAQE7CT2.js +8 -0
  4. package/dist/chunks/build-77Q2YPHO.js +7 -0
  5. package/dist/chunks/{chunk-OJKZ7EV3.js → chunk-27QCVNMI.js} +1 -1
  6. package/dist/chunks/chunk-2BAAJZBZ.js +12 -0
  7. package/dist/chunks/{chunk-CITTRAYH.js → chunk-2UBZCG4F.js} +1 -1
  8. package/dist/chunks/chunk-36N6VMW4.js +7 -0
  9. package/dist/chunks/chunk-3GXZPT7T.js +7 -0
  10. package/dist/chunks/{chunk-ZZ3LJ22B.js → chunk-3L4MAGRI.js} +3 -3
  11. package/dist/chunks/chunk-3XDTQFBL.js +57 -0
  12. package/dist/chunks/{chunk-3DP66SQ4.js → chunk-43T3YKNH.js} +1 -1
  13. package/dist/chunks/{chunk-VKXEOL4K.js → chunk-4NTBYNFR.js} +3 -2
  14. package/dist/chunks/chunk-4T22AQTB.js +7 -0
  15. package/dist/chunks/{chunk-TPVAPVQC.js → chunk-52JGR5SZ.js} +1 -1
  16. package/dist/chunks/{chunk-7QQIWMAT.js → chunk-66262IYI.js} +5 -5
  17. package/dist/chunks/{chunk-JH257EDL.js → chunk-66ODHUGV.js} +1 -1
  18. package/dist/chunks/chunk-732WJANV.js +15 -0
  19. package/dist/chunks/chunk-7C5JHTHO.js +7 -0
  20. package/dist/chunks/chunk-7G72V52B.js +7 -0
  21. package/dist/chunks/chunk-7OMWRRY4.js +9 -0
  22. package/dist/chunks/chunk-AGDMSAYW.js +9 -0
  23. package/dist/chunks/chunk-AW7DEWIM.js +7 -0
  24. package/dist/chunks/{chunk-XSDAUM4F.js → chunk-AZ5OUZPP.js} +1 -1
  25. package/dist/chunks/{chunk-7GFRZWLE.js → chunk-B6U5434D.js} +1 -1
  26. package/dist/chunks/{chunk-3NNH2U5M.js → chunk-BFJC3UDU.js} +1 -1
  27. package/dist/chunks/{chunk-KKCBFBJK.js → chunk-BHWEIKSP.js} +1 -1
  28. package/dist/chunks/chunk-BJ5APZ6X.js +7 -0
  29. package/dist/chunks/chunk-BZQ7YWSB.js +10 -0
  30. package/dist/chunks/chunk-CLKHGKJA.js +7 -0
  31. package/dist/chunks/{chunk-CYV3X62I.js → chunk-CTKJQTC5.js} +1 -1
  32. package/dist/chunks/{chunk-IVIZLWZQ.js → chunk-CZ2KEML2.js} +1 -1
  33. package/dist/chunks/{chunk-WYI4VNXT.js → chunk-DBNQ45J5.js} +1 -1
  34. package/dist/chunks/chunk-DGDNI76L.js +10 -0
  35. package/dist/chunks/{chunk-HVUJNVPS.js → chunk-EJINOHL3.js} +1 -1
  36. package/dist/chunks/chunk-EKMQNUO4.js +9 -0
  37. package/dist/chunks/chunk-ENWROHWX.js +7 -0
  38. package/dist/chunks/{chunk-OYMFOCD5.js → chunk-F4ZFLPMT.js} +1 -1
  39. package/dist/chunks/chunk-F53OKXYI.js +7 -0
  40. package/dist/chunks/{chunk-6UCSM3CZ.js → chunk-FN7TTXXY.js} +1 -1
  41. package/dist/chunks/{chunk-EVQJ7SCV.js → chunk-FPC5LINQ.js} +1 -1
  42. package/dist/chunks/chunk-FRSHC2HN.js +7 -0
  43. package/dist/chunks/chunk-GRVLQZFQ.js +7 -0
  44. package/dist/chunks/chunk-HBPSZHXX.js +7 -0
  45. package/dist/chunks/{chunk-PAOR4MQZ.js → chunk-HNF2BEOE.js} +1 -1
  46. package/dist/chunks/{chunk-VRAMXFRB.js → chunk-IKSZMJKB.js} +4 -3
  47. package/dist/chunks/chunk-IMMMID5G.js +7 -0
  48. package/dist/chunks/{chunk-LYU4MVL5.js → chunk-INDGZ3JK.js} +5 -5
  49. package/dist/chunks/chunk-IYM5GO57.js +9 -0
  50. package/dist/chunks/{chunk-XEBMH33W.js → chunk-JDVUKDX3.js} +1 -1
  51. package/dist/chunks/{chunk-2UPVIVAA.js → chunk-JETQEZ24.js} +1 -1
  52. package/dist/chunks/{chunk-CMEEAXVV.js → chunk-JT273F22.js} +1 -1
  53. package/dist/chunks/{chunk-TE2EE7DR.js → chunk-JWX2YZVC.js} +1 -1
  54. package/dist/chunks/{chunk-ACVDKHVS.js → chunk-KCVCGYAR.js} +2 -2
  55. package/dist/chunks/chunk-KDABXEHF.js +7 -0
  56. package/dist/chunks/chunk-KNTBWMVA.js +7 -0
  57. package/dist/chunks/chunk-KUGFILF5.js +7 -0
  58. package/dist/chunks/{chunk-PTI3TP7P.js → chunk-KXHUMVXD.js} +1 -1
  59. package/dist/chunks/{chunk-GNV6PG6W.js → chunk-L5ANBZTX.js} +1 -1
  60. package/dist/chunks/chunk-LJIQZ3LU.js +7 -0
  61. package/dist/chunks/chunk-MIKNK3B6.js +7 -0
  62. package/dist/chunks/{chunk-VS7O22ED.js → chunk-MTETAZA4.js} +1 -1
  63. package/dist/chunks/{chunk-ZQKDO5PL.js → chunk-NYKEU7DQ.js} +2 -2
  64. package/dist/chunks/chunk-O3AL3QFA.js +7 -0
  65. package/dist/chunks/chunk-ODB7LEAO.js +7 -0
  66. package/dist/chunks/{chunk-HARXQZV3.js → chunk-OVV5MV5M.js} +1 -1
  67. package/dist/chunks/{chunk-T3GQAMBJ.js → chunk-PADL3C6Z.js} +1 -1
  68. package/dist/chunks/{chunk-H3KYG32S.js → chunk-PNUH3XXW.js} +1 -1
  69. package/dist/chunks/{chunk-LUJL3KFT.js → chunk-PS3KKHSI.js} +1 -1
  70. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  71. package/dist/chunks/chunk-PXU645V7.js +8 -0
  72. package/dist/chunks/chunk-R3MRIQMO.js +7 -0
  73. package/dist/chunks/chunk-RAN5LUZY.js +7 -0
  74. package/dist/chunks/chunk-RH2SQQWH.js +10 -0
  75. package/dist/chunks/{chunk-SI7FQJIE.js → chunk-RTWGDRYT.js} +3 -3
  76. package/dist/chunks/{chunk-XXCWQPAH.js → chunk-RUOOZ574.js} +1 -1
  77. package/dist/chunks/{chunk-GWB27IAS.js → chunk-SLI2O5X7.js} +4 -4
  78. package/dist/chunks/chunk-SSKMT5SL.js +7 -0
  79. package/dist/chunks/chunk-T5LBVZWY.js +7 -0
  80. package/dist/chunks/chunk-UDMEPP3K.js +39 -0
  81. package/dist/chunks/{chunk-M774HRX5.js → chunk-UGZ3HFHI.js} +2 -2
  82. package/dist/chunks/chunk-UMUPJDWU.js +7 -0
  83. package/dist/chunks/chunk-VAZQS475.js +7 -0
  84. package/dist/chunks/chunk-VCV3H73W.js +7 -0
  85. package/dist/chunks/{chunk-JZ7FDBS4.js → chunk-VF2WX27D.js} +1 -1
  86. package/dist/chunks/chunk-VO2XAQFF.js +22 -0
  87. package/dist/chunks/{chunk-TLEBLYBS.js → chunk-VO36D4U4.js} +1 -1
  88. package/dist/chunks/chunk-VWK26HHN.js +7 -0
  89. package/dist/chunks/{chunk-TCQZFIBR.js → chunk-VY63XWWU.js} +1 -1
  90. package/dist/chunks/{chunk-BJXMXDBM.js → chunk-W7J5HTTY.js} +1 -1
  91. package/dist/chunks/{chunk-IJCCFLCQ.js → chunk-WDWYKX2I.js} +1 -1
  92. package/dist/chunks/{chunk-GVUB6QGX.js → chunk-WFEEUZ6B.js} +1 -1
  93. package/dist/chunks/{chunk-5S2NK6K6.js → chunk-WFSQ3OSN.js} +1 -1
  94. package/dist/chunks/{chunk-YROIQRYI.js → chunk-WKC7S5IW.js} +1 -1
  95. package/dist/chunks/{chunk-MZ3QGJH3.js → chunk-WTBGMDQ7.js} +1 -1
  96. package/dist/chunks/chunk-WYJGP5QW.js +7 -0
  97. package/dist/chunks/{chunk-MPZFMEVK.js → chunk-X3VSVBXT.js} +1 -1
  98. package/dist/chunks/{chunk-DRXOTZSJ.js → chunk-X5J7LOJK.js} +1 -1
  99. package/dist/chunks/{chunk-ROPQIBWJ.js → chunk-X7CLBXWL.js} +1 -1
  100. package/dist/chunks/chunk-XBTLXKOI.js +7 -0
  101. package/dist/chunks/{chunk-YQKURZ5W.js → chunk-XD2FF2PZ.js} +1 -1
  102. package/dist/chunks/chunk-XDKCDGJF.js +25 -0
  103. package/dist/chunks/chunk-YNOLLMOG.js +9 -0
  104. package/dist/chunks/{chunk-WN7EJWN4.js → chunk-YPX7BXJ6.js} +2 -2
  105. package/dist/chunks/{chunk-DNDBPLLI.js → chunk-YXZGKFF3.js} +1 -1
  106. package/dist/chunks/{chunk-6QRT6USI.js → chunk-Z6JDXW4A.js} +1 -1
  107. package/dist/chunks/{chunk-3GUO6F6P.js → chunk-ZIWS57E4.js} +1 -1
  108. package/dist/chunks/{chunk-5NXYYFRL.js → chunk-ZVRKM3UD.js} +1 -1
  109. package/dist/chunks/clear-HPHGW2CD.js +8 -0
  110. package/dist/chunks/compile-vercel-config-YG2E5LXN.js +7 -0
  111. package/dist/chunks/config-PZ7HFZQZ.js +8 -0
  112. package/dist/chunks/config-XH532PP3.js +7 -0
  113. package/dist/chunks/config-validator.mjs +1 -1
  114. package/dist/chunks/{connect-git-provider-2JIBL3ST.js → connect-git-provider-WEFO2ESM.js} +1 -1
  115. package/dist/chunks/delete-UPHMMYEJ.js +10 -0
  116. package/dist/chunks/delete-Z7PXYHTL.js +9 -0
  117. package/dist/chunks/{detect-projects-THLTMO7V.js → detect-projects-CHMBPFSE.js} +1 -1
  118. package/dist/chunks/detect-services-ZYHOOBMO.js +7 -0
  119. package/dist/chunks/disable-34LCZPFL.js +7 -0
  120. package/dist/chunks/discard-HDUCYAHG.js +14 -0
  121. package/dist/chunks/edit-4F7DADVN.js +9 -0
  122. package/dist/chunks/edit-5WKAHKCW.js +8 -0
  123. package/dist/chunks/enable-YV6I32W6.js +7 -0
  124. package/dist/chunks/{exec-NMRO6DIZ.js → exec-5ZWP5NC6.js} +1 -1
  125. package/dist/chunks/{export-KTLACTAJ.js → export-3OE2RWU7.js} +1 -1
  126. package/dist/chunks/future-N2ZTDYVW.js +7 -0
  127. package/dist/chunks/generate-cert-for-deploy-ORS7XL64.js +7 -0
  128. package/dist/chunks/image-WTWQT7A4.js +7 -0
  129. package/dist/chunks/import-builders-XBGAW4MC.js +7 -0
  130. package/dist/chunks/{inspect-7IZ7M2TX.js → inspect-GD6JJPWG.js} +1 -1
  131. package/dist/chunks/{inspect-JDSFHP6X.js → inspect-HYJULYCV.js} +1 -1
  132. package/dist/chunks/inspect-ISRYYL7L.js +13 -0
  133. package/dist/chunks/{inspect-PQNECP2Z.js → inspect-JWDH7C6F.js} +1 -1
  134. package/dist/chunks/inspect-MEYRAEVT.js +9 -0
  135. package/dist/chunks/{list-3N2CBVOG.js → list-4SZS2TB7.js} +1 -1
  136. package/dist/chunks/{list-2G2BWD4T.js → list-AGS47O5P.js} +2 -2
  137. package/dist/chunks/list-O7FAMXMT.js +12 -0
  138. package/dist/chunks/login-KNE2BGUB.js +9 -0
  139. package/dist/chunks/login-NCAGHBZD.js +7 -0
  140. package/dist/chunks/logs-7H5XDI44.js +7 -0
  141. package/dist/chunks/ls-KNRG7G5K.js +12 -0
  142. package/dist/chunks/ls-LGL5ZKEJ.js +12 -0
  143. package/dist/chunks/ls-RI6BNJO7.js +8 -0
  144. package/dist/chunks/ls-UJHETSDA.js +11 -0
  145. package/dist/chunks/ls-WQX2DS4X.js +12 -0
  146. package/dist/chunks/ls-Y2JQYSVO.js +12 -0
  147. package/dist/chunks/{ls-5YLXAARZ.js → ls-ZPUNJ7ND.js} +1 -1
  148. package/dist/chunks/mutate-QHSLJCQU.js +9 -0
  149. package/dist/chunks/notifications-557GW5KI.js +7 -0
  150. package/dist/chunks/open-IYLA5OZF.js +7 -0
  151. package/dist/chunks/openapi-IVXUCJPM.js +7 -0
  152. package/dist/chunks/permissions-2XHSDRNE.js +7 -0
  153. package/dist/chunks/prompt-missing-credentials-BLT57RIR.js +7 -0
  154. package/dist/chunks/publish-MQ56IB4K.js +15 -0
  155. package/dist/chunks/pull-K3JVXGZM.js +7 -0
  156. package/dist/chunks/purchase-domain-if-available-VDMLT3J2.js +7 -0
  157. package/dist/chunks/push-YXUJGMP4.js +7 -0
  158. package/dist/chunks/query-JA5OWDSP.js +12 -0
  159. package/dist/chunks/reauthenticate-YZXHWSEC.js +7 -0
  160. package/dist/chunks/reorder-UNU63VF3.js +10 -0
  161. package/dist/chunks/reply-CTLC5KAK.js +9 -0
  162. package/dist/chunks/resolve-HTKF4MMV.js +12 -0
  163. package/dist/chunks/resolve-agent-team-DLIROIXX.js +7 -0
  164. package/dist/chunks/restore-CSZYM5WU.js +16 -0
  165. package/dist/chunks/rm-BGLDOP4N.js +8 -0
  166. package/dist/chunks/rm-O2XVUZOW.js +8 -0
  167. package/dist/chunks/rm-OSMI52XV.js +8 -0
  168. package/dist/chunks/rm-SZIT75ZY.js +8 -0
  169. package/dist/chunks/rm-WJERY4WM.js +8 -0
  170. package/dist/chunks/{routes-LK2HUGAK.js → routes-ZNPZJERJ.js} +1 -1
  171. package/dist/chunks/rule-inspect-NGI6XURL.js +8 -0
  172. package/dist/chunks/schema-JLQ7SNYR.js +14 -0
  173. package/dist/chunks/{schema-QHZO72DB.js → schema-OV4SUO52.js} +7 -7
  174. package/dist/chunks/select-org-URO7GRAY.js +7 -0
  175. package/dist/chunks/set-RU227EQQ.js +7 -0
  176. package/dist/chunks/setup-and-link-WX6IEZZO.js +7 -0
  177. package/dist/chunks/skills-6EFE7KH7.js +590 -0
  178. package/dist/chunks/tags-KJINDQSV.js +7 -0
  179. package/dist/chunks/{types-77UW6BI4.js → types-2DDQTYAO.js} +1 -1
  180. package/dist/chunks/update-XUMH6CAJ.js +8 -0
  181. package/dist/commands/build/index.js +4 -4
  182. package/dist/commands/deploy/index.js +17 -13
  183. package/dist/commands/dev/index.js +26 -16
  184. package/dist/commands/env/index.js +13 -13
  185. package/dist/commands/link/index.js +1 -1
  186. package/dist/commands/list/index.js +2 -2
  187. package/dist/commands-bulk.js +725 -683
  188. package/dist/help.js +1 -1
  189. package/dist/index.js +2 -2
  190. package/dist/internal-build.js +1 -1
  191. package/dist/root-help-commands.mjs +1 -1
  192. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  193. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  194. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  195. package/dist/version.mjs +1 -1
  196. package/package.json +65 -59
  197. package/dist/chunks/add-CG73LA5A.js +0 -8
  198. package/dist/chunks/add-KBBLLPHW.js +0 -8
  199. package/dist/chunks/add-U5U56FJR.js +0 -8
  200. package/dist/chunks/build-7EWHBKAN.js +0 -7
  201. package/dist/chunks/chunk-2B3A3MOX.js +0 -7
  202. package/dist/chunks/chunk-2UMWTCY7.js +0 -7
  203. package/dist/chunks/chunk-2VBFQZ72.js +0 -7
  204. package/dist/chunks/chunk-5AYB3JRL.js +0 -9
  205. package/dist/chunks/chunk-74QCXPNW.js +0 -7
  206. package/dist/chunks/chunk-7NNENHGN.js +0 -7
  207. package/dist/chunks/chunk-AOWWC6WZ.js +0 -7
  208. package/dist/chunks/chunk-BFRDBBSO.js +0 -7
  209. package/dist/chunks/chunk-CMKLX4DC.js +0 -7
  210. package/dist/chunks/chunk-D4MW3RDW.js +0 -7
  211. package/dist/chunks/chunk-DDLM6CIQ.js +0 -10
  212. package/dist/chunks/chunk-DXLLC7ZM.js +0 -7
  213. package/dist/chunks/chunk-GLH4PVMY.js +0 -7
  214. package/dist/chunks/chunk-GVVIFYQE.js +0 -7
  215. package/dist/chunks/chunk-HJRAWEA2.js +0 -7
  216. package/dist/chunks/chunk-ILFUNCJZ.js +0 -7
  217. package/dist/chunks/chunk-ITKS32PG.js +0 -7
  218. package/dist/chunks/chunk-J6O6JW2K.js +0 -7
  219. package/dist/chunks/chunk-JIGCN5QS.js +0 -44
  220. package/dist/chunks/chunk-KUGXOLL7.js +0 -25
  221. package/dist/chunks/chunk-LD5U73LA.js +0 -7
  222. package/dist/chunks/chunk-MI7W4QMV.js +0 -7
  223. package/dist/chunks/chunk-MY4MONOH.js +0 -7
  224. package/dist/chunks/chunk-MYHJNSCW.js +0 -15
  225. package/dist/chunks/chunk-N2TNA2FE.js +0 -9
  226. package/dist/chunks/chunk-O4FDRZ22.js +0 -7
  227. package/dist/chunks/chunk-OHVPJNGY.js +0 -8
  228. package/dist/chunks/chunk-OUHPDA7Q.js +0 -7
  229. package/dist/chunks/chunk-P2O5DOYE.js +0 -7
  230. package/dist/chunks/chunk-P5BNAP5T.js +0 -39
  231. package/dist/chunks/chunk-PPCFQQSU.js +0 -7
  232. package/dist/chunks/chunk-Q5ZGA2RO.js +0 -7
  233. package/dist/chunks/chunk-QEXSF4NA.js +0 -7
  234. package/dist/chunks/chunk-QOFK5PKB.js +0 -20
  235. package/dist/chunks/chunk-U73RXMGU.js +0 -7
  236. package/dist/chunks/chunk-UCAE5Z5L.js +0 -7
  237. package/dist/chunks/chunk-UGMTKOTN.js +0 -7
  238. package/dist/chunks/chunk-UQIVF4Q2.js +0 -7
  239. package/dist/chunks/chunk-V3RDOM3U.js +0 -20
  240. package/dist/chunks/chunk-VEMJINMZ.js +0 -13
  241. package/dist/chunks/chunk-VKPZP4LC.js +0 -8
  242. package/dist/chunks/chunk-VLDU2MDL.js +0 -7
  243. package/dist/chunks/chunk-VRWLNWNE.js +0 -7
  244. package/dist/chunks/chunk-W3TGCMRW.js +0 -9
  245. package/dist/chunks/chunk-WCBNKVVG.js +0 -9
  246. package/dist/chunks/chunk-Y24OSBXP.js +0 -7
  247. package/dist/chunks/chunk-ZBDLYNUF.js +0 -7
  248. package/dist/chunks/chunk-ZDKSDWSO.js +0 -9
  249. package/dist/chunks/chunk-ZMY3GQBK.js +0 -7
  250. package/dist/chunks/chunk-ZQME5XUJ.js +0 -7
  251. package/dist/chunks/chunk-ZS2WS4AM.js +0 -7
  252. package/dist/chunks/clear-35NUHHDI.js +0 -8
  253. package/dist/chunks/compile-vercel-config-UQIYIVA6.js +0 -7
  254. package/dist/chunks/config-FZD3R5VT.js +0 -8
  255. package/dist/chunks/config-IQE5C7PZ.js +0 -7
  256. package/dist/chunks/delete-6LSSOF4X.js +0 -9
  257. package/dist/chunks/delete-IBRCB3S3.js +0 -10
  258. package/dist/chunks/detect-services-GFVD2C3W.js +0 -7
  259. package/dist/chunks/disable-4TODXYTB.js +0 -7
  260. package/dist/chunks/discard-WHC5FKWF.js +0 -14
  261. package/dist/chunks/edit-3DXOWQMF.js +0 -8
  262. package/dist/chunks/edit-R2RUDKC4.js +0 -9
  263. package/dist/chunks/enable-2OAHPKCN.js +0 -7
  264. package/dist/chunks/future-JZ3RVO4B.js +0 -7
  265. package/dist/chunks/generate-cert-for-deploy-D4IHTKQS.js +0 -7
  266. package/dist/chunks/image-UW5U6CRJ.js +0 -7
  267. package/dist/chunks/import-builders-JONKAYLL.js +0 -7
  268. package/dist/chunks/inspect-2FS4PYBH.js +0 -13
  269. package/dist/chunks/inspect-PWLUWUGV.js +0 -9
  270. package/dist/chunks/list-Y3OA4KFK.js +0 -11
  271. package/dist/chunks/login-LLM3Q6GJ.js +0 -9
  272. package/dist/chunks/login-VQN3F7JU.js +0 -7
  273. package/dist/chunks/logs-XEJPLFXM.js +0 -7
  274. package/dist/chunks/ls-2DACOWSU.js +0 -12
  275. package/dist/chunks/ls-2M7QSW2F.js +0 -12
  276. package/dist/chunks/ls-7DJWHOK4.js +0 -12
  277. package/dist/chunks/ls-GY2YLYMD.js +0 -12
  278. package/dist/chunks/ls-NJEJSYSO.js +0 -11
  279. package/dist/chunks/ls-OAJKYQEL.js +0 -8
  280. package/dist/chunks/mutate-G2I4ISF4.js +0 -9
  281. package/dist/chunks/notifications-6MXYY2V6.js +0 -7
  282. package/dist/chunks/open-YKOYB7PH.js +0 -7
  283. package/dist/chunks/openapi-36GMGEXR.js +0 -7
  284. package/dist/chunks/permissions-RRP6IEHS.js +0 -7
  285. package/dist/chunks/prompt-missing-credentials-WQUF6X6K.js +0 -7
  286. package/dist/chunks/publish-AQ3FYC3J.js +0 -15
  287. package/dist/chunks/pull-HT2MQ3ML.js +0 -7
  288. package/dist/chunks/purchase-domain-if-available-NDEUZYHK.js +0 -7
  289. package/dist/chunks/push-6LE54BCC.js +0 -7
  290. package/dist/chunks/query-SNY42BTX.js +0 -12
  291. package/dist/chunks/reauthenticate-4SGT475I.js +0 -7
  292. package/dist/chunks/reorder-SRF3NE5U.js +0 -10
  293. package/dist/chunks/reply-6HUIX4AX.js +0 -9
  294. package/dist/chunks/resolve-TNBNGA3G.js +0 -12
  295. package/dist/chunks/resolve-agent-team-XSXRT42F.js +0 -7
  296. package/dist/chunks/restore-HK4SWMZP.js +0 -16
  297. package/dist/chunks/rm-4VXZ3AIX.js +0 -8
  298. package/dist/chunks/rm-ESSU4MS4.js +0 -8
  299. package/dist/chunks/rm-EWPYZXTX.js +0 -8
  300. package/dist/chunks/rm-GNDGYUKQ.js +0 -8
  301. package/dist/chunks/rm-SKCAZTYN.js +0 -8
  302. package/dist/chunks/rule-inspect-RHHD5UIR.js +0 -8
  303. package/dist/chunks/rules-FF5FU7BV.js +0 -7
  304. package/dist/chunks/schema-HIKNWMV2.js +0 -14
  305. package/dist/chunks/select-org-CK5CWC3A.js +0 -7
  306. package/dist/chunks/set-5P44OPZP.js +0 -7
  307. package/dist/chunks/setup-and-link-OLSKD2HE.js +0 -7
  308. package/dist/chunks/tags-35DFWGDC.js +0 -7
  309. package/dist/chunks/update-WHBFIV22.js +0 -8
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.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:["vercel alerts rules schema --type built-in"]},rulesAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope flag, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",body:[...JSON.stringify(builtInBody,null,2).split(`
8
- `),"","vercel alerts rules add --project my-app --body ./rule.json"]},authoringReference],rulesUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored rule.","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 rule to team-wide scope."]},{title:"Partial body (patch.json)",body:[...JSON.stringify(patchBody,null,2).split(`
9
- `),"","vercel alerts rules update ar_abc123 --body ./patch.json","vercel alerts rules 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 rules in the selected team"},mutationAllOption={...listAllOption,description:"Apply the rule 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 alert rule body from a JSON file"},rulesLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List alert rules for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by rule type"},formatOption,jsonOption],examples:[{name:"List rules affecting the linked project",value:`${packageName} alerts rules ls`},{name:"List all rules in the selected team",value:`${packageName} alerts rules ls --all`},{name:"Write JSON output",value:`${packageName} alerts rules ls --all --json`}]},rulesSchemaSubcommand={name:"schema",aliases:[],description:"Show alert rule request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Rule type to describe"},formatOption,jsonOption],examples:[{name:"List supported rule types",value:`${packageName} alerts rules schema`},{name:"Show the built-in rule schema",value:`${packageName} alerts rules schema --type built-in`}]},rulesAddSubcommand={name:"add",aliases:["create"],description:"Create an alert rule from a JSON body",helpSections:rulesAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped rule",value:`${packageName} alerts rules add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in rule",value:`${packageName} alerts rules add --all --body ./rule.json`}]},rulesInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one alert rule by ID",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules inspect ar_abc123 --json`}]},rulesRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Delete an alert rule",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Delete with confirmation",value:`${packageName} alerts rules remove ar_abc123`},{name:"Delete without a prompt",value:`${packageName} alerts rules remove ar_abc123 --yes`}]},rulesUpdateSubcommand={name:"update",aliases:["patch"],description:"Patch an alert rule or change its scope",helpSections:rulesUpdateHelpSections,arguments:[{name:"ruleId",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} alerts rules update ar_abc123 --body ./patch.json`},{name:"Move a rule to a project",value:`${packageName} alerts rules 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 rule"},rulesNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable rules or one alert rule",arguments:[{name:"ruleId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable rules",value:`${packageName} alerts rules notifications ls`},{name:"List notification destinations for one rule",value:`${packageName} alerts rules notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules notifications ar_abc123 --json`}]},rulesNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},rulesNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} alerts rules notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the rule",value:`${packageName} alerts rules notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},rulesNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} alerts rules notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} alerts rules notifications unlink ar_abc123 --webhook wh_abc123`}]},rulesNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for alert rules",arguments:[],subcommands:[rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable rules",value:`${packageName} alerts rules notifications`},{name:"List destinations for one rule",value:`${packageName} alerts rules notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`}]},rulesAggregateCommand={name:"rules",aliases:[],description:"Create, inspect, list, update, and delete alert rules and manage their notification destinations",arguments:[],subcommands:[rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsAggregateCommand],options:[],examples:[{name:"List rules for the linked project",value:`${packageName} alerts rules ls`},{name:"Add a rule",value:`${packageName} alerts rules add --project my-app --body ./rule.json`},{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Update a rule",value:`${packageName} alerts rules update ar_abc123 --body ./patch.json`},{name:"Delete a rule",value:`${packageName} alerts rules remove ar_abc123`},{name:"List notification destinations for a rule",value:`${packageName} alerts rules notifications ar_abc123`}]};export{rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand,rulesNotificationsAggregateCommand,rulesAggregateCommand};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-PTI3TP7P.js";import{getExitCodeForErrorCode,handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-ZQKDO5PL.js";import{isJSONObject}from"./chunk-V3RDOM3U.js";import{getScope}from"./chunk-GLH4PVMY.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-DDLM6CIQ.js";import{getProjectByNameOrId}from"./chunk-JIGCN5QS.js";import{ProjectNotFound,isAPIError}from"./chunk-XSDAUM4F.js";import{output_manager_default}from"./chunk-M774HRX5.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
8
- `):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
9
- `)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to alert rules in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage alert rules in this team.":err.status>=500?`The alert rules endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the rule belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel alerts rules schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"alerts rules --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `alerts rules` subcommands"}]},2)}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption,limitOption,nextOption,projectOption,sinceOption,untilOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var typesSubcommand={name:"types",aliases:[],description:"List available event types with descriptions.",arguments:[],options:[formatOption,jsonOption],examples:[{name:"List all event types",value:`${packageName} activity types`},{name:"Output JSON",value:`${packageName} activity types --json`}]},activityCommand={name:"activity",aliases:[],description:"List user activity events.",arguments:[],subcommands:[{name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},typesSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by event type. Repeatable and comma-separated (e.g. --type deployment --type project-created or --type deployment,project-created)."},sinceOption,untilOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show all team events (ignore linked project auto-scoping)."},limitOption,nextOption,formatOption,jsonOption],examples:[{name:"List events for the linked project",value:`${packageName} activity`},{name:"Filter events by multiple types",value:`${packageName} activity --type deployment --type project-created --since 7d`},{name:"Filter events by comma-separated types",value:`${packageName} activity --type deployment,project-created --since 7d`},{name:"List all team events",value:`${packageName} activity --all --since 30d`},{name:"Output JSON",value:`${packageName} activity --json | jq '.events[]'`},{name:"List activity event types",value:`${packageName} activity types`}]};export{typesSubcommand,activityCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{tracesConfigCommand}from"./chunk-J6O6JW2K.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:null,type:String,deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{name:"deployment-id",shorthand:null,type:String,deprecated:!1,description:"Filter by deployment ID"},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Fetch a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open. Only valid with --open. Defaults to timeline."}],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Fetch a trace without the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",value:`${packageName} traces search --next <cursor> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{writeProjectSettings}from"./chunk-OYMFOCD5.js";import{autoInstallVercelPlugin}from"./chunk-ZZ3LJ22B.js";import{envPullCommandLogic}from"./chunk-SI7FQJIE.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{ensureLink}from"./chunk-ZMY3GQBK.js";import{pullCommand}from"./chunk-VRWLNWNE.js";import{parseTarget}from"./chunk-2B3A3MOX.js";import{help}from"./chunk-H3KYG32S.js";import{printError}from"./chunk-HARXQZV3.js";import{TelemetryClient}from"./chunk-KUGXOLL7.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT}from"./chunk-JIGCN5QS.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull"),0}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return printError(error),2}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"],environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]);let returnCode=await pullCommandLogic(client,cwd,autoConfirm,environment,parsedArgs.flags,parsedArgs.flags["--project"]);return returnCode===0&&!autoConfirm&&await autoInstallVercelPlugin(client),returnCode}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let pullResultCode=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);if(pullResultCode!==0)return pullResultCode;output_manager_default.print(`
8
- `),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string");let settingsStamp=stamp_default();return output_manager_default.print(`${prependEmoji(`Downloaded project settings to ${import_chalk.default.bold(humanizePath(join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT)))} ${import_chalk.default.gray(settingsStamp())}`,emoji("success"))}
9
- `),0}export{main,pullCommandLogic};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printProjectNotFoundError}from"./chunk-VEMJINMZ.js";import{performDeviceCodeFlow}from"./chunk-CITTRAYH.js";import{param}from"./chunk-3G3FQYMW.js";import{detectExplicitScope}from"./chunk-GLH4PVMY.js";import{buildCommandWithYes,outputActionRequired}from"./chunk-DDLM6CIQ.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-JIGCN5QS.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var parseEnv=env=>{if(!env)return{};if(typeof env=="string"&&(env=[env]),Array.isArray(env)){let startingDict={};return env.reduce((o,e)=>{let key,value,equalsSign=e.indexOf("=");return equalsSign===-1?key=e:(key=e.slice(0,equalsSign),value=e.slice(equalsSign+1)),o[key]=value,o},startingDict)}return env};async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId),1;if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-OLSKD2HE.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{getEnvRecords,pullEnvRecords,parseEnv,ensureLink};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{APIError,InvalidToken,MissingUser}from"./chunk-XSDAUM4F.js";import{output_manager_default}from"./chunk-M774HRX5.js";async function getUser(client){return client.user?client.user:(client.userPromise||(client.userPromise=fetchUser(client).finally(()=>{client.userPromise=void 0})),client.userPromise)}async function fetchUser(client){try{let res=await client.fetch("/v2/user",{useCurrentTeam:!1});if(!res.user)throw new MissingUser;if(client.authConfig.userId!==res.user.id){client.updateAuthConfig({userId:res.user.id});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}return client.telemetryEventStore.updateUserId(res.user.id),client.user=res.user,res.user}catch(error){if(error instanceof APIError&&error.status===403){if(client.user=void 0,client.userPromise=void 0,client.authConfig.userId){client.updateAuthConfig({userId:void 0});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}throw new InvalidToken(client.authConfig.tokenSource)}throw error}}export{getUser};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{__commonJS}from"./chunk-BZENIQ7N.js";var require_types=__commonJS({"../client/dist/types.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),types_exports={};__export(types_exports,{VALID_ARCHIVE_FORMATS:()=>VALID_ARCHIVE_FORMATS,fileNameSymbol:()=>fileNameSymbol});module.exports=__toCommonJS(types_exports);var VALID_ARCHIVE_FORMATS=["tgz"],fileNameSymbol=Symbol("fileName")}});export{require_types};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-YQKURZ5W.js";import"./chunk-ZQKDO5PL.js";import"./chunk-KKCBFBJK.js";import{permissionsClearSubcommand}from"./chunk-Q5ZGA2RO.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{printError}from"./chunk-HARXQZV3.js";import"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
8
- `):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig}from"./chunk-JZ7FDBS4.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrChoice,validateVcrJsonOutput}from"./chunk-YQKURZ5W.js";import{outputError}from"./chunk-ZQKDO5PL.js";import"./chunk-KKCBFBJK.js";import{configSubcommand}from"./chunk-BFRDBBSO.js";import"./chunk-2UMWTCY7.js";import"./chunk-Q5ZGA2RO.js";import"./chunk-UGMTKOTN.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{printError}from"./chunk-HARXQZV3.js";import"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var USAGE="vcr update <repository> --public <true|false>";async function config(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(configSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],publicValue=parsedArgs.flags["--public"],invalidChoice=validateVcrChoice(client,"--public",publicValue,["true","false"],fr.jsonOutput);if(typeof invalidChoice=="number")return invalidChoice;telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionPublic(publicValue);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,USAGE);if(typeof missingRepository=="number")return missingRepository;if(publicValue===void 0){let message="Missing a setting to change. Pass --public true to make the repository public, or --public false to make it private.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with --public true or --public false"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let desiredPublic=publicValue==="true",scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPath(scope,repository);output_manager_default.spinner("Updating repository...");try{let updated=await client.fetch(path,{method:"PATCH",body:{public:desiredPublic}});if(fr.jsonOutput)client.stdout.write(`${JSON.stringify(updated,null,2)}
8
- `);else{let isPublic=updated.repository?.public??desiredPublic;output_manager_default.success(`Repository ${updated.repository?.name??repository} is now ${isPublic?"public":"private"}`)}return 0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to confirm the name or id"}});throw err}finally{output_manager_default.stopSpinner()}}export{config as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-MYHJNSCW.js";import{tracesCommand}from"./chunk-ZBDLYNUF.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-J6O6JW2K.js";import"./chunk-BFRDBBSO.js";import"./chunk-2UMWTCY7.js";import"./chunk-Q5ZGA2RO.js";import"./chunk-UGMTKOTN.js";import"./chunk-UQIVF4Q2.js";import"./chunk-ITKS32PG.js";import"./chunk-7NNENHGN.js";import"./chunk-Y24OSBXP.js";import"./chunk-GVVIFYQE.js";import"./chunk-W3TGCMRW.js";import"./chunk-B4YYOSPY.js";import"./chunk-LD5U73LA.js";import"./chunk-VRWLNWNE.js";import"./chunk-TPVAPVQC.js";import"./chunk-JALVF3C2.js";import"./chunk-CMKLX4DC.js";import"./chunk-UCAE5Z5L.js";import{help}from"./chunk-H3KYG32S.js";import"./chunk-773GOZIR.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{TelemetryClient}from"./chunk-KUGXOLL7.js";import"./chunk-VKXEOL4K.js";import"./chunk-NWGBDBZI.js";import"./chunk-4SAVH3H7.js";import"./chunk-MI7W4QMV.js";import"./chunk-VKPZP4LC.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRm(actual){this.trackCliSubcommand({subcommand:"rm",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),rm:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,rm:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command){return output_manager_default.print(help(command,{parent:tracesCommand,columns:client.stderr.columns})),needHelp?0:2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),printHelp(actionMetadata||tracesConfigCommand);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-5YLXAARZ.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-5P44OPZP.js")).default(client);case"rm":return configTelemetry.trackCliSubcommandRm(actionOriginal),(await import("./rm-4VXZ3AIX.js")).default(client);default:return printHelp(tracesConfigCommand)}}export{config as default};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-6QRT6USI.js";import{outputError}from"./chunk-ZQKDO5PL.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import"./chunk-DRXOTZSJ.js";import"./chunk-VEMJINMZ.js";import{deleteSubcommand}from"./chunk-7NNENHGN.js";import"./chunk-HARXQZV3.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
8
- `),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
9
- `),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{deleteCommentMessage as default};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoutes,withGlobalFlags}from"./chunk-2UPVIVAA.js";import"./chunk-DRXOTZSJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-VEMJINMZ.js";import{deleteSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HARXQZV3.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes delete <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes delete <name-or-id> [...]")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
8
- `),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be deleted:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
9
- `)}if(output_manager_default.print(`
10
- `),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Deletion requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes delete ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Delete ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Deleting ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Deleted")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to delete routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to delete routes"),1}}export{deleteRoute as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig}from"./chunk-5NXYYFRL.js";import"./chunk-3DP66SQ4.js";import"./chunk-QEXSF4NA.js";import"./chunk-5S2NK6K6.js";import"./chunk-JZ7FDBS4.js";import"./chunk-25565AGS.js";import"./chunk-MVCAUS4F.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-ZS2WS4AM.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-2UPVIVAA.js";import"./chunk-DRXOTZSJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-VEMJINMZ.js";import{disableSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HARXQZV3.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import{outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
@@ -1,14 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,requireProjectContext,withGlobalFlags}from"./chunk-2UPVIVAA.js";import"./chunk-DRXOTZSJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-VEMJINMZ.js";import{discardSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HARXQZV3.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import{outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
8
- ${import_chalk.default.bold("Changes to be discarded:")}
9
-
10
- `),printDiffSummary(changedRoutes),output_manager_default.print(`
11
- `)):output_manager_default.print(`
12
- ${import_chalk.default.gray("No changes detected in staging version.")}
13
-
14
- `),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-CMEEAXVV.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-2UPVIVAA.js";import"./chunk-DRXOTZSJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-VEMJINMZ.js";import{editSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HARXQZV3.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import{outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0],{RoutesEditTelemetryClient}=await import("./routes-LK2HUGAK.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes update.",next:[{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes update <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full flags)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"retry with a unique name or id"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},2),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),2):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix flags per message; see routes update --help"}]},2),output_manager_default.error(error),2}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No update flags provided. In non-interactive mode pass flags such as --name, --src, --dest, --action, header flags, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes update --help"}],hint:"Run vercel routes update --help for all flag options."},2),output_manager_default.error(`No update flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes update --help")} for all options.`),2;if(output_manager_default.log(`
8
- Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to update this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes update <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{resolveMessageContent}from"./chunk-7GFRZWLE.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-6QRT6USI.js";import{outputError}from"./chunk-ZQKDO5PL.js";import"./chunk-IQ7FPAI4.js";import"./chunk-DRXOTZSJ.js";import"./chunk-VEMJINMZ.js";import{editSubcommand}from"./chunk-7NNENHGN.js";import"./chunk-HARXQZV3.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"update")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments update <thread> <message-id> -m <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with -m <text> or --file <path>.");telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
8
- `),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Updated message ${messageId}
9
- `),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{edit as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-2UPVIVAA.js";import"./chunk-DRXOTZSJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-VEMJINMZ.js";import{enableSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HARXQZV3.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import{outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function enable(client,argv){let parsed=await parseSubcommandArgs(argv,enableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes enable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes enable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --help"),when:"add routes first"}]},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled!==!1)return output_manager_default.log(`Route "${route.name}" is already enabled.`),0;let enableStamp=stamp_default();output_manager_default.spinner(`Enabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!0,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Enabled")} route "${route.name}" ${import_chalk.default.gray(enableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to enable route"},1),output_manager_default.error(error.message||"Failed to enable route"),1}}export{enable as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens}from"./chunk-CITTRAYH.js";import"./chunk-PVASGBEF.js";import"./chunk-EVQJ7SCV.js";import"./chunk-HARXQZV3.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-PPCFQQSU.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{createCertForCns,require_cjs,setupDomain}from"./chunk-LUJL3KFT.js";import"./chunk-DXLLC7ZM.js";import"./chunk-O4FDRZ22.js";import"./chunk-T3GQAMBJ.js";import"./chunk-A2RZZQEP.js";import"./chunk-3G3FQYMW.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HVUJNVPS.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLDU2MDL.js";import"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{InvalidDomain,NowError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_tldts=__toESM(require_cjs(),1);async function generateCertForDeploy(client,contextName,deployURL){let parsedDomain=(0,import_tldts.parse)(deployURL),{domain}=parsedDomain;if(!domain)return new InvalidDomain(deployURL);output_manager_default.spinner(`Setting custom suffix domain ${domain}`);let result=await setupDomain(client,domain,contextName);if(output_manager_default.stopSpinner(),result instanceof NowError)return result;output_manager_default.spinner(`Generating a wildcard certificate for ${domain}`);let cert=await createCertForCns(client,[domain,`*.${domain}`],contextName);if(output_manager_default.stopSpinner(),cert instanceof NowError)return cert}export{generateCertForDeploy as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DDLM6CIQ.js";import"./chunk-MI7W4QMV.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var IMAGE_CONFIG={ls:["ls","list"],inspect:["inspect","get"],rm:["rm","remove","delete"]};async function image(client,argv,telemetry){let{subcommand,args}=getSubcommand(argv,IMAGE_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(IMAGE_CONFIG):`Unknown "vcr image" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image --help"),when:"Show valid image subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr image --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-7DJWHOK4.js")).default(client,args,telemetry);case"inspect":return(await import("./inspect-PQNECP2Z.js")).default(client,args,telemetry);case"rm":return(await import("./rm-SKCAZTYN.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled image subcommand: ${subcommand}`),1}}export{image as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getVltPreloadState,importBuilders,import_import_builders,preloadVltBuilderImports}from"./chunk-PAOR4MQZ.js";import"./chunk-4CACOKMS.js";import"./chunk-3DP66SQ4.js";import"./chunk-5S2NK6K6.js";import"./chunk-JZ7FDBS4.js";import"./chunk-BPUANOGW.js";import"./chunk-KKCBFBJK.js";import"./chunk-25565AGS.js";import"./chunk-MVCAUS4F.js";import"./chunk-FBYA6LLM.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-NWGBDBZI.js";import"./chunk-4SAVH3H7.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var export_formatResolvedBuilders=import_import_builders.formatResolvedBuilders;var export_getBuildersDir=import_import_builders.getBuildersDir;export{export_formatResolvedBuilders as formatResolvedBuilders,export_getBuildersDir as getBuildersDir,getVltPreloadState,importBuilders,preloadVltBuilderImports};
@@ -1,13 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-RRWEIG6B.js";import{resolveAlertsScope}from"./chunk-PTI3TP7P.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{formatDate}from"./chunk-YTDK6AHS.js";import"./chunk-GZNDA6SV.js";import{outputError}from"./chunk-ZQKDO5PL.js";import"./chunk-GHAY4PSD.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{inspectSubcommand}from"./chunk-GVVIFYQE.js";import"./chunk-W3TGCMRW.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-HARXQZV3.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatted} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
8
- `)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
9
- `)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
10
-
11
- `):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
12
- `))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},2),printError(e),2}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveAlertsScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
13
- `):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,reason=err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403?{hint:"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}export{inspect as default};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{actorLabel,displayPath,renderThreadDetail,threadAge,truncate}from"./chunk-GNV6PG6W.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{getThread,handleCommentsParseError,inferBranch,listMessages,listThreads,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-6QRT6USI.js";import{outputError}from"./chunk-ZQKDO5PL.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import"./chunk-F4KY2TOK.js";import"./chunk-ID663OJ7.js";import"./chunk-DRXOTZSJ.js";import"./chunk-VEMJINMZ.js";import{inspectSubcommand}from"./chunk-7NNENHGN.js";import"./chunk-HARXQZV3.js";import"./chunk-BS32OUOC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-GLH4PVMY.js";import"./chunk-XEBMH33W.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-JIGCN5QS.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";async function pickThread(client,jsonOutput){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"MISSING_THREAD","Pass a thread ID or URL: `vercel comments inspect <thread>`.");let scope=await resolveCommentsScope(client,{requireProject:!0,jsonOutput});if(typeof scope=="number")return scope;let focus=scope.linked?inferBranch(client.cwd):void 0;output_manager_default.spinner("Fetching comments\u2026");let response;try{response=await listThreads(client,scope.teamId,{projectId:scope.projectId,status:"unresolved",branch:focus?[focus.value]:void 0,limit:20})}finally{output_manager_default.stopSpinner()}return response.threads.length===0?outputError(client,jsonOutput,"NO_COMMENTS",`No unresolved comments${focus?` on ${focus.value}`:""} to pick from.`):client.input.select({message:"Select a comment",choices:response.threads.map(thread=>({name:`${threadAge(thread)} ${actorLabel(thread.messages[0]?.author)} ${displayPath(thread)} \u201C${truncate(thread.messages[0]?.text??"",48)}\u201D`,value:thread.id}))})}async function fetchAllMessages(client,teamId,thread){if(thread.messageCount<=thread.messages.length)return thread.messages;let all=[],cursor;do{let page=await listMessages(client,teamId,thread.id,{limit:100,cursor});all.push(...page.messages),cursor=page.pagination?.nextCursor}while(cursor&&all.length<thread.messageCount);return all}async function inspect(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"inspect")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,showContext=!!parsedArgs.flags["--context"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagContext(parsedArgs.flags["--context"]),telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let threadInput=parsedArgs.args[2];telemetry.trackCliArgumentThread(threadInput);let threadId,urlTeamSlug;if(threadInput){let parsed=parseThreadArg(threadInput);if(!parsed)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}". Pass the thread ID or its vercel.com URL.`);threadId=parsed.id,urlTeamSlug=parsed.teamSlug}else{let picked=await pickThread(client,jsonOutput);if(typeof picked=="number")return picked;threadId=picked}let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug});if(typeof scope=="number")return scope;jsonOutput||output_manager_default.spinner("Fetching comment\u2026");let thread,messages;try{thread=await getThread(client,scope.teamId,threadId),messages=await fetchAllMessages(client,scope.teamId,thread)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}finally{output_manager_default.stopSpinner()}return jsonOutput?(client.stdout.write(`${JSON.stringify({...thread,messages},null,2)}
8
- `),0):(output_manager_default.print(`${renderThreadDetail(thread,messages,{showContext})}
9
- `),0)}export{inspect as default};