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{RULE_ENVIRONMENTS}from"./chunk-J6O6JW2K.js";import{AGENT_STATUS}from"./chunk-DDLM6CIQ.js";function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
8
- `);return}client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,projectId:project.id,projectName:project.name,...envelope,message,next},null,2)}
9
- `)}var RULE_LIMIT=10,MIN_SAMPLE_RATE=1,MAX_SAMPLE_RATE=100;function isRuleEnvironment(value){return RULE_ENVIRONMENTS.includes(value)}var ENVIRONMENT_ERROR=`\`environment\` must be one of: ${RULE_ENVIRONMENTS.join(", ")}.`,RATE_ERROR=`\`rate\` must be a whole number from ${MIN_SAMPLE_RATE} to ${MAX_SAMPLE_RATE}.`,EMPTY_PATH_ERROR="`requestPath` cannot be empty.";function parseSampleRate(value){if(!/^\d+$/.test(value.trim()))return;let rate=Number(value);return rate>=MIN_SAMPLE_RATE&&rate<=MAX_SAMPLE_RATE?rate:void 0}function toRow(rule){return{environment:rule.env??"any",requestPath:rule.requestPath??null,sampleRate:Math.round(rule.rate*100)}}function toApiRate(sampleRate){return sampleRate/100}function toRule(row){return{type:"head_sampling",rate:toApiRate(row.sampleRate),...row.environment==="any"?{}:{env:row.environment},...row.requestPath===null?{}:{requestPath:row.requestPath}}}var ALL_PATHS_LABEL="(all paths)";function formatPath(requestPath){return requestPath??ALL_PATHS_LABEL}function formatRate(sampleRate){return`${sampleRate}%`}function formatRuleTarget(environment,requestPath){return`${environment} ${formatPath(requestPath)}`}function formatRuleLine(row){return`${formatRuleTarget(row.environment,row.requestPath)} ${formatRate(row.sampleRate)}`}var COMMAND_WORD_COUNT=3;function subcommandArguments(positional){return positional.slice(COMMAND_WORD_COUNT)}function hasSameKey(a,b){return a.environment===b.environment&&a.requestPath===b.requestPath}async function readTracingConfig({client,teamId,projectId,projectName}){let config=await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId}),sampling=config.enabled&&config.sampling.length===0?[{type:"head_sampling",rate:1}]:config.sampling;return{project:{id:projectId,name:projectName},enabled:config.enabled,entries:sampling.map(rule=>({rule,row:toRow(rule)}))}}async function writeSamplingRules({client,teamId,projectId,rules}){await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId,method:"PUT",body:{enabled:rules.length>0,...rules.length>0?{sampling:rules}:{}}})}export{writeConfigJson,RULE_LIMIT,isRuleEnvironment,ENVIRONMENT_ERROR,RATE_ERROR,EMPTY_PATH_ERROR,parseSampleRate,toApiRate,toRule,formatPath,formatRate,formatRuleTarget,formatRuleLine,subcommandArguments,hasSameKey,readTracingConfig,writeSamplingRules};
@@ -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_retry_operation=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry_operation.js"(exports,module){function RetryOperation(timeouts,options){typeof options=="boolean"&&(options={forever:options}),this._timeouts=timeouts,this._options=options||{},this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}module.exports=RetryOperation;RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(err){if(this._timeout&&clearTimeout(this._timeout),!err)return!1;this._errors.push(err);var timeout=this._timeouts.shift();if(timeout===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),timeout=this._timeouts.shift();else return!1;var self=this,timer=setTimeout(function(){self._attempts++,self._operationTimeoutCb&&(self._timeout=setTimeout(function(){self._operationTimeoutCb(self._attempts)},self._operationTimeout),this._options.unref&&self._timeout.unref()),self._fn(self._attempts)},timeout);return this._options.unref&&timer.unref(),!0};RetryOperation.prototype.attempt=function(fn,timeoutOps){this._fn=fn,timeoutOps&&(timeoutOps.timeout&&(this._operationTimeout=timeoutOps.timeout),timeoutOps.cb&&(this._operationTimeoutCb=timeoutOps.cb));var self=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){self._operationTimeoutCb()},self._operationTimeout)),this._fn(this._attempts)};RetryOperation.prototype.try=function(fn){console.log("Using RetryOperation.try() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=function(fn){console.log("Using RetryOperation.start() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var counts={},mainError=null,mainErrorCount=0,i=0;i<this._errors.length;i++){var error=this._errors[i],message=error.message,count=(counts[message]||0)+1;counts[message]=count,count>=mainErrorCount&&(mainError=error,mainErrorCount=count)}return mainError}}});var require_retry=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry.js"(exports){var RetryOperation=require_retry_operation();exports.operation=function(options){var timeouts=exports.timeouts(options);return new RetryOperation(timeouts,{forever:options&&options.forever,unref:options&&options.unref})};exports.timeouts=function(options){if(options instanceof Array)return[].concat(options);var opts={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var key in options)opts[key]=options[key];if(opts.minTimeout>opts.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var timeouts=[],i=0;i<opts.retries;i++)timeouts.push(this.createTimeout(i,opts));return options&&options.forever&&!timeouts.length&&timeouts.push(this.createTimeout(i,opts)),timeouts.sort(function(a,b){return a-b}),timeouts};exports.createTimeout=function(attempt,opts){var random=opts.randomize?Math.random()+1:1,timeout=Math.round(random*opts.minTimeout*Math.pow(opts.factor,attempt));return timeout=Math.min(timeout,opts.maxTimeout),timeout};exports.wrap=function(obj,options,methods){if(options instanceof Array&&(methods=options,options=null),!methods){methods=[];for(var key in obj)typeof obj[key]=="function"&&methods.push(key)}for(var i=0;i<methods.length;i++){var method=methods[i],original=obj[method];obj[method]=function(){var op=exports.operation(options),args=Array.prototype.slice.call(arguments),callback=args.pop();args.push(function(err){op.retry(err)||(err&&(arguments[0]=op.mainError()),callback.apply(this,arguments))}),op.attempt(function(){original.apply(obj,args)})},obj[method].options=options}}}});var require_retry2=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/index.js"(exports,module){module.exports=require_retry()}});var require_dist=__commonJS({"../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js"(exports,module){"use strict";var retrier=require_retry2();module.exports=function(fn,opts){return opts=opts||{},new Promise(function(resolve,reject){var op=retrier.operation(opts),bail=function(err){return reject(err||new Error("Aborted"))},onError=function(err){if(err.bail)return bail(err);op.retry(err)?opts.onRetry&&opts.onRetry(err):reject(op.mainError())};op.attempt(function(num){var val=void 0;try{val=fn(bail,num)}catch(err){return onError(err)}Promise.resolve(val).then(resolve,onError)})})}}});export{require_dist};
@@ -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{canPrompt}from"./chunk-IQ7FPAI4.js";import{require_dist}from"./chunk-WN7EJWN4.js";import{AGENT_REASON,AGENT_STATUS,outputActionRequired}from"./chunk-DDLM6CIQ.js";import{require_lib}from"./chunk-JIGCN5QS.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_client=__toESM(require_dist(),1);import{dirname,isAbsolute,relative,sep}from"path";var singleFileConfig={framework:null,buildCommand:"",installCommand:"",outputDirectory:"."},singleFileProjectSettings={...singleFileConfig,rootDirectory:null};async function isIgnoredFile(file,cwd){let roots=new Set([dirname(file)]),fromCwd=relative(cwd,file);fromCwd&&!fromCwd.startsWith(`..${sep}`)&&!isAbsolute(fromCwd)&&roots.add(cwd);for(let root of roots){let{ig}=await(0,import_client.getVercelIgnore)(root);if(ig.ignores(relative(root,file).split(sep).join("/")))return!0}return!1}var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep as sep2}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep2)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths,{allowFiles=!1}={}){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);if(!pathStat)return output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1};let isFile=pathStat.isFile();if(!pathStat.isDirectory()&&!(allowFiles&&isFile))return output_manager_default.fatal(allowFiles?"Deploy a regular file or directory. Symbolic links and special files are not supported as deployment paths.":"This command requires a directory. Use `vercel <file>` to deploy a single file."),{valid:!1,exitCode:1};if(path===homedir()){if(!canPrompt(client)){let message="Can't deploy your home directory without interactive confirmation. Run from your project directory, or run in a terminal to confirm deploying your home directory.";return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.INTERACTIVE_CONFIRMATION_REQUIRED,message,userActionRequired:!0},2),output_manager_default.error(message),{valid:!1,exitCode:2}}if(!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1))return output_manager_default.print(`Canceled
8
- `),{valid:!1,exitCode:0}}return{valid:!0,path,isFile}}export{singleFileConfig,singleFileProjectSettings,isIgnoredFile,validateRootDirectory,validatePaths};
@@ -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
- function getCommandFlags(argv,excludeFlags=[]){let flags=Object.keys(argv).filter(key=>!excludeFlags.includes(key)).map(key=>`${key}${typeof argv[key]!="boolean"?" "+argv[key]:""}`);return flags.length>0?` ${flags.join(" ")}`:""}export{getCommandFlags};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- var PromptCanceledError=class extends Error{constructor(){super("Prompt canceled"),this.name="PromptCanceledError"}},PromptBackError=class extends Error{constructor(){super("Prompt back"),this.name="PromptBackError"}};function isPromptBackError(error){return error instanceof PromptBackError}function isPromptCanceledError(error){return error instanceof PromptCanceledError?!0:error instanceof Error&&error.message.includes("User force closed the prompt")}export{PromptCanceledError,PromptBackError,isPromptBackError,isPromptCanceledError};
@@ -1,39 +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{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-DDLM6CIQ.js";import{printAlignedLabel}from"./chunk-IJCCFLCQ.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Rule ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
8
- ${renderAlertTable(rows,2)}
9
- `)}function commonRows(rule){return[["Name",rule.name],["Rule ID",rule.id],["Type",rule.type],["Scope",formatPublicRuleScope(rule)],["Default",formatBoolean(rule.isDefault)],...rule.createdAt?[["Created",formatDate(rule.createdAt)]]:[],...rule.updatedAt?[["Updated",formatDate(rule.updatedAt)]]:[]]}function notificationRows(rule){return[["Team owner notifications",formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)],...rule.notificationSettings.incidentIoRoutingKey?[["Incident.io routing key",rule.notificationSettings.incidentIoRoutingKey]]:[]]}function printBuiltInRule(rule){output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
10
-
11
- `),rule.triggers.mode==="all"?output_manager_default.print(`${renderAlertTable([["Minimum severity",rule.matchMinimumSeverityLevel],["Triggers","all built-in triggers"]],3)}
12
- `):output_manager_default.print(`${renderAlertTable([["Minimum severity",rule.matchMinimumSeverityLevel]],3)}
13
-
14
- ${renderAlertTable([["Trigger","Filter"].map(header=>import_chalk.default.cyan(header)),...rule.triggers.items.map(trigger=>[trigger.type,trigger.filter||"-"])],3)}
15
- `)}function metricRows(rule){return Object.entries(rule.evaluation.query.metrics).map(([alias,metric])=>[alias,metric.metric,metric.aggregation,[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.join(", ")].filter(Boolean).join("; ")||"-",metric.filter||"-"])}function printCustomRule(rule){if(output_manager_default.print(`${import_chalk.default.cyan("Custom alert")}
16
-
17
- `),!rule.querySupported){output_manager_default.print(` Query unavailable via API. You can update metadata, delete the rule, or recreate it with a supported query.
18
- `),output_manager_default.print(`
19
- ${renderAlertTable([["Severity",rule.severity]],3)}
20
- `);return}let query=rule.evaluation.query;output_manager_default.print(`${renderAlertTable([["Severity",rule.severity],["Window",rule.evaluation.window],["Output",query.outputs[0]],...query.formulas?Object.entries(query.formulas).map(([alias,formula])=>[`Formula ${alias}`,formula]):[],...query.groupBy?.length?[["Group By",query.groupBy.join(", ")]]:[],...query.filter?[["Query Filter",query.filter]]:[]],3)}
21
- `),output_manager_default.print(`
22
- ${import_chalk.default.cyan("Metrics")}
23
-
24
- `),output_manager_default.print(`${renderAlertTable([["Alias","Metric","Aggregation","Modifiers","Filter"].map(header=>import_chalk.default.cyan(header)),...metricRows(rule)],3)}
25
- `),output_manager_default.print(`
26
- ${import_chalk.default.cyan("Trigger")}
27
-
28
- `),output_manager_default.print(`${renderAlertTable([["Type",rule.trigger.type],["Output",rule.trigger.output],...rule.trigger.type==="threshold"?[["Operator",rule.trigger.operator],["Threshold",String(rule.trigger.threshold)]]:[["Standard Deviations",String(rule.trigger.standardDeviations)]],...rule.trigger.minimum?[["Minimum Output",rule.trigger.minimum.output],["Minimum Threshold",String(rule.trigger.minimum.threshold)]]:[]],3)}
29
- `)}function printRule(rule){output_manager_default.print(`
30
- ${import_chalk.default.bold("Alert rule")} ${import_chalk.default.cyan(rule.id)}
31
- ${renderAlertTable(commonRows(rule),3)}
32
-
33
- ${import_chalk.default.cyan("Notifications")}
34
-
35
- ${renderAlertTable(notificationRows(rule),3)}
36
-
37
- `),rule.type==="built-in"?printBuiltInRule(rule):printCustomRule(rule)}function printRulePreview(rule){printAlignedLabel("Name",rule.name),printAlignedLabel("Rule ID",rule.id),printAlignedLabel("Type",rule.type),printAlignedLabel("Scope",formatPublicRuleScope(rule))}function printRuleDeletionReceipt(ruleId){output_manager_default.print(`
38
- `),printAlignedLabel("Deleted",ruleId,{gutter:"\u2713"})}function printRuleMutationReceipt(action,rule,argv){output_manager_default.print(`
39
- `),printAlignedLabel(action,rule.name,{gutter:"\u2713"}),printAlignedLabel("Rule ID",rule.id),printAlignedLabel("Type",rule.type),printAlignedLabel("Scope",formatPublicRuleScope(rule)),action!=="Deleted"&&printAlignedLabel("Inspect",buildCommandWithGlobalFlags(argv,`alerts rules inspect ${quoteArg(rule.id)}`))}export{printRules,printRule,printRulePreview,printRuleDeletionReceipt,printRuleMutationReceipt};
@@ -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{homedir}from"os";import{resolve}from"path";function humanizePath(path){let resolved=resolve(path),_homedir=homedir();return resolved.indexOf(_homedir)===0?`~${resolved.slice(_homedir.length)}`:resolved}export{humanizePath};
@@ -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,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (defaults to the linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Continue from a previous response",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"rm",aliases:["remove"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app rm team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app rm team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app rm team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{require_dist,require_dist2}from"./chunk-5S2NK6K6.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{require_build_utils}from"./chunk-M774HRX5.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.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),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["schedule"],properties:{name:{type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}for(let[index,schedule]of(config.schedules??[]).entries())if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!/(docker|container)file/i.test(daemon.entrypoint.split(/[\\/]/).pop()??""))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
@@ -1,20 +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{events_default}from"./chunk-3NNH2U5M.js";import{require_dist as require_dist2}from"./chunk-WN7EJWN4.js";import{progress}from"./chunk-U56NHYAH.js";import{isJSONObject,printIndications}from"./chunk-V3RDOM3U.js";import{require_dist as require_dist3}from"./chunk-O4FDRZ22.js";import{sleep}from"./chunk-T3GQAMBJ.js";import{suggestNextCommands}from"./chunk-YROIQRYI.js";import{deprecatedArchiveSplitTgz}from"./chunk-MYHJNSCW.js";import{responseError}from"./chunk-HARXQZV3.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{TelemetryClient}from"./chunk-KUGXOLL7.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{ua_default}from"./chunk-AOWWC6WZ.js";import{fetch,getFetchDispatcher}from"./chunk-MY4MONOH.js";import{withGlobalFlags}from"./chunk-DDLM6CIQ.js";import{getProjectByNameOrId}from"./chunk-JIGCN5QS.js";import{printAlignedLabel}from"./chunk-IJCCFLCQ.js";import{APIError,BuildError,require_bytes}from"./chunk-XSDAUM4F.js";import{emoji,eraseLines,link_default,output_manager_default,prependEmoji}from"./chunk-M774HRX5.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function printPrebuiltFilePathMapIgnoreWarning(message,telemetry){telemetry.trackPrebuiltFilePathMapWouldFailClosed();let[first="",...rest]=message.split(`
8
- `);output_manager_default.print(`${import_chalk.default.yellow("!")} ${first}
9
- `);for(let line of rest)output_manager_default.print(`${line&&!/^\s/.test(line)?` ${line}`:line}
10
- `)}var import_types=__toESM(require_types(),1),DeployTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(projectPaths){projectPaths&&this.trackCliArgument({arg:"project-path",value:this.redactedValue})}trackCliOptionArchive(format){if(format){let allowedFormat=[...import_types.VALID_ARCHIVE_FORMATS,deprecatedArchiveSplitTgz].includes(format)?format:this.redactedValue;this.trackCliOption({option:"archive",value:allowedFormat})}}trackCliFlagTurbo(turbo){turbo&&this.trackCliFlag("turbo")}trackCliOptionBuildEnv(buildEnv){buildEnv&&buildEnv.length>0&&this.trackCliOption({option:"build-env",value:this.redactedValue})}trackCliOptionEnv(env){env&&env.length>0&&this.trackCliOption({option:"env",value:this.redactedValue})}trackCliOptionMeta(meta){meta&&meta.length>0&&this.trackCliOption({option:"meta",value:this.redactedValue})}trackCliOptionName(name){name&&this.trackCliOption({option:"name",value:this.redactedValue})}trackCliOptionRegions(regions){regions&&this.trackCliOption({option:"regions",value:this.redactedValue})}trackCliOptionTarget(target){target&&this.trackCliOption({option:"target",value:this.redactedTargetName(target)})}trackCliFlagConfirm(flag){flag&&this.trackCliFlag("confirm")}trackCliFlagForce(flag){flag&&this.trackCliFlag("force")}trackCliFlagLogs(flag){flag&&this.trackCliFlag("logs")}trackCliFlagNoLogs(flag){flag&&this.trackCliFlag("no-logs")}trackCliFlagGuidance(flag){flag&&this.trackCliFlag("guidance")}trackCliFlagNoClipboard(flag){flag&&this.trackCliFlag("no-clipboard")}trackCliFlagNoWait(flag){flag&&this.trackCliFlag("no-wait")}trackCliFlagDry(flag){flag&&this.trackCliFlag("dry")}trackCliFlagPrebuilt(flag){flag&&this.trackCliFlag("prebuilt")}trackCliSubcommandInit(actual){this.trackCliSubcommand({subcommand:"init",value:actual})}trackCliSubcommandContinue(actual){this.trackCliSubcommand({subcommand:"continue",value:actual})}trackCliSubcommandDescribe(actual){this.trackCliSubcommand({subcommand:"describe",value:actual})}trackCliFlagProd(flag){flag&&this.trackCliFlag("prod")}trackCliFlagTemporary(flag){flag&&this.trackCliFlag("temporary")}trackTargetEnvironment(target){super.trackTargetEnvironment(target==="production"?"production":"preview")}trackCliFlagPublic(flag){flag&&this.trackCliFlag("public")}trackCliFlagSkipDomain(flag){flag&&this.trackCliFlag("skip-domain")}trackCliFlagWithCache(flag){flag&&this.trackCliFlag("with-cache")}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagJson(flag){flag&&this.trackCliFlag("json")}trackCliOptionFormat(format){format&&this.trackCliOption({option:"format",value:format})}trackDeploymentId(id){id&&this.trackCommandOutput({key:"deployment-id",value:id})}trackPrebuiltFilePathMapWouldFailClosed(){this.trackCommandOutput({key:"prebuilt-filepathmap-would-fail-closed",value:"TRUE"})}};var import_client=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),import_bytes=__toESM(require_bytes(),1),import_chalk2=__toESM(require_source(),1);function printInspectUrl(inspectorUrl){inspectorUrl&&printAlignedLabel("Inspect",import_chalk2.default.cyan(inspectorUrl))}async function processDeployment({org,projectName,isSettingUpProject,archive,skipAutoDetectionConfirmation,noWait,withFullLogs,anonymous,manual,jsonOutput,linkedProject,linkedProjectIsPartial,gitMetadata,...args}){let{now,path,requestBody,force,withCache,quiet,prebuilt,vercelOutputDir,rootDirectory,bulkRedirectsPath}=args,client=now._client,telemetry=new DeployTelemetryClient({opts:{store:client.telemetryEventStore}}),aliasedRowWillPrint=!noWait&&requestBody.autoAssignCustomDomains!==!1,{env={}}=requestBody;await client.ensureAuthorized();let token=now._token;if(!token)throw new Error("Missing authentication token");let aliasAssignedController=new AbortController,onAliasAssigned=event=>{aliasAssignedController.abort(event)},clientOptions={teamId:now.currentTeam??void 0,apiUrl:now._apiUrl,token,debug:output_manager_default.isDebugEnabled(),userAgent:ua_default,path,force,withCache,prebuilt,vercelOutputDir,rootDirectory,skipAutoDetectionConfirmation,archive,dispatcher:getFetchDispatcher(),projectName,bulkRedirectsPath,manual,aliasAssignedSignal:aliasAssignedController.signal},deployingSpinnerVal=isSettingUpProject?"Setting up project":`Deploying ${import_chalk2.default.bold(org.slug?`${org.slug}/${projectName}`:projectName)}`;output_manager_default.spinner(deployingSpinnerVal,0);let indications=[],prebuiltFilePathMapWarning,attachPrebuiltFilePathMapWarning=payload=>(prebuiltFilePathMapWarning&&Object.assign(payload,{warning:prebuiltFilePathMapWarning}),payload),abortController;function stopSpinner(){abortController?.abort(),output_manager_default.stopSpinner()}let linkedProjectLookup=linkedProjectIsPartial&&linkedProject&&!noWait?getProjectByNameOrId(client,linkedProject.id,linkedProject.accountId).then(project2=>({project:project2}),error=>({error})):void 0,rollingRelease=linkedProject?.rollingRelease,project=linkedProjectLookup?void 0:linkedProject,latestLogMessage="";async function resolveProject(){if(!linkedProjectLookup)return getProjectByNameOrId(client,projectName);let result=await linkedProjectLookup;if("error"in result)throw result.error;return result.project}try{let deploymentOptions=Promise.resolve(gitMetadata).then(gitMetadata2=>({...requestBody,...gitMetadata2===void 0?{}:{gitMetadata:gitMetadata2}}));for await(let event of(0,import_client.createDeployment)(clientOptions,deploymentOptions)){if(event.type==="warning"&&"code"in event&&event.code==="PREBUILT_FILEPATHMAP_IGNORED"){let message=String(event.payload);prebuiltFilePathMapWarning={code:"PREBUILT_FILEPATHMAP_IGNORED",message},printPrebuiltFilePathMapIgnoreWarning(message,telemetry),client.stderr.isTTY&&output_manager_default.spinner(deployingSpinnerVal,0);continue}if(["tip","notice","warning"].includes(event.type)&&indications.push(event),event.type==="file-count"){let{total,missing,uploads}=event.payload;output_manager_default.debug(`Total files ${total.size}, ${missing.length} changed`);let missingSize=missing.map(sha=>{let file=total.get(sha);return file?.data?.length??file?.size??0}).reduce((a,b)=>a+b,0),totalSizeHuman=import_bytes.default.format(missingSize,{decimalPlaces:1}),nextStep=0,stepSize=now._client.stderr.isTTY?0:.25,updateProgress=()=>{let uploadedBytes=uploads.reduce((acc,e)=>acc+e.bytesUploaded,0),bar=progress(uploadedBytes,missingSize);if(!bar)output_manager_default.spinner(deployingSpinnerVal,0);else{let uploadedHuman=import_bytes.default.format(uploadedBytes,{decimalPlaces:1,fixedDecimals:!0});uploadedBytes/missingSize>=nextStep&&(output_manager_default.spinner(`Uploading ${import_chalk2.default.reset(`[${bar}] (${uploadedHuman}/${totalSizeHuman})`)}`,0),nextStep+=stepSize)}};uploads.forEach(e=>e.on("progress",updateProgress)),updateProgress()}if(event.type==="file-uploaded"){let{file}=event.payload;output_manager_default.debug(`Uploaded: ${file.names.join(" ")} (${(0,import_bytes.default)(file.data?.length??file.size??0)})`)}if(event.type==="created"){let deployment=event.payload;if(now.url=deployment.url,stopSpinner(),!anonymous){printInspectUrl(deployment.inspectorUrl);let isProdDeployment=deployment.target==="production",previewUrl=`https://${deployment.url}`;isProdDeployment&&!requestBody.target&&indications.push({type:"notice",payload:"This is your project\u2019s first deployment, so it was assigned to production. Future deployments will be preview deployments unless you use --prod.",link:"https://vercel.com/docs/deployments/environments"}),printAlignedLabel(isProdDeployment?"Production":"Preview",import_chalk2.default.cyan(previewUrl),isProdDeployment&&!aliasedRowWillPrint?{gutter:"\u25B2"}:{}),!jsonOutput&&(quiet||process.env.FORCE_TTY==="1")&&process.stdout.write(`https://${event.payload.url}`)}if(noWait)return deployment.indications=indications,attachPrebuiltFilePathMapWarning(deployment);if(latestLogMessage=deployment.readyState==="QUEUED"?"Queued\u2026":"Building\u2026",withFullLogs&&!anonymous){let{displayBuildLogs}=await import("./logs-XEJPLFXM.js"),promise;({abortController,promise}=displayBuildLogs(client,deployment,!0,onAliasAssigned)),promise.catch(error=>output_manager_default.warn(`Failed to read build logs: ${error}`))}else if(!anonymous){let{parseLogLines}=await import("./logs-XEJPLFXM.js");abortController=new AbortController,events_default(client,deployment.id,{mode:"logs",onAliasAssigned,onEvent:event2=>{if(!event2.created)return;let message=parseLogLines(event2)[0];message&&(latestLogMessage=message,output_manager_default.spinner(latestLogMessage,0))},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController).catch(error=>output_manager_default.warn(`Failed to read build logs: ${error}`))}output_manager_default.spinner(latestLogMessage,0)}if(event.type==="building"&&!withFullLogs&&output_manager_default.spinner(latestLogMessage||"Building\u2026",0),event.type==="canceled")return stopSpinner(),attachPrebuiltFilePathMapWarning(event.payload);if(project===void 0&&(!linkedProjectLookup||event.type==="ready")&&(project=await resolveProject(),rollingRelease=project?.rollingRelease),event.type==="ready"&&rollingRelease)return output_manager_default.spinner("Releasing\u2026",0),stopSpinner(),event.payload.indications=indications,attachPrebuiltFilePathMapWarning(event.payload);if(event.type==="ready"&&!withFullLogs){let v1ChecksPending=event.payload.checksState&&event.payload.checksState!=="completed",v2ChecksPending=event.payload.checks?.["deployment-alias"]?.state==="pending";if(output_manager_default.stopSpinner(),!anonymous){process.stderr.write(eraseLines(2));let isProdDeployment=event.payload.target==="production",previewUrl=`https://${event.payload.url}`;printAlignedLabel(isProdDeployment?"Production":"Preview",import_chalk2.default.cyan(previewUrl),isProdDeployment&&!aliasedRowWillPrint?{gutter:"\u25B2"}:{})}v1ChecksPending||v2ChecksPending?output_manager_default.spinner("Running Checks\u2026",0):output_manager_default.spinner("Completing\u2026",0)}if(event.type==="checks-running"&&!withFullLogs&&output_manager_default.spinner("Running Checks\u2026",0),event.type==="checks-conclusion-failed"||event.type==="checks-v2-failed")return stopSpinner(),attachPrebuiltFilePathMapWarning(event.payload);if(event.type==="error"){if(stopSpinner(),!archive){let maybeError=handleErrorSolvableWithArchive(event.payload);if(maybeError)throw maybeError}let error=await now.handleDeploymentError(event.payload,{env});if(error.code==="missing_project_settings"||error.code==="forbidden")return error;throw error}if(event.type==="alias-assigned"){if(stopSpinner(),event.payload.target==="production"&&event.payload.alias&&event.payload.alias.length>0){let prodUrl=`https://${event.payload.alias[0]}`;anonymous&&output_manager_default.print(`
11
- `),printAlignedLabel(anonymous?"Temporary":"Aliased",import_chalk2.default.cyan(prodUrl),{gutter:"\u25B2"}),anonymous&&!jsonOutput&&(quiet||process.env.FORCE_TTY==="1")&&process.stdout.write(prodUrl)}return event.payload.indications=indications,attachPrebuiltFilePathMapWarning(event.payload)}}}catch(err){throw stopSpinner(),err}}var archiveSuggestionText="Try using `--archive=tgz` to limit the amount of files you upload.",UploadErrorMissingArchive=class extends Error{constructor(){super(...arguments);this.link="https://vercel.com/docs/cli/deploy#archive"}};function handleErrorSolvableWithArchive(error){if((0,import_error_utils.isErrorLike)(error)){let isUploadRateLimit="errorName"in error&&typeof error.errorName=="string"&&error.errorName.startsWith("api-upload-"),isTooManyFilesLimit="code"in error&&error.code==="too_many_files",isEntityTooLarge=/entity too large|payload too large/i.test(error.message);if(isUploadRateLimit||isTooManyFilesLimit||isEntityTooLarge)return new UploadErrorMissingArchive(`${error.message}
12
- ${archiveSuggestionText}`)}}var import_async_retry=__toESM(require_dist3(),1),import_ms=__toESM(require_ms(),1);import qs from"querystring";import{parse as parseUrl}from"url";var import_bytes2=__toESM(require_bytes(),1),import_chalk3=__toESM(require_source(),1);var Now=class{constructor({client,url=null,currentTeam=null,forceNew=!1,withCache=!1}){this.url=url,this._client=client,this._forceNew=forceNew,this._withCache=withCache,this._onRetry=this._onRetry.bind(this),this.currentTeam=currentTeam}get _apiUrl(){return this._client.apiUrl}get _token(){return this._client.authConfig.token}async create(path,{nowConfig={},name,project,prebuilt=!1,anonymous=!1,vercelOutputDir,rootDirectory,meta,gitMetadata,regions,quiet=!1,env,build,buildMachine,forceNew=!1,withCache=!1,target=null,projectSettings,skipAutoDetectionConfirmation,noWait,withFullLogs,autoAssignCustomDomains,agentName,manual,jsonOutput=!1,linkedProject,linkedProjectIsPartial},org,isSettingUpProject,archive){let requestBody={...nowConfig,env,build,buildMachine,name,project,meta,regions,target:target||void 0,projectSettings,source:"cli",actor:agentName,autoAssignCustomDomains};delete requestBody.scope,delete requestBody.github,delete requestBody.public;let deployment=await processDeployment({now:this,path,requestBody,gitMetadata,quiet,force:forceNew,withCache,org,projectName:name,isSettingUpProject,archive,skipAutoDetectionConfirmation,prebuilt,anonymous,vercelOutputDir,rootDirectory,noWait,withFullLogs,bulkRedirectsPath:nowConfig.bulkRedirectsPath,manual,jsonOutput,linkedProject,linkedProjectIsPartial});if(deployment&&deployment.warnings){let sizeExceeded=0,{log,warn}=output_manager_default;deployment.warnings.forEach(warning=>{if(warning.reason==="size_limit_exceeded"){let{sha,limit}=warning;warn(`Skipping file ${sha} (size exceeded ${(0,import_bytes2.default)(limit)})`),sizeExceeded++}else warning.reason==="node_version_not_found"&&warn(`Requested node version ${warning.wanted} is not available`)}),sizeExceeded>0&&(warn(`${sizeExceeded} of the files exceeded the limit for your plan.`),log(`Please upgrade your plan here: ${import_chalk3.default.cyan("https://vercel.com/account/plan")}`))}return deployment}async handleDeploymentError(error,{env}){if(error.status===429){if(error.code==="builds_rate_limited"){let err2=new Error(error.message);return err2.status=error.status,err2.code=error.code,err2.retryAfterMs="never",err2.ctaLabel=error.ctaLabel,err2.ctaUrl=error.ctaUrl,err2.action=error.action,err2.link=error.link,err2}let msg="You have been creating deployments at a very fast pace. ";if(error.limit&&error.limit.reset){let{reset}=error.limit,difference=reset-Date.now();msg+=`Please retry in ${(0,import_ms.default)(difference,{long:!0})}.`}else msg+="Please slow down.";let err=Object.create(APIError.prototype);return err.message=msg,err.status=error.status,err.retryAfterMs="never",err}if(error.status===400&&error.code==="cert_missing")return responseError(error,null,error);if(error.status===400&&error.code==="missing_files")return this._missing=error.missing||[],error;if(error.status===404&&error.code==="not_found")return error;if(error.status>=400&&error.status<500){let err=new Error,{code}=error;if(code==="env_value_invalid_type"){let{key}=error;err.message=`The env key ${key} has an invalid type: ${typeof env[key]}. Please supply a String or a Number (https://err.sh/vercel/env-value-invalid-type)`}else Object.assign(err,error);return err}return error.id&&error.id.startsWith("bld_")?new BuildError({message:"Build failed",meta:{entrypoint:error.entrypoint}}):error.errorCode==="BUILD_FAILED"||error.errorCode==="UNEXPECTED_ERROR"||error.errorCode?.includes("BUILD_UTILS_SPAWN_")?new BuildError({message:error.errorMessage,meta:{}}):new Error(error.message||error.errorMessage)}async remove(deploymentId,{hard=!1}){let url=`/now/deployments/${deploymentId}?hard=${hard?1:0}`;return await this.retry(async bail=>{let res=await this._fetch(url,{method:"DELETE"});if(res.status!==200){let error=await responseError(res,"Failed to remove deployment");if(typeof error.retryAfterMs=="number"){let randomSkewMs=3e4*Math.random();throw await sleep(error.retryAfterMs+randomSkewMs),error}if(res.status>200&&res.status<500)return bail(error);throw error}}),!0}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}_onRetry(err){output_manager_default.debug(`Retrying: ${err}
13
- ${err.stack}`)}async _fetch(_url,opts={}){if(opts.useCurrentTeam!==!1&&this.currentTeam){let parsedUrl=parseUrl(_url,!0),query=parsedUrl.query;query.teamId=this.currentTeam,_url=`${parsedUrl.pathname}?${qs.stringify(query)}`,delete opts.useCurrentTeam}opts.headers=new globalThis.Headers(opts.headers),opts.headers.set("accept","application/json"),this._token&&opts.headers.set("authorization",`Bearer ${this._token}`),opts.headers.set("user-agent",ua_default);let body;isJSONObject(opts.body)?(body=JSON.stringify(opts.body),opts.headers.set("content-type","application/json; charset=utf8")):body=opts.body;let res=await output_manager_default.time(`${opts.method||"GET"} ${this._apiUrl}${_url} ${opts.body||""}`,fetch(`${this._apiUrl}${_url}`,{...opts,body}));return printIndications(res),res}async fetch(url,opts={}){return this.retry(async bail=>{opts.json!==!1&&opts.body&&typeof opts.body=="object"&&(opts=Object.assign({},opts,{body:JSON.stringify(opts.body),headers:Object.assign({},opts.headers,{"Content-Type":"application/json"})}));let res=await this._fetch(url,opts);if(res.ok)return opts.json===!1?res:res.headers.get("content-type")?res.headers.get("content-type")?.includes("application/json")?res.json():res:null;let err=await responseError(res);if(typeof err.retryAfterMs=="number"){let randomSkewMs=3e4*Math.random();throw await sleep(err.retryAfterMs+randomSkewMs),err}if(res.status>=400&&res.status<500)return bail(err);throw err},opts.retry)}};function getBuildMachineResourceConfig(deployment){let buildMachine=deployment.resourceConfig?.buildMachine;if(!buildMachine)return;let fields={cores:buildMachine.cores,memory:buildMachine.memory,machine:buildMachine.purchaseType,selectionType:buildMachine.machineSelectionType,selectionSource:buildMachine.selectionSource};return Object.values(fields).some(value=>value!==void 0)?fields:void 0}function getProductionUrl(deployment){if(deployment.target!=="production"||!deployment.aliasAssigned||deployment.aliasError)return null;let domain=deployment.alias?.[0];return domain?`https://${domain}`:null}var import_chalk4=__toESM(require_source(),1),import_strip_ansi=__toESM(require_strip_ansi(),1);var deploymentInProgressStates=["QUEUED","BUILDING","INITIALIZING"];function isDeploying(readyState){return deploymentInProgressStates.includes(readyState)}function bareDuration(stamp){return(0,import_strip_ansi.default)(stamp).replace(/^\[|\]$/g,"")}async function printDeploymentStatus(client,{readyState,alias,aliasAssigned,aliasError,indications,aliasWarning,url,target},deployStamp,noWait,guidanceMode,isInit,gitConnectCommand,protectionNames){indications=indications||[];let isStillBuilding=!1;if(noWait&&isDeploying(readyState)){isStillBuilding=!0;let message=isInit?"Deployment is awaiting continuation\u2026":"Note: Deployment is still processing\u2026";output_manager_default.print(prependEmoji(message,emoji("notice"))+`
14
- `)}if(!isStillBuilding&&readyState!=="READY")return output_manager_default.error("Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error"),1;if(!isStillBuilding&&readyState==="READY"){let duration=bareDuration(deployStamp());output_manager_default.print(`
15
- ${import_chalk4.default.green("\u2713")} ${import_chalk4.default.bold("Ready")} ${import_chalk4.default.dim(`in ${duration}`)}
16
- `)}protectionNames?.length&&output_manager_default.print(`
17
- ${import_chalk4.default.yellow("!")} Deployment Protection is on for this project (${protectionNames.join(", ")}). Use ${import_chalk4.default.cyan("`vercel curl`")} to access it.
18
- `),aliasError&&output_manager_default.warn(`Failed to assign aliases${aliasError.message?`: ${aliasError.message}`:""}`),aliasWarning?.message&&indications.push({type:"warning",payload:aliasWarning.message,link:aliasWarning.link,action:aliasWarning.action});let newline=`
19
- `;for(let indication of indications){let message=prependEmoji(import_chalk4.default.dim(indication.payload),emoji(indication.type))+newline,link="";indication.link&&(link=import_chalk4.default.dim(`${indication.action||"Learn More"}: ${link_default(indication.link)}`)+newline),output_manager_default.print(message+link)}if(gitConnectCommand||guidanceMode){output_manager_default.print(`
20
- `);let nextCommands=[];if(gitConnectCommand&&nextCommands.push({description:"Automatically deploy changes on every push by connecting Git",command:gitConnectCommand}),readyState==="READY"){let productionUrl=getProductionUrl({target,alias,aliasAssigned,aliasError});nextCommands.push({description:productionUrl?"Check the production response":"Check the deployment response",command:withGlobalFlags(client,`curl ${productionUrl??`https://${url}`}`,{preserveProject:!0})}),nextCommands.push({description:"View build logs",command:withGlobalFlags(client,`inspect ${url} --logs`,{preserveProject:!0})},{description:"Create a new deployment from the same source",command:withGlobalFlags(client,`redeploy ${url}`,{preserveProject:!0})}),target!=="production"&&nextCommands.push({description:"Deploy the current project to production",command:withGlobalFlags(client,"deploy --prod",{preserveProject:!0})})}else nextCommands.push({description:"Check deployment status",command:withGlobalFlags(client,`inspect ${url}`,{preserveProject:!0})});suggestNextCommands(nextCommands)}return 0}export{printPrebuiltFilePathMapIgnoreWarning,DeployTelemetryClient,UploadErrorMissingArchive,Now,getBuildMachineResourceConfig,isDeploying,getProductionUrl,printDeploymentStatus};
@@ -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{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-JIGCN5QS.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){throwIfAborted(signal);let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,isGlobal,getUpdateCommandInfo,getUpdateCommand};
@@ -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{allOption,confirmOption,formatOption,jsonOption,limitOption,nextOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var listCommand={name:"list",aliases:["ls"],description:"List deployments.",arguments:[{name:"app",required:!1}],options:[allOption,{name:"meta",description:"Filter deployments by metadata (e.g.: `-m KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:"m",type:[String],deprecated:!1},{name:"policy",description:"See deployments with provided Deployment Retention policies (e.g.: `-p KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"",argument:"TARGET",shorthand:null,type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:"s",type:String,deprecated:!1},nextOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!1},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list -m key1=value1 -m key2=value2`},{name:"Paginate deployments for a project, where `1584722256178` is the time in milliseconds since the UNIX epoch",value:`${packageName} list my-app --next 1584722256178`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
@@ -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,projectOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (defaults to the linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Continue from a previous response",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};
@@ -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{jsonOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"search",description:"Search by name, description, source, or destination",shorthand:"s",type:String,argument:"QUERY",deprecated:!1},{name:"filter",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:"f",type:String,argument:"TYPE",deprecated:!1},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"version-id",description:"List routes from a specific version ID",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!1},{name:"diff",description:"Compare staged changes against production. Use with --version-id to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --search "api"`},{name:"Filter by type",value:`${packageName} routes list --filter rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{name:"count",description:"Number of versions to fetch (default: 20, max: 100)",shorthand:null,type:Number,argument:"NUMBER",deprecated:!1}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --count 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex (default), path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"disabled",description:"Create route in disabled state",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"delete",aliases:["rm"],description:"Delete one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when deleting"}],examples:[{name:"Delete a route by name",value:`${packageName} routes delete "Old Redirect"`},{name:"Delete a route by ID",value:`${packageName} routes delete abc123`},{name:"Delete multiple routes",value:`${packageName} routes delete "Route A" "Route B"`},{name:"Delete without confirmation",value:`${packageName} routes delete "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"reorder",aliases:["move"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when reordering"}],examples:[{name:"Move to first position",value:`${packageName} routes reorder "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes reorder "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes reorder "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes reorder "API Proxy" --position after:route-id-123`},{name:"Interactive reorder (prompts for position)",value:`${packageName} routes reorder "API Proxy"`}]},editSubcommand={name:"update",aliases:["edit"],description:"Update an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes update "API Proxy"`},{name:"Update with AI",value:`${packageName} routes update "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes update "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes update "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes update "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes update "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json (default) or .ts",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
@@ -1,20 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{require_dist as require_dist2}from"./chunk-O4FDRZ22.js";import{sleep}from"./chunk-T3GQAMBJ.js";import{PromptBackError,PromptCanceledError}from"./chunk-P2O5DOYE.js";import{persistAuthConfig,writeToConfigFile}from"./chunk-GLH4PVMY.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{isOAuthError,processTokenResponse,refreshTokenRequest,ua_default}from"./chunk-AOWWC6WZ.js";import{fetch}from"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{APIError}from"./chunk-XSDAUM4F.js";import{emoji,link_default,output_manager_default,prependEmoji}from"./chunk-M774HRX5.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk2=__toESM(require_source(),1),import_cli_config=__toESM(require_cli_config(),1),import_async_retry=__toESM(require_dist2(),1);import{join,resolve}from"node:path";import{EventEmitter}from"events";import{URL}from"url";async function responseError(res,fallbackMessage=null,parsedBody={}){let bodyError;if(!res.ok){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||body}let msg=bodyError?.message||fallbackMessage||"Response Error";return new APIError(msg,res,bodyError)}var import_chalk=__toESM(require_source(),1);function printIndications(res){let indications=new Set(["warning","notice","tip"]),regex=/^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;for(let[name,payload]of res.headers){let match=name.match(regex);if(match){let[,type,identifier]=match,action=res.headers.get(`x-vercel-action-${identifier}`),link=res.headers.get(`x-vercel-link-${identifier}`);if(indications.has(type)){let newline=`
8
- `,message=prependEmoji(import_chalk.default.dim(payload),emoji(type))+newline,finalLink="";link&&(finalLink=import_chalk.default.dim(`${action||"Learn More"}: ${link_default(link)}`)+newline),output_manager_default.print(message+finalLink)}}}}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils=__toESM(require_dist(),1);var TEAM_NOT_CHOSEN="",DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-4SGT475I.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk2.bold)(error.scope)} scope`),error});this._onRetry=error=>{output_manager_default.debug(`Retrying: ${error}
9
- ${error.stack}`)};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.savedTeam=opts.config.currentTeam,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.ignoresSavedTeam=this.isAgent&&this.nonInteractive,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk2.gray)("?"),style:{answer:import_chalk2.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-IF453UWS.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-LABWDJ72.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-BYG5BWYH.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-TG37FXTU.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value)=>{let{default:confirm}=await import("./esm-33752ISR.js");return this.runPrompt(confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}))},select:async opts2=>{let{default:select}=await import("./esm-4JKEE7PC.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-DFFBNKNU.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from `--token` argument, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}let tokenResponse=await refreshTokenRequest({refresh_token:authConfig.refreshToken}),[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)&&tokensError.code==="invalid_grant"&&!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive){output_manager_default.debug(`Stored session refresh failed: ${tokensError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-JZ3RVO4B.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token}),this.persistAuthConfig();return}}if(tokensError){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),this.writeToConfigFile(),output_manager_default.debug("Tokens refreshed successfully.")}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve(this.cwd,confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config){this.config={...this.config,...config},"currentTeam"in config&&(this.savedTeam=config.currentTeam)}writeToConfigFile(config=this.config){writeToConfigFile(this.ignoresSavedTeam?{...config,currentTeam:this.savedTeam}:config)}isTeamUnchosen(){return this.ignoresSavedTeam&&this.config.currentTeam===TEAM_NOT_CHOSEN}needsTeamChoice(url,opts){return this.isTeamUnchosen()&&!opts.teamOptional&&!opts.accountId&&opts.useCurrentTeam!==!1&&!new URL(url,this.apiUrl).searchParams.has("teamId")}chooseTeam({ask=!0}={}){return ask?(this.teamChoice??=this.applyTeamChoice(!0).finally(()=>{this.teamChoice=void 0}),this.teamChoice):this.applyTeamChoice(!1)}async applyTeamChoice(ask){let{resolveAgentTeam}=await import("./resolve-agent-team-XSXRT42F.js"),team=await resolveAgentTeam(this,{ask});team!==null&&this.isTeamUnchosen()&&(this.config.currentTeam=team)}async resolveCurrentTeam({ask=!0}={}){return this.isTeamUnchosen()&&await this.chooseTeam({ask}),this.isTeamUnchosen()?void 0:this.config.currentTeam}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}persistAuthConfig(){persistAuthConfig(this.authConfig,this.config)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
10
- `),output_manager_default.print((0,import_chalk2.bgRed)((0,import_chalk2.white)((0,import_chalk2.bold)(" \u26A0 WARNING ")))+(0,import_chalk2.red)((0,import_chalk2.bold)(` AGENT MODE - DELETE CONFIRMATION BYPASSED
11
- `))),output_manager_default.print((0,import_chalk2.yellow)(` An AI agent${agentInfo} is executing a ${(0,import_chalk2.bold)("DELETE")} request with --dangerously-skip-permissions flag.
12
- `)),output_manager_default.print((0,import_chalk2.yellow)(` This operation will delete data: ${(0,import_chalk2.bold)(url)}
13
- `)),output_manager_default.print((0,import_chalk2.yellow)(` The --dangerously-skip-permissions flag has bypassed the confirmation prompt.
14
-
15
- `))}if(this.dangerouslySkipPermissions)return!0;if(!this.stdin.isTTY)return output_manager_default.error(`DELETE operations require confirmation. Use ${(0,import_chalk2.bold)("--dangerously-skip-permissions")} to skip confirmation in non-interactive mode.`),!1;let message=`You are about to perform a ${(0,import_chalk2.red)((0,import_chalk2.bold)("DELETE"))} operation on:
16
- ${(0,import_chalk2.bold)(url)}
17
-
18
- Are you sure you want to proceed?`;output_manager_default.print(`
19
- `);let confirmed=await this.input.confirm(message,!1);return output_manager_default.print(`
20
- `),confirmed||output_manager_default.log("Operation canceled by user."),confirmed}async _fetch(_url,opts={}){let url=new URL(_url,this.apiUrl);(opts.accountId||opts.useCurrentTeam!==!1)&&(opts.accountId?opts.accountId.startsWith("team_")?url.searchParams.set("teamId",opts.accountId):url.searchParams.delete("teamId"):opts.useCurrentTeam!==!1&&this.config.currentTeam&&!url.searchParams.has("teamId")&&url.searchParams.set("teamId",this.config.currentTeam));let headers=new globalThis.Headers(opts.headers);headers.set("user-agent",ua_default),DOMAINS_API_PATH.test(url.pathname)&&headers.set("x-vercel-cli-version",pkg_default.version),this.agentName&&headers.set("x-ai-agent",this.agentName),headers.set("x-vercel-cli-session-id",this.telemetryEventStore.currentSessionId),headers.set("x-vercel-cli-invocation-id",this.telemetryEventStore.currentInvocationId),await this.ensureAuthorized(),this.authConfig.token&&headers.set("authorization",`Bearer ${this.authConfig.token}`);let body;isJSONObject(opts.body)?(body=JSON.stringify(opts.body),headers.set("content-type","application/json; charset=utf-8")):body=opts.body;let requestId=this.requestIdCounter++;return output_manager_default.time(res=>res?`#${requestId} \u2190 ${res.status} ${res.statusText}: ${res.headers.get("x-vercel-id")}`:`#${requestId} \u2192 ${opts.method||"GET"} ${url.href}`,fetch(url,{...opts,headers,body}))}async fetch(url,opts={}){return this.needsTeamChoice(url,opts)&&await this.chooseTeam(),this.retry(async bail=>{let res;try{res=await this._fetch(url,opts)}catch(err){if(err instanceof Error&&(err.name==="AbortError"||err.name==="TimeoutError"))return bail(err);throw err}if(printIndications(res),!res.ok){if(opts.redirect==="manual"&&res.status>=300&&res.status<400)return res;let error=await responseError(res);if(isSAMLError(error)&&error.teamId)try{await this.reauthenticate(error)}catch(reauthError){return bail((0,import_error_utils.normalizeError)(reauthError))}else{if(res.status===429&&opts.bailOn429)return bail(error);if(typeof error.retryAfterMs=="number"){let randomSkewMs=3e4*Math.random();await sleep(error.retryAfterMs+randomSkewMs)}else if(res.status>=400&&res.status<500)return bail(error)}throw error}if(opts.json===!1)return res;let contentType=res.headers.get("content-type");return contentType?contentType.includes("application/json")?res.json():res:null},opts.retry)}async*fetchPaginated(url,opts){let endpoint=typeof url=="string"?new URL(url,this.apiUrl):new URL(url.href);endpoint.searchParams.has("limit")||endpoint.searchParams.set("limit","100");let next;do{next&&(await sleep(100),endpoint.searchParams.set("until",String(next)));let res=await this.fetch(endpoint.href,opts);yield res,next=res.pagination?.next}while(next)}get cwd(){return process.cwd()}set cwd(v){process.chdir(v)}};export{responseError,printIndications,TEAM_NOT_CHOSEN,isJSONObject,isValidAccessToken,Client};
@@ -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{getScope}from"./chunk-GLH4PVMY.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-DDLM6CIQ.js";import{getOrgById}from"./chunk-JIGCN5QS.js";import{output_manager_default}from"./chunk-M774HRX5.js";async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`;if(output_manager_default.error(`${headline}
8
-
9
- If it lives in a different team or account:
10
- \u2022 Retry with \`--scope <team-slug|your-username>\`, or
11
- \u2022 Run \`vercel switch <team-slug|your-username>\` to change scope.
12
-
13
- List accessible teams with \`vercel teams ls\`.`),!shouldEmitNonInteractiveCommandError(client))return;let retryWithScope=buildCommandWithGlobalFlags(client.argv,`${commandName} --project ${projectNameOrId} --scope <team-slug>`);outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.PROJECT_NOT_FOUND,message:`${headline} If it lives in a different team or account, retry with --scope <team-slug|your-username> or run \`vercel switch <team-slug|your-username>\` to change scope.`,...contextName?{scope:contextName}:{},next:[{command:"vercel teams ls",when:"list accessible teams"},{command:retryWithScope,when:"retry with a specific team"},{command:"vercel switch <team-slug>",when:"change the default scope"}]},1)}export{printProjectNotFoundError};
@@ -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{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_polyfills=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.exports=patch;function patch(fs){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs),fs.lutimes||patchLutimes(fs),fs.chown=chownFix(fs.chown),fs.fchown=chownFix(fs.fchown),fs.lchown=chownFix(fs.lchown),fs.chmod=chmodFix(fs.chmod),fs.fchmod=chmodFix(fs.fchmod),fs.lchmod=chmodFix(fs.lchmod),fs.chownSync=chownFixSync(fs.chownSync),fs.fchownSync=chownFixSync(fs.fchownSync),fs.lchownSync=chownFixSync(fs.lchownSync),fs.chmodSync=chmodFixSync(fs.chmodSync),fs.fchmodSync=chmodFixSync(fs.fchmodSync),fs.lchmodSync=chmodFixSync(fs.lchmodSync),fs.stat=statFix(fs.stat),fs.fstat=statFix(fs.fstat),fs.lstat=statFix(fs.lstat),fs.statSync=statFixSync(fs.statSync),fs.fstatSync=statFixSync(fs.fstatSync),fs.lstatSync=statFixSync(fs.lstatSync),fs.chmod&&!fs.lchmod&&(fs.lchmod=function(path,mode,cb){cb&&process.nextTick(cb)},fs.lchmodSync=function(){}),fs.chown&&!fs.lchown&&(fs.lchown=function(path,uid,gid,cb){cb&&process.nextTick(cb)},fs.lchownSync=function(){}),platform==="win32"&&(fs.rename=typeof fs.rename!="function"?fs.rename:function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,fs$rename),rename}(fs.rename)),fs.read=typeof fs.read!="function"?fs.read:function(fs$read){function read(fd,buffer,offset,length,position,callback_){var callback;if(callback_&&typeof callback_=="function"){var eagCounter=0;callback=function(er,_,__){if(er&&er.code==="EAGAIN"&&eagCounter<10)return eagCounter++,fs$read.call(fs,fd,buffer,offset,length,position,callback);callback_.apply(this,arguments)}}return fs$read.call(fs,fd,buffer,offset,length,position,callback)}return Object.setPrototypeOf&&Object.setPrototypeOf(read,fs$read),read}(fs.read),fs.readSync=typeof fs.readSync!="function"?fs.readSync:function(fs$readSync){return function(fd,buffer,offset,length,position){for(var eagCounter=0;;)try{return fs$readSync.call(fs,fd,buffer,offset,length,position)}catch(er){if(er.code==="EAGAIN"&&eagCounter<10){eagCounter++;continue}throw er}}}(fs.readSync);function patchLchmod(fs2){fs2.lchmod=function(path,mode,callback){fs2.open(path,constants.O_WRONLY|constants.O_SYMLINK,mode,function(err,fd){if(err){callback&&callback(err);return}fs2.fchmod(fd,mode,function(err2){fs2.close(fd,function(err22){callback&&callback(err2||err22)})})})},fs2.lchmodSync=function(path,mode){var fd=fs2.openSync(path,constants.O_WRONLY|constants.O_SYMLINK,mode),threw=!0,ret;try{ret=fs2.fchmodSync(fd,mode),threw=!1}finally{if(threw)try{fs2.closeSync(fd)}catch{}else fs2.closeSync(fd)}return ret}}function patchLutimes(fs2){constants.hasOwnProperty("O_SYMLINK")&&fs2.futimes?(fs2.lutimes=function(path,at,mt,cb){fs2.open(path,constants.O_SYMLINK,function(er,fd){if(er){cb&&cb(er);return}fs2.futimes(fd,at,mt,function(er2){fs2.close(fd,function(er22){cb&&cb(er2||er22)})})})},fs2.lutimesSync=function(path,at,mt){var fd=fs2.openSync(path,constants.O_SYMLINK),ret,threw=!0;try{ret=fs2.futimesSync(fd,at,mt),threw=!1}finally{if(threw)try{fs2.closeSync(fd)}catch{}else fs2.closeSync(fd)}return ret}):fs2.futimes&&(fs2.lutimes=function(_a,_b,_c,cb){cb&&process.nextTick(cb)},fs2.lutimesSync=function(){})}function chmodFix(orig){return orig&&function(target,mode,cb){return orig.call(fs,target,mode,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chmodFixSync(orig){return orig&&function(target,mode){try{return orig.call(fs,target,mode)}catch(er){if(!chownErOk(er))throw er}}}function chownFix(orig){return orig&&function(target,uid,gid,cb){return orig.call(fs,target,uid,gid,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chownFixSync(orig){return orig&&function(target,uid,gid){try{return orig.call(fs,target,uid,gid)}catch(er){if(!chownErOk(er))throw er}}}function statFix(orig){return orig&&function(target,options,cb){typeof options=="function"&&(cb=options,options=null);function callback(er,stats){stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),cb&&cb.apply(this,arguments)}return options?orig.call(fs,target,options,callback):orig.call(fs,target,callback)}}function statFixSync(orig){return orig&&function(target,options){var stats=options?orig.call(fs,target,options):orig.call(fs,target);return stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),stats}}function chownErOk(er){if(!er||er.code==="ENOSYS")return!0;var nonroot=!process.getuid||process.getuid()!==0;return!!(nonroot&&(er.code==="EINVAL"||er.code==="EPERM"))}}}});var require_legacy_streams=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports,module){var Stream=__require("stream").Stream;module.exports=legacy;function legacy(fs){return{ReadStream,WriteStream};function ReadStream(path,options){if(!(this instanceof ReadStream))return new ReadStream(path,options);Stream.call(this);var self=this;this.path=path,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){self._read()});return}fs.open(this.path,this.flags,this.mode,function(err,fd){if(err){self.emit("error",err),self.readable=!1;return}self.fd=fd,self.emit("open",fd),self._read()})}function WriteStream(path,options){if(!(this instanceof WriteStream))return new WriteStream(path,options);Stream.call(this),this.path=path,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=fs.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}});var require_clone=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports,module){"use strict";module.exports=clone;var getPrototypeOf=Object.getPrototypeOf||function(obj){return obj.__proto__};function clone(obj){if(obj===null||typeof obj!="object")return obj;if(obj instanceof Object)var copy={__proto__:getPrototypeOf(obj)};else var copy=Object.create(null);return Object.getOwnPropertyNames(obj).forEach(function(key){Object.defineProperty(copy,key,Object.getOwnPropertyDescriptor(obj,key))}),copy}}});var require_graceful_fs=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports,module){var fs=__require("fs"),polyfills=require_polyfills(),legacy=require_legacy_streams(),clone=require_clone(),util=__require("util"),gracefulQueue,previousSymbol;typeof Symbol=="function"&&typeof Symbol.for=="function"?(gracefulQueue=Symbol.for("graceful-fs.queue"),previousSymbol=Symbol.for("graceful-fs.previous")):(gracefulQueue="___graceful-fs.queue",previousSymbol="___graceful-fs.previous");function noop(){}function publishQueue(context,queue2){Object.defineProperty(context,gracefulQueue,{get:function(){return queue2}})}var debug=noop;util.debuglog?debug=util.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(debug=function(){var m=util.format.apply(util,arguments);m="GFS4: "+m.split(/\n/).join(`
8
- GFS4: `),console.error(m)});fs[gracefulQueue]||(queue=global[gracefulQueue]||[],publishQueue(fs,queue),fs.close=function(fs$close){function close(fd,cb){return fs$close.call(fs,fd,function(err){err||resetQueue(),typeof cb=="function"&&cb.apply(this,arguments)})}return Object.defineProperty(close,previousSymbol,{value:fs$close}),close}(fs.close),fs.closeSync=function(fs$closeSync){function closeSync(fd){fs$closeSync.apply(fs,arguments),resetQueue()}return Object.defineProperty(closeSync,previousSymbol,{value:fs$closeSync}),closeSync}(fs.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){debug(fs[gracefulQueue]),__require("assert").equal(fs[gracefulQueue].length,0)}));var queue;global[gracefulQueue]||publishQueue(global,fs[gracefulQueue]);module.exports=patch(clone(fs));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fs.__patched&&(module.exports=patch(fs),fs.__patched=!0);function patch(fs2){polyfills(fs2),fs2.gracefulify=patch,fs2.createReadStream=createReadStream,fs2.createWriteStream=createWriteStream;var fs$readFile=fs2.readFile;fs2.readFile=readFile;function readFile(path,options,cb){return typeof options=="function"&&(cb=options,options=null),go$readFile(path,options,cb);function go$readFile(path2,options2,cb2,startTime){return fs$readFile(path2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readFile,[path2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$writeFile=fs2.writeFile;fs2.writeFile=writeFile;function writeFile(path,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$writeFile(path,data,options,cb);function go$writeFile(path2,data2,options2,cb2,startTime){return fs$writeFile(path2,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$writeFile,[path2,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$appendFile=fs2.appendFile;fs$appendFile&&(fs2.appendFile=appendFile);function appendFile(path,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$appendFile(path,data,options,cb);function go$appendFile(path2,data2,options2,cb2,startTime){return fs$appendFile(path2,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$appendFile,[path2,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$copyFile=fs2.copyFile;fs$copyFile&&(fs2.copyFile=copyFile);function copyFile(src,dest,flags,cb){return typeof flags=="function"&&(cb=flags,flags=0),go$copyFile(src,dest,flags,cb);function go$copyFile(src2,dest2,flags2,cb2,startTime){return fs$copyFile(src2,dest2,flags2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$copyFile,[src2,dest2,flags2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$readdir=fs2.readdir;fs2.readdir=readdir;var noReaddirOptionVersions=/^v[0-5]\./;function readdir(path,options,cb){typeof options=="function"&&(cb=options,options=null);var go$readdir=noReaddirOptionVersions.test(process.version)?function(path2,options2,cb2,startTime){return fs$readdir(path2,fs$readdirCallback(path2,options2,cb2,startTime))}:function(path2,options2,cb2,startTime){return fs$readdir(path2,options2,fs$readdirCallback(path2,options2,cb2,startTime))};return go$readdir(path,options,cb);function fs$readdirCallback(path2,options2,cb2,startTime){return function(err,files){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readdir,[path2,options2,cb2],err,startTime||Date.now(),Date.now()]):(files&&files.sort&&files.sort(),typeof cb2=="function"&&cb2.call(this,err,files))}}}if(process.version.substr(0,4)==="v0.8"){var legStreams=legacy(fs2);ReadStream=legStreams.ReadStream,WriteStream=legStreams.WriteStream}var fs$ReadStream=fs2.ReadStream;fs$ReadStream&&(ReadStream.prototype=Object.create(fs$ReadStream.prototype),ReadStream.prototype.open=ReadStream$open);var fs$WriteStream=fs2.WriteStream;fs$WriteStream&&(WriteStream.prototype=Object.create(fs$WriteStream.prototype),WriteStream.prototype.open=WriteStream$open),Object.defineProperty(fs2,"ReadStream",{get:function(){return ReadStream},set:function(val){ReadStream=val},enumerable:!0,configurable:!0}),Object.defineProperty(fs2,"WriteStream",{get:function(){return WriteStream},set:function(val){WriteStream=val},enumerable:!0,configurable:!0});var FileReadStream=ReadStream;Object.defineProperty(fs2,"FileReadStream",{get:function(){return FileReadStream},set:function(val){FileReadStream=val},enumerable:!0,configurable:!0});var FileWriteStream=WriteStream;Object.defineProperty(fs2,"FileWriteStream",{get:function(){return FileWriteStream},set:function(val){FileWriteStream=val},enumerable:!0,configurable:!0});function ReadStream(path,options){return this instanceof ReadStream?(fs$ReadStream.apply(this,arguments),this):ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){err?(that.autoClose&&that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd),that.read())})}function WriteStream(path,options){return this instanceof WriteStream?(fs$WriteStream.apply(this,arguments),this):WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){err?(that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd))})}function createReadStream(path,options){return new fs2.ReadStream(path,options)}function createWriteStream(path,options){return new fs2.WriteStream(path,options)}var fs$open=fs2.open;fs2.open=open;function open(path,flags,mode,cb){return typeof mode=="function"&&(cb=mode,mode=null),go$open(path,flags,mode,cb);function go$open(path2,flags2,mode2,cb2,startTime){return fs$open(path2,flags2,mode2,function(err,fd){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$open,[path2,flags2,mode2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}return fs2}function enqueue(elem){debug("ENQUEUE",elem[0].name,elem[1]),fs[gracefulQueue].push(elem),retry()}var retryTimer;function resetQueue(){for(var now=Date.now(),i=0;i<fs[gracefulQueue].length;++i)fs[gracefulQueue][i].length>2&&(fs[gracefulQueue][i][3]=now,fs[gracefulQueue][i][4]=now);retry()}function retry(){if(clearTimeout(retryTimer),retryTimer=void 0,fs[gracefulQueue].length!==0){var elem=fs[gracefulQueue].shift(),fn=elem[0],args=elem[1],err=elem[2],startTime=elem[3],lastTime=elem[4];if(startTime===void 0)debug("RETRY",fn.name,args),fn.apply(null,args);else if(Date.now()-startTime>=6e4){debug("TIMEOUT",fn.name,args);var cb=args.pop();typeof cb=="function"&&cb.call(null,err)}else{var sinceAttempt=Date.now()-lastTime,sinceStart=Math.max(lastTime-startTime,1),desiredDelay=Math.min(sinceStart*1.2,100);sinceAttempt>=desiredDelay?(debug("RETRY",fn.name,args),fn.apply(null,args.concat([startTime]))):fs[gracefulQueue].push(elem)}retryTimer===void 0&&(retryTimer=setTimeout(retry,0))}}}});export{require_graceful_fs};
@@ -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{quoteArg}from"./chunk-DDLM6CIQ.js";import{arg_common_default,stripSensitiveAuthArgs}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_arg=__commonJS({"../../node_modules/.pnpm/arg@5.0.0/node_modules/arg/index.js"(exports,module){var flagSymbol=Symbol("arg flag"),ArgError=class _ArgError extends Error{constructor(msg,code){super(msg),this.name="ArgError",this.code=code,Object.setPrototypeOf(this,_ArgError.prototype)}};function arg2(opts,{argv=process.argv.slice(2),permissive=!1,stopAtPositional=!1}={}){if(!opts)throw new ArgError("argument specification object is required","ARG_CONFIG_NO_SPEC");let result={_:[]},aliases={},handlers={};for(let key of Object.keys(opts)){if(!key)throw new ArgError("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(key[0]!=="-")throw new ArgError(`argument key must start with '-' but found: '${key}'`,"ARG_CONFIG_NONOPT_KEY");if(key.length===1)throw new ArgError(`argument key must have a name; singular '-' keys are not allowed: ${key}`,"ARG_CONFIG_NONAME_KEY");if(typeof opts[key]=="string"){aliases[key]=opts[key];continue}let type=opts[key],isFlag=!1;if(Array.isArray(type)&&type.length===1&&typeof type[0]=="function"){let[fn]=type;type=(value,name,prev=[])=>(prev.push(fn(value,name,prev[prev.length-1])),prev),isFlag=fn===Boolean||fn[flagSymbol]===!0}else if(typeof type=="function")isFlag=type===Boolean||type[flagSymbol]===!0;else throw new ArgError(`type missing or not a function or valid array type: ${key}`,"ARG_CONFIG_VAD_TYPE");if(key[1]!=="-"&&key.length>2)throw new ArgError(`short argument keys (with a single hyphen) must have only one character: ${key}`,"ARG_CONFIG_SHORTOPT_TOOLONG");handlers[key]=[type,isFlag]}for(let i=0,len=argv.length;i<len;i++){let wholeArg=argv[i];if(stopAtPositional&&result._.length>0){result._=result._.concat(argv.slice(i));break}if(wholeArg==="--"){result._=result._.concat(argv.slice(i+1));break}if(wholeArg.length>1&&wholeArg[0]==="-"){let separatedArguments=wholeArg[1]==="-"||wholeArg.length===2?[wholeArg]:wholeArg.slice(1).split("").map(a=>`-${a}`);for(let j=0;j<separatedArguments.length;j++){let arg3=separatedArguments[j],[originalArgName,argStr]=arg3[1]==="-"?arg3.split(/=(.*)/,2):[arg3,void 0],argName=originalArgName;for(;argName in aliases;)argName=aliases[argName];if(!(argName in handlers))if(permissive){result._.push(arg3);continue}else throw new ArgError(`unknown or unexpected option: ${originalArgName}`,"ARG_UNKNOWN_OPTION");let[type,isFlag]=handlers[argName];if(!isFlag&&j+1<separatedArguments.length)throw new ArgError(`option requires argument (but was followed by another short argument): ${originalArgName}`,"ARG_MISSING_REQUIRED_SHORTARG");if(isFlag)result[argName]=type(!0,argName,result[argName]);else if(argStr===void 0){if(argv.length<i+2||argv[i+1].length>1&&argv[i+1][0]==="-"&&!(argv[i+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(type===Number||typeof BigInt<"u"&&type===BigInt))){let extended=originalArgName===argName?"":` (alias for ${argName})`;throw new ArgError(`option requires argument: ${originalArgName}${extended}`,"ARG_MISSING_REQUIRED_LONGARG")}result[argName]=type(argv[i+1],argName,result[argName]),++i}else result[argName]=type(argStr,argName,result[argName])}}else result._.push(wholeArg)}return result}arg2.flag=fn=>(fn[flagSymbol]=!0,fn);arg2.COUNT=arg2.flag((v,name,existingCount)=>(existingCount||0)+1);arg2.ArgError=ArgError;module.exports=arg2}});var import_arg=__toESM(require_arg(),1);function suggestCorrection(input,choices){if(input.replace(/^-+/,"").length<3||choices.includes(input))return;let matches=[...new Set(choices)].filter(choice=>{if(Math.abs(input.length-choice.length)>1)return!1;let i=0;for(;i<input.length&&input[i]===choice[i];)i++;return input.length===choice.length?input.slice(i+1)===choice.slice(i+1)||input[i]===choice[i+1]&&input[i+1]===choice[i]&&input.slice(i+2)===choice.slice(i+2):input.length>choice.length?input.slice(i+1)===choice.slice(i):input.slice(i)===choice.slice(i+1)});return matches.length===1?matches[0]:void 0}var SAFE_VALUE_FLAGS=new Set(["--cwd","--scope","--team","-S","-T","--project","-p","--format","--environment","--since","--until","--limit"]),READ_COMMANDS=new Set(["inspect","list","ls","schema","whoami"]);function buildCorrectedCommand(argv,from,to,flagsSpecification={}){let corrected=argv.slice(2),spec={...arg_common_default(),...flagsSpecification},valuelessFlags=new Set,takesValue=new Set;for(let[name,value]of Object.entries(spec))((typeof value=="string"?spec[value]:value)===Boolean?valuelessFlags:takesValue).add(name);for(let i=0;i<corrected.length;i++){let value=corrected[i];if(value==="--")break;if(value===from||value.startsWith(`${from}=`)){corrected[i]=to+value.slice(from.length);break}takesValue.has(value)&&i++}let args=stripSensitiveAuthArgs(corrected).filter(arg2=>!/^-t[^-=]/.test(arg2)),out=[],positionals=0,readCommand=!1;for(let i=0;i<args.length;i++){let value=args[i];if(value==="--"){out.push("--","<argument>");break}if(value.startsWith("-")){if(/^-[A-Za-z][^=].+/.test(value)&&!value.startsWith("--")){let name2=value.slice(0,2);out.push(name2,SAFE_VALUE_FLAGS.has(name2)?value.slice(2):"<value>");continue}let equals=value.indexOf("="),name=equals<0?value:value.slice(0,equals);equals>=0?out.push(`${name}=${SAFE_VALUE_FLAGS.has(name)||valuelessFlags.has(name)&&/^(true|false)$/.test(value.slice(equals+1))?value.slice(equals+1):"<value>"}`):(out.push(name),!valuelessFlags.has(name)&&i+1<args.length&&(takesValue.has(name)||!args[i+1].startsWith("-"))&&(i++,out.push(SAFE_VALUE_FLAGS.has(name)?args[i]:"<value>")))}else positionals++,positionals<=2&&(readCommand||=READ_COMMANDS.has(value)),out.push(positionals<=2||readCommand?value:"<argument>")}return[packageName,...out].map(quoteArg).join(" ")}var argumentErrors=new WeakSet;function isArgumentError(error){return error instanceof Error&&argumentErrors.has(error)}function parseWithSuggestions(args,spec,options){try{return(0,import_arg.default)(spec,{...options,argv:args})}catch(error){if(error instanceof Error&&"code"in error&&["ARG_UNKNOWN_OPTION","ARG_MISSING_REQUIRED_LONGARG","ARG_MISSING_REQUIRED_SHORTARG"].includes(String(error.code))){let err=error,option=/(?:unknown or unexpected option|option requires argument(?: \([^)]*\))?): (--?[A-Za-z0-9-]+)(?: \(alias for --?[A-Za-z0-9-]+\))?$/.exec(err.message)?.[1];option&&(argumentErrors.add(err),err.invalidOption=option,err.allowedOptions=Object.keys(spec).filter(name=>name.startsWith("--")).sort(),err.code==="ARG_UNKNOWN_OPTION"&&(err.suggestedOption=suggestCorrection(option,err.allowedOptions)),err.flagsSpecification=spec)}throw error}}function getArgs(argv,argsOptions,argOptions={}){return parseWithSuggestions(argv,Object.assign({},arg_common_default(),argsOptions),argOptions)}function parseArguments(args,flagsSpecification,parserOptions={}){let{_:positional,...rest}=parseWithSuggestions(args,Object.assign({},arg_common_default(),flagsSpecification),parserOptions);return{args:positional,flags:rest}}function takeCommand(argv,flagsSpecification){let{_:positional}=parseWithSuggestions(argv,Object.assign({},arg_common_default(),flagsSpecification),{stopAtPositional:!0}),index=argv.length-positional.length;return{command:positional[0],args:[...argv.slice(0,index),...argv.slice(index+1)]}}export{require_arg,suggestCorrection,buildCorrectedCommand,isArgumentError,getArgs,parseArguments,takeCommand};
@@ -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{getEnvTargetPlaceholder}from"./chunk-CMKLX4DC.js";import{projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var buildCommand={name:"build",aliases:[],description:"Build the project.",arguments:[],options:[{name:"prod",description:"Build a production deployment",shorthand:null,type:Boolean,deprecated:!1},{name:"target",shorthand:null,type:String,argument:"TARGET",deprecated:!1,description:"Specify the target environment"},{name:"output",description:"Directory where built assets will be written to",shorthand:null,argument:"DIR",type:String,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt about pulling environment variables and project settings when not found locally"},{name:"standalone",description:"Create a standalone build with all dependencies inlined into function output folders",shorthand:null,type:Boolean,deprecated:!1},{name:"id",description:"Deployment ID to pull environment variables from (e.g. dpl_xxx)",shorthand:null,type:String,argument:"ID",deprecated:!1},projectOption],examples:[{name:"Build the project",value:`${packageName} build`},{name:"Build the project in a specific directory",value:`${packageName} build --cwd ./path-to-project`},{name:"Build with deployment-scoped environment variables",value:`${packageName} build --id dpl_xxx`}]};var pullCommand={name:"pull",aliases:[],description:"Pull Environment Variables and project settings into .vercel",arguments:[{name:"project-path",required:!1}],options:[{name:"environment",description:"Deployment environment [development]",argument:"TARGET",shorthand:null,type:String,deprecated:!1},{name:"git-branch",description:"Specify the Git branch to pull specific Environment Variables for",argument:"NAME",shorthand:null,type:String,deprecated:!1},{name:"prod",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip questions when setting up new project using default scope and settings"},projectOption],examples:[{name:"Pull the latest Environment Variables and Project Settings from the cloud",value:`${packageName} pull`},{name:"Pull the latest Environment Variables and Project Settings from the cloud targeting a directory",value:`${packageName} pull ./path-to-project`},{name:"Pull for a specific environment",value:`${packageName} pull --environment=${getEnvTargetPlaceholder()}`},{name:"Pull for a preview feature branch",value:`${packageName} pull --environment=preview --git-branch=feature-branch`},{name:"Pull Environment Variables into an application env file with `vercel env pull`",value:`${packageName} env pull`}]};export{buildCommand,pullCommand};