@vercel/cli-support 65.3.1 → 65.5.0-snapshot-13615777d933

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 (324) hide show
  1. package/README.md +23 -1
  2. package/dist/chunks/add-6UOKR26K.js +8 -0
  3. package/dist/chunks/add-GULZ6EGJ.js +8 -0
  4. package/dist/chunks/add-RPAOJH5O.js +8 -0
  5. package/dist/chunks/build-MLAKPRSC.js +7 -0
  6. package/dist/chunks/{chunk-ADLBLGT3.js → chunk-26QK3I2S.js} +1 -1
  7. package/dist/chunks/chunk-2BKALEOP.js +7 -0
  8. package/dist/chunks/chunk-2FHZYQPY.js +7 -0
  9. package/dist/chunks/{chunk-6KVHNQW4.js → chunk-2QIJEHNE.js} +1 -1
  10. package/dist/chunks/{chunk-3JGBBS6V.js → chunk-36NK2Z3C.js} +1 -1
  11. package/dist/chunks/{chunk-D6REP5QQ.js → chunk-3E364MJE.js} +1 -1
  12. package/dist/chunks/{chunk-IGDG5CWT.js → chunk-3H36RI7C.js} +1 -1
  13. package/dist/chunks/{chunk-D2BZMGHP.js → chunk-3NG2EYQ5.js} +1 -1
  14. package/dist/chunks/{chunk-WCWP4GBR.js → chunk-4G7ZQONX.js} +1 -1
  15. package/dist/chunks/{chunk-7BGKE3JW.js → chunk-4HJGSSSZ.js} +1 -1
  16. package/dist/chunks/{chunk-BBKEP7RO.js → chunk-55H6G46X.js} +1 -1
  17. package/dist/chunks/chunk-5CZNUB7Y.js +7 -0
  18. package/dist/chunks/{chunk-URPEIX6M.js → chunk-5EMSOR2P.js} +1 -1
  19. package/dist/chunks/{chunk-OCQPXOTX.js → chunk-5K426HWC.js} +1 -1
  20. package/dist/chunks/{chunk-773GOZIR.js → chunk-5SIC5273.js} +1 -1
  21. package/dist/chunks/chunk-5WYPJ2T5.js +25 -0
  22. package/dist/chunks/{chunk-F2SWJEYV.js → chunk-6IATT2ID.js} +2 -2
  23. package/dist/chunks/{chunk-S5IWVPYT.js → chunk-6WMO5G45.js} +3 -3
  24. package/dist/chunks/{chunk-6OVX3PWM.js → chunk-75JI2SZX.js} +1 -1
  25. package/dist/chunks/{chunk-LRYGNQ6C.js → chunk-7G4PQR6J.js} +1 -1
  26. package/dist/chunks/chunk-7SAEZ4NC.js +7 -0
  27. package/dist/chunks/{chunk-22FDWPWY.js → chunk-7VTPAXDC.js} +1 -1
  28. package/dist/chunks/chunk-A2UZ2O7H.js +7 -0
  29. package/dist/chunks/{chunk-3LIKVGFT.js → chunk-A3RU52F4.js} +1 -1
  30. package/dist/chunks/{chunk-FDNYYENK.js → chunk-AIRQFG5A.js} +1 -1
  31. package/dist/chunks/{chunk-76SVVWPH.js → chunk-AOC6XXOO.js} +1 -1
  32. package/dist/chunks/chunk-ARQMFBV4.js +11 -0
  33. package/dist/chunks/{chunk-NQWGRKF4.js → chunk-AUY363W7.js} +1 -1
  34. package/dist/chunks/chunk-BGWS5R5R.js +9 -0
  35. package/dist/chunks/chunk-C6IITJ5S.js +7 -0
  36. package/dist/chunks/{chunk-LKLH6DZP.js → chunk-CLVEFWEX.js} +1 -1
  37. package/dist/chunks/{chunk-2WYYGGEO.js → chunk-CU2FTX57.js} +1 -1
  38. package/dist/chunks/{chunk-VMMMBWD3.js → chunk-CWO4HMKU.js} +1 -1
  39. package/dist/chunks/{chunk-CEMPU323.js → chunk-CZINAGH6.js} +1 -1
  40. package/dist/chunks/{chunk-TZFDVQ72.js → chunk-DAUAVRFC.js} +1 -1
  41. package/dist/chunks/{chunk-GA277JFB.js → chunk-DPM33VFZ.js} +1 -1
  42. package/dist/chunks/{chunk-Q5ODLDCU.js → chunk-DSY2S2YT.js} +1 -1
  43. package/dist/chunks/{chunk-XP3FT56R.js → chunk-DWOJP4ST.js} +3 -3
  44. package/dist/chunks/chunk-ED3VA7D4.js +7 -0
  45. package/dist/chunks/{chunk-GG5RME4X.js → chunk-EE2FTI3R.js} +1 -1
  46. package/dist/chunks/{chunk-SXOSF4O6.js → chunk-EFEQQXRU.js} +1 -1
  47. package/dist/chunks/{chunk-IUXSJWL3.js → chunk-EPO7P734.js} +1 -1
  48. package/dist/chunks/{chunk-X4762EE4.js → chunk-EQT2VHL2.js} +1 -1
  49. package/dist/chunks/chunk-ETEVOJQJ.js +8 -0
  50. package/dist/chunks/chunk-EWP5WICJ.js +10 -0
  51. package/dist/chunks/chunk-F22QLVTX.js +7 -0
  52. package/dist/chunks/{chunk-COM5YCHF.js → chunk-FAEC4BER.js} +1 -1
  53. package/dist/chunks/{chunk-LSQREJXO.js → chunk-FAELJM4F.js} +1 -1
  54. package/dist/chunks/{chunk-NTZ5WWYV.js → chunk-FNA4MIOH.js} +1 -1
  55. package/dist/chunks/{chunk-OWOWPOIE.js → chunk-GFD6UAAO.js} +2 -2
  56. package/dist/chunks/{chunk-DUT4U5YY.js → chunk-GP55VEOQ.js} +1 -1
  57. package/dist/chunks/chunk-GVPVWHFK.js +7 -0
  58. package/dist/chunks/chunk-HMWDOAWO.js +7 -0
  59. package/dist/chunks/{chunk-7L2K4OKM.js → chunk-HVDGNAPM.js} +1 -1
  60. package/dist/chunks/{chunk-7Y46LB43.js → chunk-I2WEQWCA.js} +1 -1
  61. package/dist/chunks/{chunk-ULHNMQ7C.js → chunk-IC3THLYP.js} +1 -1
  62. package/dist/chunks/{chunk-IQKGQ2Y2.js → chunk-J6L5MDTX.js} +1 -1
  63. package/dist/chunks/{chunk-OMCGXRSA.js → chunk-JCGEXU7T.js} +3 -3
  64. package/dist/chunks/{chunk-Y6AGOERS.js → chunk-JGMJP4T3.js} +1 -1
  65. package/dist/chunks/{chunk-YK7XLFU2.js → chunk-JHNLBVO2.js} +1 -1
  66. package/dist/chunks/{chunk-OQCMRU3J.js → chunk-JMLKK7RL.js} +2 -2
  67. package/dist/chunks/chunk-JSAY52FE.js +7 -0
  68. package/dist/chunks/{chunk-YN3C5BL5.js → chunk-JWUXHL35.js} +1 -1
  69. package/dist/chunks/{chunk-XXXRTHTP.js → chunk-JXAEI2GJ.js} +1 -1
  70. package/dist/chunks/{chunk-QMCHGGDX.js → chunk-KHADRPBJ.js} +1 -1
  71. package/dist/chunks/{chunk-43GBAKL2.js → chunk-KWKEBKUR.js} +1 -1
  72. package/dist/chunks/chunk-KY7LDQRX.js +7 -0
  73. package/dist/chunks/{chunk-NEFDNROD.js → chunk-L4XLDN6T.js} +1 -1
  74. package/dist/chunks/chunk-LFOWP74R.js +7 -0
  75. package/dist/chunks/{chunk-VQSLPYAF.js → chunk-LOO42IMZ.js} +1 -1
  76. package/dist/chunks/{chunk-2U7DJZSQ.js → chunk-LT5UZRMK.js} +1 -1
  77. package/dist/chunks/{chunk-FUX6LKNP.js → chunk-LUX4PBJL.js} +1 -1
  78. package/dist/chunks/chunk-M7LUSXMG.js +7 -0
  79. package/dist/chunks/{chunk-ANMDN3EG.js → chunk-MFW6IJIK.js} +1 -1
  80. package/dist/chunks/{chunk-OQPXJCMK.js → chunk-MLGQ233X.js} +1 -1
  81. package/dist/chunks/chunk-MY4MONOH.js +7 -0
  82. package/dist/chunks/{chunk-ZH6KHD55.js → chunk-MZQEDXOH.js} +2 -2
  83. package/dist/chunks/chunk-N5CXIFE2.js +7 -0
  84. package/dist/chunks/{chunk-XZV4BFM5.js → chunk-NM44RWS6.js} +1 -1
  85. package/dist/chunks/chunk-NVNE3W7S.js +8 -0
  86. package/dist/chunks/chunk-NZPGWZLV.js +9 -0
  87. package/dist/chunks/chunk-O7COT3YB.js +7 -0
  88. package/dist/chunks/{chunk-3KKFLKQG.js → chunk-ODAV7Z2H.js} +1 -1
  89. package/dist/chunks/{chunk-HCRD3JFL.js → chunk-OKNDHNH6.js} +1 -1
  90. package/dist/chunks/{chunk-LCHECISY.js → chunk-OQX4YVGU.js} +1 -1
  91. package/dist/chunks/chunk-ORJBK5FT.js +9 -0
  92. package/dist/chunks/chunk-OTYF3ZZW.js +7 -0
  93. package/dist/chunks/{chunk-FGFLTLEA.js → chunk-P6ZTEDX2.js} +1 -1
  94. package/dist/chunks/{chunk-7Z3WUAO5.js → chunk-PHHZ6J7Q.js} +1 -1
  95. package/dist/chunks/{chunk-E6CO6TUM.js → chunk-PRFIFS3Q.js} +1 -1
  96. package/dist/chunks/{chunk-OGPENBY2.js → chunk-QDPYU6KS.js} +1 -1
  97. package/dist/chunks/{chunk-JLEJB6KM.js → chunk-QHM6OK76.js} +1 -1
  98. package/dist/chunks/chunk-QNL22LAW.js +7 -0
  99. package/dist/chunks/{chunk-IVSC7ZFJ.js → chunk-QUSEBFDO.js} +1 -1
  100. package/dist/chunks/{chunk-2ACMWVTB.js → chunk-R3BEQTZZ.js} +1 -1
  101. package/dist/chunks/{chunk-BUJITHGZ.js → chunk-RCUDI7OF.js} +1 -1
  102. package/dist/chunks/{chunk-IKQTP764.js → chunk-RMW2FDXS.js} +1 -1
  103. package/dist/chunks/{chunk-KRPY5FHJ.js → chunk-RQVIMYKN.js} +1 -1
  104. package/dist/chunks/chunk-RWPQOJTT.js +22 -0
  105. package/dist/chunks/{chunk-BL3HBRF6.js → chunk-SDOPVIKJ.js} +1 -1
  106. package/dist/chunks/{chunk-3XW7N4W3.js → chunk-SKSOCUDZ.js} +1 -1
  107. package/dist/chunks/chunk-SLDWAIO3.js +18 -0
  108. package/dist/chunks/{chunk-XB4SKARZ.js → chunk-SW3JRXUW.js} +1 -1
  109. package/dist/chunks/{chunk-6ISAISGD.js → chunk-TGOGYSBO.js} +1 -1
  110. package/dist/chunks/chunk-TZT3VYZ3.js +7 -0
  111. package/dist/chunks/{chunk-3ADDGPEN.js → chunk-UJQ6PBRF.js} +1 -1
  112. package/dist/chunks/chunk-UWMPVTXG.js +7 -0
  113. package/dist/chunks/{chunk-R6BEOVTU.js → chunk-VAWZZK3Y.js} +1 -1
  114. package/dist/chunks/{chunk-KNLGWGUE.js → chunk-VLYVVC3P.js} +11 -11
  115. package/dist/chunks/{chunk-G4T7VBGN.js → chunk-VQ755MPP.js} +1 -1
  116. package/dist/chunks/{chunk-QB7F3UAP.js → chunk-VUQWLLNI.js} +1 -1
  117. package/dist/chunks/chunk-VWHIWUGJ.js +7 -0
  118. package/dist/chunks/chunk-WDUHDLUA.js +14 -0
  119. package/dist/chunks/chunk-WICRM2JL.js +7 -0
  120. package/dist/chunks/{chunk-TKBORMUF.js → chunk-WKZ6JSGZ.js} +1 -1
  121. package/dist/chunks/{chunk-RRREFECI.js → chunk-WSVYZKI6.js} +1 -1
  122. package/dist/chunks/{chunk-UJSW56GS.js → chunk-XAU3KTPX.js} +1 -1
  123. package/dist/chunks/chunk-XCKUJZUG.js +10 -0
  124. package/dist/chunks/{chunk-DGYHWXD2.js → chunk-XE24Y6NM.js} +3 -3
  125. package/dist/chunks/{chunk-RW3X523R.js → chunk-XSQVCDSD.js} +1 -1
  126. package/dist/chunks/{chunk-KW6GSQXV.js → chunk-XTKGBVSF.js} +1 -1
  127. package/dist/chunks/{chunk-SKYDLHEZ.js → chunk-YALEYPMP.js} +1 -1
  128. package/dist/chunks/chunk-YCJHUYBJ.js +19 -0
  129. package/dist/chunks/{chunk-TO5PJDEN.js → chunk-YIRSRF6D.js} +1 -1
  130. package/dist/chunks/chunk-YQDOADMG.js +10 -0
  131. package/dist/chunks/{chunk-PFPJLIFF.js → chunk-YT3QAZQF.js} +1 -1
  132. package/dist/chunks/chunk-ZQUVDDPB.js +7 -0
  133. package/dist/chunks/{chunk-WBF36MYT.js → chunk-ZUNQHI5Y.js} +1 -1
  134. package/dist/chunks/{chunk-S4SJ7GIZ.js → chunk-ZUYPTLVO.js} +1 -1
  135. package/dist/chunks/clear-UZWOOGOH.js +8 -0
  136. package/dist/chunks/compile-vercel-config-2RQDL3RD.js +7 -0
  137. package/dist/chunks/config-C76IGJ6B.js +8 -0
  138. package/dist/chunks/config-RMJWRS7O.js +7 -0
  139. package/dist/chunks/config-validator.mjs +1 -1
  140. package/dist/chunks/{connect-git-provider-FS5Q2HO4.js → connect-git-provider-IQ7N2NPY.js} +1 -1
  141. package/dist/chunks/{constants-ICJL2EO5.js → constants-JAB7MRSK.js} +1 -1
  142. package/dist/chunks/delete-2WBR5JQW.js +9 -0
  143. package/dist/chunks/delete-OKOBDL7Z.js +10 -0
  144. package/dist/chunks/{detect-projects-OD4JEAW2.js → detect-projects-XPB3R7VS.js} +1 -1
  145. package/dist/chunks/detect-services-DRHV22O5.js +7 -0
  146. package/dist/chunks/disable-DFEABU2Z.js +7 -0
  147. package/dist/chunks/discard-KGBEMNFT.js +14 -0
  148. package/dist/chunks/edit-5XIRLUKG.js +9 -0
  149. package/dist/chunks/edit-PJIDMKUS.js +8 -0
  150. package/dist/chunks/enable-UDWDPFOI.js +7 -0
  151. package/dist/chunks/{exec-OZSY46V6.js → exec-PX4GTZNE.js} +1 -1
  152. package/dist/chunks/{export-MHSH7QCX.js → export-W75EA6EQ.js} +1 -1
  153. package/dist/chunks/future-PHSAEQIE.js +7 -0
  154. package/dist/chunks/generate-cert-for-deploy-C67VL5Z6.js +7 -0
  155. package/dist/chunks/image-U5CV2PRP.js +7 -0
  156. package/dist/chunks/import-builders-PHIIX7HW.js +7 -0
  157. package/dist/chunks/inspect-AU3MX7E2.js +13 -0
  158. package/dist/chunks/{inspect-IAWVHJXQ.js → inspect-DQQI3PM7.js} +1 -1
  159. package/dist/chunks/inspect-LJK7I6RZ.js +9 -0
  160. package/dist/chunks/{inspect-DI434TAM.js → inspect-RNWLPR7I.js} +1 -1
  161. package/dist/chunks/{inspect-A7WJQQZO.js → inspect-WHPWW4BI.js} +1 -1
  162. package/dist/chunks/list-JV26NNYL.js +16 -0
  163. package/dist/chunks/{list-INRPH25K.js → list-QNRFVMMQ.js} +1 -1
  164. package/dist/chunks/list-YF4FXWUZ.js +12 -0
  165. package/dist/chunks/login-A4KNOUNA.js +9 -0
  166. package/dist/chunks/login-COGE7JQU.js +7 -0
  167. package/dist/chunks/logs-KMQATUYR.js +7 -0
  168. package/dist/chunks/{ls-LIGIBVAT.js → ls-DTFLHFOW.js} +1 -1
  169. package/dist/chunks/{ls-MCQ2NS65.js → ls-FOKMPVIB.js} +1 -1
  170. package/dist/chunks/ls-HMYU2ZGA.js +11 -0
  171. package/dist/chunks/{ls-S5E2NQMI.js → ls-IHF33MQP.js} +1 -1
  172. package/dist/chunks/{ls-VXH4QYF5.js → ls-QD54I4S7.js} +1 -1
  173. package/dist/chunks/{ls-V2ZSIVO3.js → ls-RNRMYD3V.js} +1 -1
  174. package/dist/chunks/ls-ZQLCDIQJ.js +8 -0
  175. package/dist/chunks/mutate-RMIFQOF6.js +9 -0
  176. package/dist/chunks/notifications-BFBNV2HY.js +7 -0
  177. package/dist/chunks/open-L6HEXHAI.js +7 -0
  178. package/dist/chunks/openapi-6JKCOR7K.js +7 -0
  179. package/dist/chunks/permissions-UYGTYRKA.js +7 -0
  180. package/dist/chunks/{plugin-offer-Z6FCPQFD.js → plugin-offer-NBHRXMNR.js} +1 -1
  181. package/dist/chunks/prompt-missing-credentials-2IYIF2JI.js +7 -0
  182. package/dist/chunks/publish-T2VSTPG4.js +15 -0
  183. package/dist/chunks/pull-4GL47Z2S.js +7 -0
  184. package/dist/chunks/purchase-domain-if-available-BHFBD3LW.js +7 -0
  185. package/dist/chunks/push-CQPIDVTL.js +7 -0
  186. package/dist/chunks/{query-JGPO7TNY.js → query-HN45ORIB.js} +3 -3
  187. package/dist/chunks/reauthenticate-FTHGAWK3.js +7 -0
  188. package/dist/chunks/reorder-7BD5JZKQ.js +10 -0
  189. package/dist/chunks/reply-2INQJ5KM.js +9 -0
  190. package/dist/chunks/resolve-DHAJC3I7.js +12 -0
  191. package/dist/chunks/resolve-agent-team-KGYPHN5F.js +7 -0
  192. package/dist/chunks/restore-OQKNWEFQ.js +16 -0
  193. package/dist/chunks/rm-CTP4UZH7.js +8 -0
  194. package/dist/chunks/rm-GFHEXQQW.js +8 -0
  195. package/dist/chunks/rm-OG3OXA6H.js +8 -0
  196. package/dist/chunks/rm-PFZYHXEN.js +8 -0
  197. package/dist/chunks/rm-XAW3WJ3I.js +8 -0
  198. package/dist/chunks/{routes-P6LKQCWH.js → routes-XKEWEA3P.js} +1 -1
  199. package/dist/chunks/rule-inspect-MKQE5IVJ.js +8 -0
  200. package/dist/chunks/{schema-BEUO7G52.js → schema-TFN5PSYE.js} +2 -2
  201. package/dist/chunks/schema-XFER2RCF.js +14 -0
  202. package/dist/chunks/select-org-PFTR6HQZ.js +7 -0
  203. package/dist/chunks/set-KWOZNGRL.js +7 -0
  204. package/dist/chunks/setup-and-link-BRYK42L7.js +7 -0
  205. package/dist/chunks/{skills-4J2NC2QI.js → skills-2MOFBKIE.js} +2 -2
  206. package/dist/chunks/tags-BHZUQTOQ.js +7 -0
  207. package/dist/chunks/{types-SK6J2HFE.js → types-IWO5QLAV.js} +1 -1
  208. package/dist/chunks/{update-25CKNOY5.js → update-LP7ZZUFZ.js} +1 -1
  209. package/dist/commands/build/index.js +2 -2
  210. package/dist/commands/deploy/index.js +8 -8
  211. package/dist/commands/dev/index.js +6 -6
  212. package/dist/commands/env/index.js +3 -3
  213. package/dist/commands/link/index.js +2 -2
  214. package/dist/commands/list/index.js +1 -1
  215. package/dist/commands/project/index.js +10 -10
  216. package/dist/commands-account.js +24 -24
  217. package/dist/commands-ai.js +17 -17
  218. package/dist/commands-blob.js +9 -9
  219. package/dist/commands-core.js +26 -26
  220. package/dist/commands-deployments.js +3 -3
  221. package/dist/commands-flags.js +32 -32
  222. package/dist/commands-integrations.js +103 -88
  223. package/dist/commands-observability.js +7 -7
  224. package/dist/commands-routing.js +29 -29
  225. package/dist/help.js +1 -1
  226. package/dist/index.js +8 -6
  227. package/dist/internal-build.js +2 -2
  228. package/dist/native-download.js +7 -0
  229. package/dist/package.json +61 -61
  230. package/dist/root-help-commands.mjs +1 -1
  231. package/dist/vc.js +306 -140
  232. package/dist/version.mjs +1 -1
  233. package/package.json +55 -54
  234. package/dist/chunks/add-5YZQTIQM.js +0 -8
  235. package/dist/chunks/add-A524QQ2H.js +0 -8
  236. package/dist/chunks/add-V4JMUHKO.js +0 -8
  237. package/dist/chunks/build-K2PVDJZ4.js +0 -7
  238. package/dist/chunks/chunk-2H3SB5RP.js +0 -9
  239. package/dist/chunks/chunk-2PKEEQ5W.js +0 -25
  240. package/dist/chunks/chunk-3AYYFYZG.js +0 -7
  241. package/dist/chunks/chunk-4UGHFESV.js +0 -8
  242. package/dist/chunks/chunk-5IASAERQ.js +0 -7
  243. package/dist/chunks/chunk-6VH56CX2.js +0 -19
  244. package/dist/chunks/chunk-76KGQU2G.js +0 -7
  245. package/dist/chunks/chunk-7HV7O6DM.js +0 -7
  246. package/dist/chunks/chunk-ABZEMNDR.js +0 -7
  247. package/dist/chunks/chunk-APZULWJC.js +0 -8
  248. package/dist/chunks/chunk-AWMQGOS2.js +0 -7
  249. package/dist/chunks/chunk-B4UE4LVE.js +0 -7
  250. package/dist/chunks/chunk-B4YYOSPY.js +0 -7
  251. package/dist/chunks/chunk-E2SADN6I.js +0 -7
  252. package/dist/chunks/chunk-GVTXA6HG.js +0 -7
  253. package/dist/chunks/chunk-GYVJIIYL.js +0 -7
  254. package/dist/chunks/chunk-IA3MXJRC.js +0 -8
  255. package/dist/chunks/chunk-IEPW2YRH.js +0 -7
  256. package/dist/chunks/chunk-KH6565YH.js +0 -8
  257. package/dist/chunks/chunk-L4NSF346.js +0 -22
  258. package/dist/chunks/chunk-LJBUJ23M.js +0 -7
  259. package/dist/chunks/chunk-LT3UK4K6.js +0 -10
  260. package/dist/chunks/chunk-LUBUI5GF.js +0 -7
  261. package/dist/chunks/chunk-OKEBIUKZ.js +0 -7
  262. package/dist/chunks/chunk-PFNYWWLI.js +0 -7
  263. package/dist/chunks/chunk-QZX7VG2V.js +0 -9
  264. package/dist/chunks/chunk-RUXO73ON.js +0 -7
  265. package/dist/chunks/chunk-SLI2O5X7.js +0 -63
  266. package/dist/chunks/chunk-TPNOSQZ3.js +0 -15
  267. package/dist/chunks/chunk-UKQMYTWW.js +0 -9
  268. package/dist/chunks/chunk-UNEGQPD3.js +0 -7
  269. package/dist/chunks/chunk-V7BEC3E4.js +0 -10
  270. package/dist/chunks/chunk-VOCZ34ON.js +0 -7
  271. package/dist/chunks/chunk-WGXKX24Q.js +0 -7
  272. package/dist/chunks/chunk-YHQ7PPXP.js +0 -7
  273. package/dist/chunks/clear-ZS4KQ7OT.js +0 -8
  274. package/dist/chunks/compile-vercel-config-3IYM2CHC.js +0 -7
  275. package/dist/chunks/config-N2SBVW4T.js +0 -8
  276. package/dist/chunks/config-ZFIC7N4D.js +0 -7
  277. package/dist/chunks/delete-2ZE2NVHI.js +0 -10
  278. package/dist/chunks/delete-AL57HZDQ.js +0 -9
  279. package/dist/chunks/detect-services-MOXTX5XG.js +0 -7
  280. package/dist/chunks/disable-MKI3BKNH.js +0 -7
  281. package/dist/chunks/discard-SI4H7ST3.js +0 -14
  282. package/dist/chunks/edit-DNWH6SPE.js +0 -8
  283. package/dist/chunks/edit-WYNWDFUJ.js +0 -9
  284. package/dist/chunks/enable-J6MMYPYF.js +0 -7
  285. package/dist/chunks/future-FFOGTKMF.js +0 -7
  286. package/dist/chunks/generate-cert-for-deploy-YZKNGAEQ.js +0 -7
  287. package/dist/chunks/image-7METSS6F.js +0 -7
  288. package/dist/chunks/import-builders-GM2SERWV.js +0 -7
  289. package/dist/chunks/inspect-H2Q7XOWN.js +0 -13
  290. package/dist/chunks/inspect-H5JC2XKI.js +0 -9
  291. package/dist/chunks/list-ELEUTZWJ.js +0 -12
  292. package/dist/chunks/list-WWU734RK.js +0 -16
  293. package/dist/chunks/login-R5NQRPQC.js +0 -7
  294. package/dist/chunks/login-ZF2TLCQB.js +0 -9
  295. package/dist/chunks/logs-UD7FEXZ7.js +0 -7
  296. package/dist/chunks/ls-5ZEAKKPQ.js +0 -8
  297. package/dist/chunks/ls-IXRLAJ4L.js +0 -11
  298. package/dist/chunks/mutate-OQWOKLIW.js +0 -9
  299. package/dist/chunks/notifications-KFZ333V5.js +0 -7
  300. package/dist/chunks/open-HH6K7ZRC.js +0 -7
  301. package/dist/chunks/openapi-JGYEFJJV.js +0 -7
  302. package/dist/chunks/permissions-ZSHKMXBZ.js +0 -7
  303. package/dist/chunks/prompt-missing-credentials-KOA7C4QC.js +0 -7
  304. package/dist/chunks/publish-FPNQ2US4.js +0 -15
  305. package/dist/chunks/pull-7OGOIKB3.js +0 -7
  306. package/dist/chunks/purchase-domain-if-available-F4LKHVBD.js +0 -7
  307. package/dist/chunks/push-NY3SIK2C.js +0 -7
  308. package/dist/chunks/reauthenticate-OZRQFR66.js +0 -7
  309. package/dist/chunks/reorder-4J2STFUS.js +0 -10
  310. package/dist/chunks/reply-EO4NTTPW.js +0 -9
  311. package/dist/chunks/resolve-RPHHRPNM.js +0 -12
  312. package/dist/chunks/resolve-agent-team-KX77HEAF.js +0 -7
  313. package/dist/chunks/restore-TEA6TSVK.js +0 -16
  314. package/dist/chunks/rm-BPILSPUI.js +0 -8
  315. package/dist/chunks/rm-F6XVUDBM.js +0 -8
  316. package/dist/chunks/rm-JCPXV2FN.js +0 -8
  317. package/dist/chunks/rm-LPQRGX7N.js +0 -8
  318. package/dist/chunks/rm-WHUGT6TE.js +0 -8
  319. package/dist/chunks/rule-inspect-BOETGPFO.js +0 -8
  320. package/dist/chunks/schema-YOEAK4VX.js +0 -14
  321. package/dist/chunks/select-org-OMLGQEKK.js +0 -7
  322. package/dist/chunks/set-5XY27S7R.js +0 -7
  323. package/dist/chunks/setup-and-link-A7M3QT52.js +0 -7
  324. package/dist/chunks/tags-ZXZQEXOV.js +0 -7
@@ -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_ms}from"./chunk-MXTC4ZAQ.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{AGENT_REASON,outputAgentError}from"./chunk-DGYHWXD2.js";import{findProjectsFromPath,getConfigFilePath,getLinkFromDir,getRepoLink,getUser,getVercelDirectory,inspectTokenRequest,processInspectTokenResponse}from"./chunk-KNLGWGUE.js";import{getTeamByIdOrSlug}from"./chunk-F53OKXYI.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-6VH56CX2.js";import{output_manager_default,require_build_utils}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function getAppTokenTeamId(client){try{await getUser(client);return}catch{let token=await introspectToken(client).catch(()=>null);return token&&resolveAppFromToken(token)?token.team?.id:void 0}}function assertOrgIdMatchesAppTeam(client,appTeamId){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(!envOrgId||envOrgId===appTeamId)return;let message=`This token only works with team ${appTeamId}, but VERCEL_ORG_ID is set to ${envOrgId}.`;throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}var VERCEL_TEAM_SLUG="vercel";function isVercelianFromLoadedTeams(client){return client.teams?.some(team=>team.slug===VERCEL_TEAM_SLUG)===!0}async function isVercelian(client){if(isVercelianFromLoadedTeams(client))return!0;try{return(await getTeams(client)).some(team=>team.slug===VERCEL_TEAM_SLUG)}catch{return!1}}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils2=__toESM(require_build_utils(),1);import{relative}from"path";var import_cli_config2=__toESM(require_cli_config(),1);function isEligibleForNativeBinaryAutoOptIn(client){return isVercelianFromLoadedTeams(client)}function autoOptInNativeBinary(client){let envOverride=process.env.VERCEL_CLI_USE_NATIVE_BINARY;if(!(envOverride==="false"||envOverride==="0"||typeof client.config.useNativeBinary=="boolean"||client.config.nativeBinaryAutoOptIn===!0||!isEligibleForNativeBinaryAutoOptIn(client)))try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config2.readGlobalConfigFile)(configPath);if(typeof savedConfig.useNativeBinary=="boolean"||savedConfig.nativeBinaryAutoOptIn===!0)return;let config={...savedConfig,nativeBinaryAutoOptIn:!0};(0,import_cli_config2.writeGlobalConfigFile)(configPath,config),client.config={...client.config,nativeBinaryAutoOptIn:!0}}catch{output_manager_default.debug("Failed to persist automatic native binary enrollment.")}}async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client);user&&autoOptInNativeBinary(client);let defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils2.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{introspectToken,isAppPrincipalEnabled,resolveAppFromToken,getAppTokenTeamId,assertOrgIdMatchesAppTeam,resolveAppTokenScope,isVercelian,autoOptInNativeBinary,forgetCachedTeamSlug,getScope,getContextName,getLocalOrgId,scopeFlagPassed,detectExplicitScope};
@@ -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{packageName}from"./chunk-JESNVRVR.js";var loginCommand={name:"login",aliases:[],description:"Sign in to your Vercel account.",arguments:[{name:"email or team id",required:!1}],options:[{name:"github",description:"Log in with GitHub",shorthand:null,type:Boolean,deprecated:!0},{name:"oob",description:'Log in with "out of band" authentication',shorthand:null,type:Boolean,deprecated:!0},{name:"gitlab",shorthand:null,type:Boolean,deprecated:!0},{name:"bitbucket",shorthand:null,type:Boolean,deprecated:!0},{name:"future",description:"Sign in using OAuth Device Authorization",shorthand:null,type:Boolean,deprecated:!0}],examples:[{name:"Sign in to your Vercel account.",value:`${packageName} login`}],disabledGlobalOptions:["token"]};export{loginCommand};
@@ -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{environmentOption,formatOption,jsonOption,projectOption,sinceOption,untilOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var schemaSubcommand={name:"schema",aliases:[],description:"List available metrics or inspect a specific metric.",arguments:[{name:"metric-or-prefix",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List all metrics",value:`${packageName} metrics schema`},{name:"Show metric details",value:`${packageName} metrics schema vercel.function_invocation`},{name:"Schema as JSON for agents",value:`${packageName} metrics schema vercel.request.count --json`}]},metricsCommand={name:"metrics",aliases:[],description:"Query observability metrics for your Vercel project or team.",arguments:[{name:"metric-id",required:!1}],subcommands:[{name:"query",aliases:[],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},schemaSubcommand],options:[{name:"aggregation",shorthand:null,deprecatedShorthand:"a",type:String,deprecated:!1,description:"Aggregation function (default: sum for counts/bytes/currency, avg for durations/memory/ratios)",argument:"FN"},{name:"group-by",shorthand:null,type:[String],deprecated:!1,description:"Dimensions to group by (repeatable)",argument:"DIM"},{name:"limit",shorthand:null,deprecatedShorthand:"l",type:Number,deprecated:!1,description:"Max groups per time bucket (default: 10)",argument:"N"},{name:"order-by",shorthand:null,type:String,deprecated:!1,description:"Order grouped results by value or count (default: count, or value when count is unsupported)",argument:"value|count"},{name:"order",shorthand:null,type:String,deprecated:!1,description:"Order direction for grouped results: asc or desc (default: desc)",argument:"asc|desc"},{name:"filter",shorthand:null,deprecatedShorthand:"f",type:[String],deprecated:!1,get description(){return process.env.FF_LEGACY_METRICS?"OData filter expression (repeatable, ANDed together)":"KQL filter expression (repeatable, ANDed together)"},argument:"EXPR"},{...environmentOption,description:"Limit the query to one environment, such as production or preview"},{name:"prod",shorthand:null,type:Boolean,deprecated:!0,description:"Deprecated alias for `--environment production`"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption,{name:"granularity",shorthand:null,deprecatedShorthand:"g",type:String,deprecated:!1,description:"Time bucket size: 5m, 15m, 1h, 1d (default: auto)",argument:"SIZE"},{name:"bucket-timezone",shorthand:null,type:String,deprecated:!1,description:"IANA timezone for calendar bucket alignment only; does not shift --since/--until or output timestamps (e.g., Europe/Paris)",argument:"ZONE"},{...projectOption,shorthand:"p"},{name:"all",shorthand:null,type:Boolean,deprecated:!1,description:"Query across all projects for the team"},formatOption,jsonOption],get examples(){let canonical=!process.env.FF_LEGACY_METRICS,httpStatus=canonical?"httpStatus":"http_status",errorCode=canonical?"errorCode":"error_code",aiProvider=canonical?"aiProvider":"ai_provider",aiGatewayCostMetric=canonical?"vercel.ai_gateway.request.cost":"vercel.ai_gateway_request.cost",pageViewMetric=canonical?"vercel.analytics.page_view.count":"vercel.analytics_pageview.count",visitorId=canonical?"visitorId":"visitor_id",projectId=canonical?"projectId":"project_id",statusFilter=canonical?"httpStatus >= 500":"http_status ge 500",routeFilter=canonical?`'route:"/api"'`:`"contains(request_path, '/api')"`;return[{name:"5xx errors by error code in the last hour",value:`${packageName} metrics vercel.function_invocation.count --filter "${statusFilter}" --group-by ${errorCode} --since 1h`},{name:"Function invocations by HTTP status code",value:`${packageName} metrics vercel.function_invocation.count --group-by ${httpStatus} --since 6h`},{name:"Function duration by route",value:`${packageName} metrics vercel.function_invocation.function_duration_ms --aggregation avg --group-by route --since 1h`},{name:"AI Gateway costs by provider",value:`${packageName} metrics ${aiGatewayCostMetric} --aggregation sum --group-by ${aiProvider} --since 7d`},{name:"Core Web Vitals (LCP) by route",value:`${packageName} metrics vercel.speed_insights.lcp_ms --aggregation p75 --environment production --group-by route --since 7d`},{name:"Routes with the lowest p75 LCP",value:`${packageName} metrics vercel.speed_insights.lcp_ms --aggregation p75 --environment production --group-by route --since 7d --order-by value --order asc`},{name:canonical?"Daily pageviews":"Daily pageviews with a Paris-aligned bucket",value:canonical?`${packageName} metrics ${pageViewMetric} --since 7d --granularity 1d`:`${packageName} metrics ${pageViewMetric} --since 7d --granularity 1d --bucket-timezone Europe/Paris`},{name:"Visitors time series from the top 5 countries",value:`${packageName} metrics ${pageViewMetric} --aggregation unique/${visitorId} --group-by country --since 1d --granularity 1h --limit 5`},{name:"List available metrics",value:`${packageName} metrics schema`},{name:"Function executions matching an API route",value:`${packageName} metrics vercel.function_invocation.count --filter ${routeFilter} --group-by route --since 1h`},{name:"Function executions matching multiple filters",value:`${packageName} metrics vercel.function_invocation.count --filter "${statusFilter}" --filter ${routeFilter} --since 1h`},{name:"Show schema for a metric prefix",value:`${packageName} metrics schema vercel.request`},{name:"Team-wide function executions by project",value:`${packageName} metrics --all vercel.function_invocation.count --group-by ${projectId} --since 24h`}]}};export{schemaSubcommand,metricsCommand};
@@ -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{environmentOption,formatOption,jsonOption,projectOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var RULE_ENVIRONMENTS=["any","preview","production"],ruleEnvironmentOption={...environmentOption,description:"Environment the rule applies to (required): production, preview, or any"},lsSubcommand={name:"ls",aliases:["list"],description:"List the Vercel tracing sampling rules for a project",arguments:[],options:[formatOption,jsonOption,projectOption],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"List the sampling rules as JSON",value:`${packageName} traces config ls --json`}]},setSubcommand={name:"set",aliases:[],description:"Enable Vercel tracing and add or replace one sampling rule. The rate is a whole percentage from 1 to 100.",arguments:[{name:"rate",required:!0},{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,formatOption,jsonOption,projectOption],examples:[{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Trace every preview request to one path prefix",value:`${packageName} traces config set 100 /api --environment preview`},{name:"Trace one percent of traffic in every environment",value:`${packageName} traces config set 1 --environment any`}]},rmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove Vercel tracing sampling rules. Without a path prefix, every rule for the environment is removed. Removing the final rule disables tracing.",arguments:[{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,{name:"default",shorthand:null,type:Boolean,deprecated:!1,description:"Remove only the rule that has no path prefix, keeping the per-path rules"},formatOption,jsonOption,projectOption],examples:[{name:"Remove one rule by environment and path prefix",value:`${packageName} traces config remove /api --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`},{name:"Remove only the production rule that covers all paths",value:`${packageName} traces config remove --environment production --default`}]},tracesConfigCommand={name:"config",aliases:[],description:"Manage Vercel tracing sampling rules for a project.",arguments:[],subcommands:[lsSubcommand,setSubcommand,rmSubcommand],options:[],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`}]};export{RULE_ENVIRONMENTS,lsSubcommand,setSubcommand,rmSubcommand,tracesConfigCommand};
@@ -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_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1),CONTROL_CHARACTERS=/[\u0000-\u001F\u007F-\u009F]/g,FORMAT_CHARACTERS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;function remoteText(value){return(0,import_strip_ansi.default)(value).replace(/\r?\n/g,"\\n").replace(CONTROL_CHARACTERS,"").replace(FORMAT_CHARACTERS,"")}export{remoteText};
@@ -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{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-DGYHWXD2.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification}from"./chunk-AWMQGOS2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";function handleCommandTypo({command,availableCommands,threshold=.7,client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(output_manager_default.fatal(payload.message),output_manager_default.print(` ${corrected??payload.hint}
8
- `)),!0}return output_manager_default.error(`${param(command)} is not a valid target directory or subcommand. Did you mean ${param(suggestion)}?`),!0}return!1}export{handleCommandTypo};
@@ -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{AGENT_REASON,AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-DGYHWXD2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";function getRenamedOption(flags,name,oldName,{json=!1}={}){let value=flags[name],oldValue=flags[oldName];if(value!==void 0&&oldValue!==void 0)return{error:`Can't use ${name} with ${oldName}.`};if(value!==void 0&&value.trim()==="")return{error:`${name} can't be empty.`};if(oldValue===void 0)return{value};let message=`${oldName} is deprecated. Use ${name}.`;return json?{value:oldValue,warning:{reason:AGENT_REASON.DEPRECATED,message}}:(output_manager_default.warning(message),{value:oldValue})}function reportRenamedOptionError(client,message,{json=!1}={}){return json||shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}):output_manager_default.error(message),2}function renameOptionInArgs(args,oldName,name){let end=args.indexOf("--");return args.map((arg,index)=>(end===-1||index<end)&&(arg===oldName||arg.startsWith(`${oldName}=`))?`${name}${arg.slice(oldName.length)}`:arg)}export{getRenamedOption,reportRenamedOptionError,renameOptionInArgs};
@@ -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{noBorderChars,require_cli_table3}from"./chunk-773GOZIR.js";import{require_dist}from"./chunk-PUKYAALC.js";import{getShortFlags,globalCommandOptions}from"./chunk-AWMQGOS2.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_constants=__toESM(require_dist(),1),import_cli_table3=__toESM(require_cli_table3(),1);var INDENT=" ".repeat(2),NEWLINE=`
8
- `,tableOptions={chars:noBorderChars,style:{"padding-left":0,"padding-right":0}};function wordWrap(text,maxWidth){let _tableOptions=Object.assign({},tableOptions,{colWidths:[maxWidth],style:{"padding-left":INDENT.length}}),table=new import_cli_table3.default(_tableOptions);return table.push([{content:text,wordWrap:!0}]),table.toString()}function lineToString(line){let string="";for(let i=0;i<line.length;i++)if(i===line.length-1)string+=line[i];else{let curr=line[i],next=line[i+1];string+=curr,curr.trim()!==""&&next.trim()!==""&&(string+=" ")}return string}function outputArrayToString(outputArray){return outputArray.filter(line=>line!==null).join(NEWLINE)}var commandPaths=new WeakMap;function registerCommandPaths(roots){let visit=(command,parentPath)=>{let path=[...parentPath,command.name];commandPaths.has(command)||commandPaths.set(command,path);for(let subcommand of command.subcommands??[])visit(subcommand,path)};for(let root of roots)visit(root,[])}function getCommandPath(command,parent){let registered=commandPaths.get(command);return registered||(parent?[parent.name,command.name]:[command.name])}function buildCommandSynopsisLine(command,parent){let line=[INDENT,import_constants.LOGO,import_chalk.default.bold(import_constants.NAME)];for(let name of getCommandPath(command,parent))line.push(import_chalk.default.bold(name));let args=command.arguments.slice(0);if(args.length===0&&command.subcommands&&command.subcommands.length>0&&args.push({name:"command",required:!command.subcommands.some(subcommand=>subcommand.default)}),args.length>0)for(let argument of args){let{name}=argument;argument.multiple&&(name+=" ..."),line.push(argument.required?name:`[${name}]`)}return command.options.length>0&&line.push("[options]"),line.push(NEWLINE),lineToString(line)}function buildCommandOptionLines(commandOptions,options,sectionTitle){let filteredCommandOptions=commandOptions.filter(option=>!option.deprecated&&option.description!==void 0);if(filteredCommandOptions.length===0)return null;filteredCommandOptions.sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0);let maxWidthOfUnwrappedColumns=0,rows=[];for(let option of filteredCommandOptions){let shorthandCell=option.shorthand?`${INDENT}-${option.shorthand},`:"",longhandCell=`${INDENT}--${option.name}`;option.argument&&(longhandCell+=` <${option.argument}>`),longhandCell+=INDENT;let widthOfUnwrappedColumns=shorthandCell.length+longhandCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([shorthandCell,longhandCell,{content:option.description,wordWrap:!0}])}let finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return table.push(...rows),[`${INDENT}${import_chalk.default.dim(sectionTitle)}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join("")}function buildSubcommandLines(subcommands,options,title="Commands"){if(!subcommands)return null;let maxWidthOfUnwrappedColumns=0,rows=[];for(let command of subcommands){if(command.hidden)continue;let nameCell=`${INDENT}${command.name}`,argsCell=INDENT;argsCell+=command.arguments.map(arg=>arg.required?arg.name:`[${arg.name}]`).join(" "),argsCell+=INDENT;let widthOfUnwrappedColumns=nameCell.length+argsCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([nameCell,argsCell,{content:command.default?`${command.summary??command.description} ${import_chalk.default.bold("(default)")}`:command.summary??command.description,wordWrap:!0}])}let rightMargin=INDENT.repeat(4).length,finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns-rightMargin,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return rows.length===0?null:(table.push(...rows),[`${INDENT}${import_chalk.default.dim(title)}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join(""))}function buildCommandExampleLines(command){if(!command.examples?.length)return null;let outputArray=[`${INDENT}${import_chalk.default.dim("Examples:")}`,""];for(let example of command.examples){let nameLine=[INDENT];nameLine.push(import_chalk.default.gray("-")),nameLine.push(example.name),outputArray.push(lineToString(nameLine)),outputArray.push("");let buildValueLine=value=>lineToString([INDENT,INDENT,import_chalk.default.cyan(`$ ${value}`)]);if(Array.isArray(example.value))for(let line of example.value)outputArray.push(buildValueLine(line));else outputArray.push(buildValueLine(example.value));outputArray.push("")}return outputArrayToString(outputArray)}function buildCommandDocumentationLines(command,options){if(options.omitDocumentation)return null;let documentation=command.documentation??options.parent?.documentation;return documentation?outputArrayToString([`${INDENT}${import_chalk.default.dim(`${documentation.label}:`)}`,"",lineToString([INDENT,INDENT,import_chalk.default.cyan(documentation.url)]),""]):null}function buildDescriptionLine(command,options){return`${wordWrap(command.description,options.columns)}${NEWLINE}`}function buildHelpOutput(command,options){let filteredGlobalOptions=command.disabledGlobalOptions?globalCommandOptions.filter(opt=>!command.disabledGlobalOptions?.includes(opt.name)):globalCommandOptions,sections=command.helpSections??[],buildSection=section=>outputArrayToString([`${INDENT}${import_chalk.default.dim(`${section.title}:`)}`,"",...section.body.map(line=>line===""?"":wordWrap(line,options.columns)),""]),outputArray=["",buildCommandSynopsisLine(command,options.parent),buildDescriptionLine(command,options),buildSubcommandLines(command.subcommands,options,command.subcommandsTitle),buildCommandOptionLines(command.options,options,"Options"),...sections.filter(section=>section.placement==="afterOptions").map(buildSection),buildCommandOptionLines(filteredGlobalOptions,options,"Global Options"),buildCommandExampleLines(command),...sections.filter(section=>section.placement!=="afterOptions").map(buildSection),buildCommandDocumentationLines(command,options),""];return outputArrayToString(outputArray)}function help(command,options){return buildHelpOutput(command,{...options,columns:options.columns??80})}function findOption(token,options){return token.startsWith("--")?options.find(candidate=>candidate.name===token.slice(2)):options.find(candidate=>getShortFlags(candidate).includes(token))}function subtreeOptions(command){return[...command.options,...(command.subcommands??[]).flatMap(subtreeOptions)]}function isSubcommandOf(command,token){return token!==void 0&&(command.subcommands??[]).some(subcommand=>subcommand.name===token||subcommand.aliases.includes(token))}function optionTakesValue(token,walkedOptions,command,nextToken){let walked=findOption(token,walkedOptions);if(walked)return walked.type!==Boolean;let below=findOption(token,subtreeOptions(command)),global=findOption(token,globalCommandOptions);return below&&below.type!==Boolean&&(!global||global.type!==Boolean||!isSubcommandOf(command,nextToken))?!0:global!==void 0&&global.type!==Boolean}function resolveHelpTarget(root,tokens){let command=root,ancestors=[],typedPath=[],options=[...root.options],groupArguments=0,unknownSegment;for(let i=0;i<tokens.length;i++){let token=tokens[i];if(token==="--")break;if(token.startsWith("-")){!token.includes("=")&&optionTakesValue(token,options,command,tokens[i+1])&&i++;continue}let subcommand=command.subcommands?.find(candidate=>candidate.name===token||candidate.aliases.includes(token));if(!subcommand){if(command.argumentsBeforeSubcommand&&groupArguments<command.arguments.length){groupArguments++;continue}command.subcommands?.length&&command.arguments.length===0&&!command.runsWithoutSubcommand&&!command.subcommands.some(candidate=>candidate.default)&&(unknownSegment=token);break}ancestors.push(command),typedPath.push(token),options.push(...subcommand.options),command=subcommand,groupArguments=0}let parent=ancestors[ancestors.length-1];for(let i=ancestors.length-1;i>=0;i--)if(ancestors[i].documentation){parent=ancestors[i];break}return{command,parent,typedPath,unknownSegment}}export{registerCommandPaths,buildCommandDocumentationLines,help,resolveHelpTarget};
@@ -1,22 +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_open}from"./chunk-PVASGBEF.js";import{printError}from"./chunk-G4T7VBGN.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{deviceAccessTokenRequest,deviceAuthorizationRequest,getUser,humanizePath,isOAuthError,processDeviceAuthorizationResponse,processTokenResponse}from"./chunk-KNLGWGUE.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{emoji,output_manager_default}from"./chunk-XP3FT56R.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),open=__toESM(require_open(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import readline from"node:readline";import{KNOWN_AGENTS}from"@vercel/detect-agent";async function updateCurrentTeamAfterLogin(client,ssoTeamId){if(ssoTeamId)client.updateConfig({currentTeam:ssoTeamId});else{let user=null;try{user=await getUser(client)}catch{return output_manager_default.error("Failed to fetch the logged in user. Please try again."),1}client.updateConfig({currentTeam:user.version==="northstar"&&user.defaultTeamId?user.defaultTeamId:void 0})}}function getSignupVerificationUrl(verificationUriComplete,email){let deviceUrl=new URL(verificationUriComplete),signupUrl=new URL("/signup",deviceUrl.origin);return signupUrl.searchParams.set("email",email),signupUrl.searchParams.set("autoSubmit","1"),signupUrl.searchParams.set("next",`${deviceUrl.pathname}${deviceUrl.search}`),signupUrl.toString()}async function performDeviceCodeFlow(client,options){let deviceAuthorizationResponse=await deviceAuthorizationRequest({refresh_token:options?.refreshToken,acr_values:options?.acrValues});output_manager_default.debug(`'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`);let[deviceAuthorizationError,deviceAuthorization]=await processDeviceAuthorizationResponse(deviceAuthorizationResponse);if(deviceAuthorizationError)return options?.fallbackToLoginOnStepUpFailure&&options.refreshToken&&isOAuthError(deviceAuthorizationError)&&(deviceAuthorizationError.code==="invalid_grant"||deviceAuthorizationError.code==="invalid_scope")?(output_manager_default.debug(`Step-up device authorization failed: ${deviceAuthorizationError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login."),performDeviceCodeFlow(client,options.teamId?{teamId:options.teamId}:void 0)):(printError(isOAuthError(deviceAuthorizationError)?deviceAuthorizationError.cause:deviceAuthorizationError),null);let{device_code,user_code,verification_uri,expiresAt,interval}=deviceAuthorization,{verification_uri_complete}=deviceAuthorization;if(options?.teamId){let url=new URL(verification_uri_complete);url.searchParams.set("team_id",options.teamId),verification_uri_complete=url.toString()}let isCursorAgent=client.agentName===KNOWN_AGENTS.CURSOR||client.agentName===KNOWN_AGENTS.CURSOR_CLI,shouldSkipBrowser=process.env.CI&&!isCursorAgent,browserUrl=verification_uri_complete;if(options?.signupEmail?(browserUrl=getSignupVerificationUrl(verification_uri_complete,options.signupEmail),output_manager_default.log(`
8
- Visit ${import_chalk.default.bold(output_manager_default.link(new URL(browserUrl).host+"/signup",browserUrl,{color:!1,fallback:()=>browserUrl}))} to create your account with ${import_chalk.default.bold(options.signupEmail)} (device code ${import_chalk.default.bold(user_code)}).
9
- `)):output_manager_default.log(`
10
- Visit ${import_chalk.default.bold(output_manager_default.link(verification_uri.replace("https://",""),verification_uri_complete,{color:!1,fallback:()=>verification_uri_complete}))}${output_manager_default.supportsHyperlink?` and enter ${import_chalk.default.bold(user_code)}`:""}
11
- `),!shouldSkipBrowser)try{(await open.default(browserUrl)).on("error",error=>{output_manager_default.debug(`Failed to open browser: ${error}`)})}catch(error){output_manager_default.debug(`Failed to open browser: ${error}`),client.isAgent&&client.nonInteractive&&(output_manager_default.log(`
12
- ${import_chalk.default.yellow("\u26A0")} ${import_chalk.default.bold("Browser could not be opened automatically.")}
13
- `),output_manager_default.log(`Please ask the user to manually visit the URL above and complete the authentication process.
14
- `))}let rl=readline.createInterface({input:process.stdin,output:process.stdout}).on("SIGINT",()=>{process.exit(0)});output_manager_default.spinner("Waiting for authentication...");let intervalMs=interval*1e3,result=null,flowError=new Error("Timed out waiting for authentication. Please try again.");async function pollForToken(){for(;Date.now()<expiresAt;){let[tokenResponseError,tokenResponse]=await deviceAccessTokenRequest({device_code});if(tokenResponseError){if(tokenResponseError.message.includes("timeout")){intervalMs*=2,output_manager_default.debug(`Connection timeout. Slowing down, polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue}return tokenResponseError}output_manager_default.debug(`'Device Access Token response:', ${await tokenResponse.clone().text()}`);let[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)){let{code}=tokensError;switch(code){case"authorization_pending":await wait(intervalMs);continue;case"slow_down":intervalMs+=5*1e3,output_manager_default.debug(`Authorization server requests to slow down. Polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue;default:return tokensError.cause}}if(tokensError)return tokensError;output_manager_default.print((0,import_ansi_escapes.eraseLines)(2)),result={access_token:tokens.access_token,expires_in:tokens.expires_in,refresh_token:tokens.refresh_token};return}}return flowError=await pollForToken(),output_manager_default.stopSpinner(),rl.close(),flowError?(printError(flowError),null):result}async function login(client,telemetry,standalone=!0){let tokens=await performDeviceCodeFlow(client);return tokens?(await saveDeviceCodeTokens(client,tokens),standalone?output_manager_default.print(`
15
- ${import_chalk.default.cyan("Congratulations!")} You are now signed in.
16
-
17
- To deploy something, run ${getCommandName()}.
18
- To set up the Vercel plugin and connect your coding agents to the AI Gateway, run ${getCommandName("setup")}.
19
-
20
- ${emoji("tip")} To deploy every commit automatically,
21
- connect a Git Repository (${import_chalk.default.bold(output_manager_default.link("vercel.link/git","https://vercel.link/git",{color:!1}))}).
22
- `):output_manager_default.success("Logged in."),telemetry.trackState("success"),0):(telemetry.trackState("error"),1)}async function saveDeviceCodeTokens(client,tokens){let runTeam=client.config.currentTeam,previousTeamId=client.ignoresSavedTeam?client.savedTeam:runTeam;if(client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),previousTeamId){let isMember=!0;try{isMember=(await getTeams(client)).some(team=>team.id===previousTeamId)}catch{}isMember||(output_manager_default.warn("Your previously selected team is no longer accessible; switching to your default scope."),client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client))}else client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client);client.persistAuthConfig(),client.writeToConfigFile(),client.ignoresSavedTeam&&(client.config.currentTeam=runTeam),output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`)}async function wait(intervalMs){await new Promise(resolve=>setTimeout(resolve,intervalMs))}export{getSignupVerificationUrl,performDeviceCodeFlow,login,saveDeviceCodeTokens};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{require_dist}from"./chunk-PUKYAALC.js";import{deploymentOption,environmentOption,forceOption,formatOption,gitBranchOption,jsonOption,projectOption,warnDeprecatedInput,yesOption}from"./chunk-AWMQGOS2.js";import{packageName,require_lib}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_constants=__toESM(require_dist(),1),import_title=__toESM(require_lib(),1);var envTargetChoices=import_constants.PROJECT_ENV_TARGET.map(t=>({name:(0,import_title.default)(t),value:t}));function isValidEnvTarget(target){return typeof target>"u"||envTargetChoices.map(c=>c.value).includes(target)}function getEnvTargetPlaceholder(){return`<${envTargetChoices.map(c=>c.value).join(" | ")}>`}function parseEnvTargetArg(arg){return Array.from(new Set(arg.split(",").map(t=>t.trim()).filter(Boolean)))}function resolveEnvTargetInput(client,input){let environment=Array.isArray(input.environment)?input.environment.join(","):input.environment;return input.legacyEnvironment!==void 0&&environment!==void 0?{error:"Can't use an environment argument with --environment. Use --environment, and --git-branch for a Git branch."}:input.legacyGitBranch!==void 0&&input.gitBranch!==void 0?{error:"Can't use a Git branch argument with --git-branch. Use --git-branch."}:(input.legacyEnvironment!==void 0&&warnDeprecatedInput(client,"The environment argument","--environment"),input.legacyGitBranch!==void 0&&warnDeprecatedInput(client,"The Git branch argument","--git-branch"),{environment:environment??input.legacyEnvironment,gitBranch:input.gitBranch??input.legacyGitBranch})}var targetPlaceholder=getEnvTargetPlaceholder(),listSubcommand={name:"list",aliases:["ls"],description:"List all Environment Variables for a Project",arguments:[],options:[{...environmentOption,description:"List only the variables for this environment"},{...gitBranchOption,description:"List only the variables for this Git branch"},{...formatOption,description:"Specify the output format (json, including readable Environment Variable values)"},{...jsonOption,description:"Output as JSON, including readable Environment Variable values"},projectOption,{name:"guidance",description:"Receive command suggestions once command is complete",shorthand:null,type:Boolean,deprecated:!1}],examples:[]},addSubcommand={name:"add",aliases:[],description:"Add an Environment Variable",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,type:[String],description:"Environments to add the variable to; repeatable or comma-separated. Prompts when omitted"},{...gitBranchOption,description:"Set the Git branch for a Preview Environment Variable"},{name:"sensitive",description:"Store the value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"no-sensitive",description:"Store the value as Config",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...forceOption,description:"Overwrite an existing variable in the same environment",shorthand:null},{...yesOption,description:"Accept default choices when adding an Environment Variable"},{name:"guidance",description:"Show command suggestions after completion",shorthand:null,type:Boolean,deprecated:!1},{name:"value",description:"Set the variable value for non-interactive use; otherwise use stdin or the prompt",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Add a new variable (prompts for value and Environments)",value:[`${packageName} env add <name>`,`${packageName} env add API_TOKEN`]},{name:"Add a new Environment Variable to a specific Environment",value:[`${packageName} env add <name> --environment ${targetPlaceholder}`,`${packageName} env add DB_PASS --environment production`]},{name:"Add one variable to multiple Environments (comma-separated)",value:[`${packageName} env add <name> --environment <environment>[,<environment>]`,`${packageName} env add API_URL --environment production,preview,development`]},{name:"Override an existing Environment Variable in the same environment (production, preview, development)",value:`${packageName} env add API_TOKEN --force`},{name:"Add a Config Environment Variable that remains readable later",value:`${packageName} env add API_TOKEN --no-sensitive`},{name:"Add a new Environment Variable for a specific Environment and Git Branch",value:[`${packageName} env add <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`,`${packageName} env add DB_PASS --environment preview --git-branch feat1`]},{name:"Add a new Environment Variable from stdin",value:[`cat <file> | ${packageName} env add <name> --environment ${targetPlaceholder}`,`cat ~/.npmrc | ${packageName} env add NPM_RC --environment preview`,`${packageName} env add API_URL --environment production < url.txt`]},{name:"Add with --value for non-interactive use",value:`${packageName} env add API_TOKEN --environment production --value "<value>" --yes`}]},removeSubcommand={name:"remove",aliases:["rm"],description:"Remove an Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Remove the variable from this environment only. Without it, the variable is removed from all of its environments"},{...gitBranchOption,description:"Remove the variable for this Git branch only"},{...yesOption,description:"Skip the confirmation prompt when removing an Environment Variable"}],examples:[{name:"Remove a variable from multiple Environments",value:[`${packageName} env remove <name>`,`${packageName} env remove API_TOKEN`]},{name:"Remove a variable from a specific Environment",value:[`${packageName} env remove <name> --environment ${targetPlaceholder}`,`${packageName} env remove NPM_RC --environment preview`]},{name:"Remove a variable from a specific Environment and Git Branch",value:[`${packageName} env remove <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`,`${packageName} env remove NPM_RC --environment preview --git-branch feat1`]}]},pullSubcommand={name:"pull",aliases:[],description:"Pull Environment Variables into a local file (default: .env.local)",arguments:[{name:"filename",required:!1}],options:[projectOption,{name:"environment",description:"Select the environment to pull (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"},{...deploymentOption,description:"Pull Environment Variables for a specific deployment (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when overwriting an existing file"}],examples:[{name:"Pull Development Environment Variables into a custom file (check .gitignore)",value:[`${packageName} env pull <file>`,`${packageName} env pull .env.development.local`]},{name:"Pull Environment Variables for a specific deployment",value:`${packageName} env pull --deployment dpl_xxx`}]},runSubcommand={name:"run",aliases:[],description:"Run a command with environment variables from the linked Vercel project",arguments:[{name:"command",required:!0,multiple:!0}],options:[projectOption,{name:"environment",description:"Specify the environment to pull variables from (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"}],examples:[{name:"Run Next.js dev server with development environment variables",value:`${packageName} env run -- next dev`},{name:"Run tests with preview environment variables for a specific branch",value:`${packageName} env run -e preview --git-branch feature-x -- npm test`}]},updateSubcommand={name:"update",aliases:[],description:"Update the value of an existing Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Pick the variable to update by an environment it covers. The new value applies to all of its environments"},{...gitBranchOption,description:"Pick the variable to update by its Git branch"},{name:"sensitive",description:"Store the updated value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when updating an Environment Variable"},{name:"value",description:"New value for the variable (non-interactive). Otherwise use stdin or you will be prompted.",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Update a variable in all Environments",value:[`${packageName} env update <name>`,`${packageName} env update API_TOKEN`]},{name:"Update the variable that covers a specific Environment",value:[`${packageName} env update <name> --environment ${targetPlaceholder}`,`${packageName} env update DB_PASS --environment production`]},{name:"Update the variable for a specific Environment and Git Branch",value:[`${packageName} env update <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`,`${packageName} env update NPM_RC --environment preview --git-branch feat1`]},{name:"Update a variable from stdin",value:[`cat <file> | ${packageName} env update <name> --environment ${targetPlaceholder}`,`cat ~/.npmrc | ${packageName} env update NPM_RC --environment preview`,`${packageName} env update API_URL --environment production < url.txt`]}]},envCommand={name:"env",aliases:[],description:"Interact with Environment Variables for a Project",arguments:[],subcommands:[addSubcommand,listSubcommand,pullSubcommand,removeSubcommand,runSubcommand,updateSubcommand],options:[],examples:[{name:"Run a command with Environment Variables from the linked Project",value:`${packageName} env run -- <command>`},{name:"Add one variable to multiple Environments",value:`${packageName} env add API_URL production,preview,development`}]};export{envTargetChoices,isValidEnvTarget,getEnvTargetPlaceholder,parseEnvTargetArg,resolveEnvTargetInput,listSubcommand,addSubcommand,removeSubcommand,pullSubcommand,runSubcommand,updateSubcommand,envCommand};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getOrCreateDeploymentProtectionToken}from"./chunk-F2SWJEYV.js";import{ensureLink}from"./chunk-OQCMRU3J.js";import{toHost}from"./chunk-R6BEOVTU.js";import{curlCommand}from"./chunk-TPNOSQZ3.js";import{help}from"./chunk-KH6565YH.js";import{printError}from"./chunk-G4T7VBGN.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{detectExplicitScope,getScope,introspectToken,isAppPrincipalEnabled,resolveAppFromToken}from"./chunk-B4UE4LVE.js";import{getTeams}from"./chunk-FGFLTLEA.js";import{getLinkedProject,getUser}from"./chunk-KNLGWGUE.js";import{getGlobalPathConfig}from"./chunk-BBKEP7RO.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification}from"./chunk-AWMQGOS2.js";import{InvalidToken,isAPIError}from"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{spawn as spawn2}from"child_process";var requoteArgs=arg=>arg.includes(" ")?arg.includes('"')?`'${arg}'`:`"${arg}"`:arg;var CurlTelemetryClient=class extends TelemetryClient{trackCliArgumentPath(path){if(path){let value=path.startsWith("/")?"slash":"no-slash";this.trackCliArgument({arg:"path",value})}}trackCliOptionDeployment(deploymentId){if(deploymentId){let value=deploymentId.startsWith("http://")||deploymentId.startsWith("https://")?"url":deploymentId.startsWith("dpl_")?"dpl_":"no-prefix";this.trackCliOption({option:"deployment",value})}}trackCliOptionProtectionBypass(secret){secret&&this.trackCliOption({option:"protection-bypass",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTrace(trace2){trace2&&this.trackCliFlag("trace")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}trackCliFlagYesOnProduction(value){value&&this.trackCliFlag("yes-on-production")}};var import_chalk=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1);async function getDeploymentAccounts(client){if(detectExplicitScope(client))return client.config.currentTeam?[client.config.currentTeam]:[];if(isAppPrincipalEnabled())try{await getUser(client)}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null);if(!token||!resolveAppFromToken(token))throw err;return token.team?[token.team.id]:[]}let currentTeam=client.config.currentTeam;try{return(await getTeams(client)).filter(team=>!team.limited).map(team=>team.id).sort((a,b)=>+(b===currentTeam)-+(a===currentTeam))}catch(err){if(err instanceof InvalidToken&&currentTeam)return[currentTeam];throw err}}async function resolveDeployment(client,selector,accountId){let hostOrId=selector.includes(".")?toHost(selector):selector,endpoint=`/v13/deployments/${encodeURIComponent(hostOrId)}`,lookup=async accountId2=>{try{let deployment2=await client.fetch(endpoint,{useCurrentTeam:!1,...accountId2?{accountId:accountId2}:{},bailOn429:!0});return deployment2?{...deployment2,ownerId:deployment2.ownerId??deployment2.team?.id}:null}catch(err){if(!isAPIError(err)||err.status!==403&&err.status!==404)throw err;return output_manager_default.debug(`Deployment lookup failed for ${hostOrId}: ${err}`),null}};if(accountId||detectExplicitScope(client))return lookup(accountId??client.config.currentTeam);let deployment=await lookup();if(deployment?.projectId&&deployment.ownerId)return deployment;let accounts;try{accounts=await getDeploymentAccounts(client)}catch(err){if(deployment?.url)return deployment;throw err}for(let account of accounts){let scoped=await lookup(account);if(scoped?.projectId&&scoped.ownerId)return scoped;deployment??=scoped}return deployment}async function getDeploymentUrlById(client,deploymentIdOrUrl,accountId){try{if(deploymentIdOrUrl.startsWith("http://")||deploymentIdOrUrl.startsWith("https://"))try{return new URL(deploymentIdOrUrl).origin}catch{return output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null}if(deploymentIdOrUrl.includes("vercel.app"))return`https://${deploymentIdOrUrl}`;let fullDeploymentId=deploymentIdOrUrl;fullDeploymentId.startsWith("dpl_")||(fullDeploymentId=`dpl_${deploymentIdOrUrl}`);let deployment=await resolveDeployment(client,fullDeploymentId,accountId);return!deployment||!deployment.url?null:`https://${deployment.url}`}catch(error){return output_manager_default.debug(`Failed to fetch deployment by ID: ${error}`),null}}function looksLikeHostname(path){let firstSegment=path.split("/")[0];return firstSegment.includes(".")&&!firstSegment.startsWith(".")}function orgFromOwner(id,slug=id){return{type:id.startsWith("team_")?"team":"user",id,slug}}var VC_STRING_FLAGS=new Set(["--deployment","--protection-bypass"]),VC_IGNORED_STRING_FLAGS=new Set(["--scope","--team"]),VC_BOOLEAN_FLAGS=new Set(["--yes","--help","--trace","--json"]);function flagName(arg){let eqIdx=arg.indexOf("=");return eqIdx===-1?arg:arg.slice(0,eqIdx)}function flagValue(args,index){let arg=args[index],eqIdx=arg.indexOf("=");if(eqIdx!==-1)return arg.slice(eqIdx+1);let next=args[index+1];return next&&!next.startsWith("-")?next:void 0}function getCurlLikeArgs(rawArgs,commandName){if(rawArgs[0]===commandName)return rawArgs.slice(1);let commandIndex=0;for(;commandIndex<rawArgs.length;){let arg=rawArgs[commandIndex];if(!VC_IGNORED_STRING_FLAGS.has(flagName(arg)))break;commandIndex++,!arg.includes("=")&&commandIndex<rawArgs.length&&commandIndex++}return rawArgs[commandIndex]===commandName?rawArgs.slice(commandIndex+1):[...rawArgs]}function parseCurlLikeArgs(rawArgs,commandName){let result={target:void 0,deployment:void 0,protectionBypass:void 0,yes:!1,help:!1,trace:!1,json:!1,toolFlags:[]},args=getCurlLikeArgs(rawArgs,commandName),separatorIndex=args.indexOf("--"),beforeSeparator=separatorIndex===-1?args:args.slice(0,separatorIndex),afterSeparator=separatorIndex===-1?[]:args.slice(separatorIndex+1);for(let i=0;i<beforeSeparator.length;i++){let arg=beforeSeparator[i],name=flagName(arg);if(VC_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,name==="--deployment"?result.deployment=value:result.protectionBypass=value;continue}if(VC_IGNORED_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++;continue}if(VC_BOOLEAN_FLAGS.has(name)){name==="--yes"?result.yes=!0:name==="--trace"?result.trace=!0:name==="--json"?result.json=!0:result.help=!0;continue}if(!result.target&&name==="--url"){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,result.target=value;continue}!result.target&&!arg.startsWith("-")?result.target=arg:result.toolFlags.push(arg)}return result.toolFlags.push(...afterSeparator),result}function setupCurlLikeCommand(client,command,telemetryClient,options={}){let{print}=output_manager_default;if(options.allowFullUrl){let parsed=parseCurlLikeArgs(options.args??client.argv.slice(2),command.name);if(parsed.help)return print(help(command,{columns:client.stderr.columns})),0;let path2=parsed.target;if(telemetryClient.trackCliArgumentPath(path2),parsed.deployment&&telemetryClient.trackCliOptionDeployment(parsed.deployment),parsed.protectionBypass&&telemetryClient.trackCliOptionProtectionBypass(parsed.protectionBypass),!path2)return output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`),print(help(command,{columns:client.stderr.columns})),2;let isFullUrl2=path2.startsWith("http://")||path2.startsWith("https://");return!isFullUrl2&&looksLikeHostname(path2)&&(isFullUrl2=!0),output_manager_default.debug(`${command.name} flags (${parsed.toolFlags.length} args): ${JSON.stringify(parsed.toolFlags)}`),{path:isFullUrl2&&!path2.startsWith("http")?`https://${path2}`:path2,isFullUrl:isFullUrl2,deploymentFlag:parsed.deployment,protectionBypassFlag:parsed.protectionBypass,toolFlags:parsed.toolFlags,yes:parsed.yes,trace:parsed.trace,json:parsed.json}}let parsedArgs=null,flagsSpecification=getFlagsSpecification(command.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs;if(parsedArgs.flags["--help"])return print(help(command,{columns:client.stderr.columns})),0;parsedArgs.args[0]===command.name&&parsedArgs.args.shift();let separatorIndex=process.argv.indexOf("--"),path=parsedArgs.args[0];telemetryClient.trackCliArgumentPath(path);let deploymentFlag=flags["--deployment"];deploymentFlag&&telemetryClient.trackCliOptionDeployment(deploymentFlag);let protectionBypassFlag=flags["--protection-bypass"];if(protectionBypassFlag&&telemetryClient.trackCliOptionProtectionBypass(protectionBypassFlag),!path||path==="--"||path.startsWith("-"))return options.allowFullUrl?output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`):output_manager_default.error(`${getCommandName(`${command.name} <path>`)} requires an API path (e.g., '/' or '/api/hello' or 'api/hello')`),print(help(command,{columns:client.stderr.columns})),1;let isFullUrl=path.startsWith("http://")||path.startsWith("https://");if(!isFullUrl&&looksLikeHostname(path)&&(isFullUrl=!0),isFullUrl&&!options.allowFullUrl)return output_manager_default.error("The <path> argument must be a relative API path (e.g., '/' or '/api/hello'), not a full URL."),output_manager_default.print("To target a specific deployment within the currently linked project, use the --deployment <id|url> flag."),print(help(command,{columns:client.stderr.columns})),1;let toolFlags=separatorIndex!==-1?process.argv.slice(separatorIndex+1):[];return output_manager_default.debug(`${command.name} flags (${toolFlags.length} args): ${JSON.stringify(toolFlags)}`),{path:isFullUrl&&!path.startsWith("http")?`https://${path}`:path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,yes:!!flags["--yes"],trace:!!flags["--trace"],json:!!flags["--json"]}}async function resolveProjectFromUrl(client,url){let host=toHost(url);try{let deployment=await resolveDeployment(client,host);if(deployment){let link=await linkFromDeployment(client,deployment);if(link)return link}}catch(err){if(output_manager_default.debug(`Deployment lookup failed for ${host}: ${err}`),isAPIError(err)&&err.status===429)return null}try{let aliasUrl=`/now/aliases/${encodeURIComponent(host)}`;try{let alias=await client.fetch(aliasUrl,{useCurrentTeam:!1,...detectExplicitScope(client)?{accountId:client.config.currentTeam}:{}});if(alias.projectId&&alias.ownerId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(alias.projectId)}`,{accountId:alias.ownerId}),org:orgFromOwner(alias.ownerId)}}catch(err){output_manager_default.debug(`User alias lookup failed for ${host}: ${err}`)}for(let accountId of await getDeploymentAccounts(client))try{let alias=await client.fetch(aliasUrl,{accountId}),projectId=alias.projectId,ownerId=alias.ownerId||accountId;if(projectId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:ownerId}),org:orgFromOwner(ownerId)}}catch(err){output_manager_default.debug(`Alias lookup failed for ${host} in ${accountId}: ${err}`)}}catch(err){output_manager_default.debug(`Team lookup failed for ${host}: ${err}`)}return null}async function getFullUrlAndToken(client,fullUrl,protectionBypassFlag){if(protectionBypassFlag)return{fullUrl,deploymentProtectionToken:protectionBypassFlag,link:null};if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET)return output_manager_default.debug("Using protection bypass secret from environment variable"),{fullUrl,deploymentProtectionToken:process.env.VERCEL_AUTOMATION_BYPASS_SECRET,link:null};let link=await resolveProjectFromUrl(client,fullUrl),deploymentProtectionToken=null;if(link)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link)}catch(err){output_manager_default.debug(`Failed to get deployment protection bypass token: ${err}`)}return{fullUrl,deploymentProtectionToken,link}}async function linkFromDeployment(client,deployment){return!deployment.projectId||!deployment.ownerId?null:{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(deployment.projectId)}`,{accountId:deployment.ownerId}),org:orgFromOwner(deployment.ownerId)}}async function resolveTargetProject(client,deployment,deploymentFlag){try{let link=await linkFromDeployment(client,deployment);return link||output_manager_default.warn(`Deployment "${deploymentFlag}" is missing project metadata; proceeding without an automatic protection bypass token.`),link}catch(err){return output_manager_default.debug(`Failed to resolve deployment project: ${err}`),output_manager_default.warn(`Failed to load project for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`),null}}async function tryGetDeployment(client,selector){try{return await resolveDeployment(client,selector)}catch(err){return output_manager_default.debug(`Failed to resolve deployment: ${err}`),null}}async function tryLinkFromSelector(client,selector){try{let deployment=await resolveDeployment(client,selector);return deployment?await linkFromDeployment(client,deployment):null}catch(err){return output_manager_default.debug(`Failed to resolve trace project context: ${err}`),null}}async function getLinkedProjectOrNull(client){try{let linked=await getLinkedProject(client,{cwd:client.cwd});return linked.status==="linked"?linked:null}catch(err){return output_manager_default.debug(`Failed to load linked project: ${err}`),null}}function hasAutomationBypassToken(project){return Object.values(project.protectionBypass??{}).some(token=>token.scope==="automation-bypass")}async function getDeploymentUrlAndToken(client,commandName,path,options){let{deploymentFlag,protectionBypassFlag,autoConfirm,resolveProjectForTrace}=options,suppliedProtectionBypass=deploymentFlag?protectionBypassFlag??(process.env.VERCEL_AUTOMATION_BYPASS_SECRET||void 0):protectionBypassFlag,link=null,createProtectionBypassIfMissing=!deploymentFlag,baseUrl;if(deploymentFlag){let requestedBaseUrl=deploymentFlag.startsWith("http://")||deploymentFlag.startsWith("https://")||deploymentFlag.includes("vercel.app")?await getDeploymentUrlById(client,deploymentFlag):null,deploymentSelector=deploymentFlag.includes(".")||deploymentFlag.startsWith("dpl_")?deploymentFlag:`dpl_${deploymentFlag}`;if(suppliedProtectionBypass!==void 0){if(baseUrl=requestedBaseUrl??await getDeploymentUrlById(client,deploymentFlag)??"",!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;resolveProjectForTrace&&(link=await tryLinkFromSelector(client,deploymentSelector)??await getLinkedProjectOrNull(client))}else{let deployment=await tryGetDeployment(client,deploymentSelector);if(baseUrl=requestedBaseUrl??(deployment?.url?`https://${deployment.url}`:""),!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;deployment?(link=await resolveTargetProject(client,deployment,deploymentFlag),link&&!hasAutomationBypassToken(link.project)&&(createProtectionBypassIfMissing=(await getLinkedProjectOrNull(client))?.project.id===link.project.id)):output_manager_default.warn(`Could not resolve project information for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`)}}else{try{await getScope(client)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return output_manager_default.error(err.message),1;throw err}let ensuredLink;try{ensuredLink=await ensureLink(commandName,client,client.cwd,{autoConfirm})}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED")return output_manager_default.error(err.message),1;throw err}if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink;let{project}=ensuredLink;if(!project.targets&&!project.latestDeployments){let linkedProject=await getLinkedProject(client,{cwd:client.cwd});if(linkedProject.status!=="linked")return output_manager_default.error("This command requires a linked project. Please run:"),output_manager_default.print(" vercel link"),1;if(!linkedProject.project||!linkedProject.org)return output_manager_default.error("Failed to get project information"),1;project=linkedProject.project}let preferredAlias=project.targets?.production?.alias?.[0],backupAlias=project.latestDeployments?.[0]?.url,target=preferredAlias||backupAlias;if(!target)throw new Error("No deployment URL found for the project");baseUrl=`https://${target}`}let fullUrl=`${baseUrl}${path.startsWith("/")?path:`/${path}`}`;output_manager_default.debug(`${import_chalk.default.cyan("Target URL:")} ${import_chalk.default.bold(fullUrl)}`);let deploymentProtectionToken=suppliedProtectionBypass??null;if(suppliedProtectionBypass===void 0&&link?.project.id)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{createIfMissing:createProtectionBypassIfMissing})}catch(err){return output_manager_default.error(`Failed to get deployment protection bypass token: ${err instanceof Error?err.message:String(err)}`),1}return{fullUrl,deploymentProtectionToken,link}}var import_error_utils2=__toESM(require_dist(),1);import{spawn}from"child_process";import{tmpdir}from"os";import{join as join2}from"path";import{mkdtemp,readFile as readFile2,rm}from"fs/promises";async function confirmProduction(client,{deploymentTarget,yes,isTTY}){return deploymentTarget!=="production"||yes?"proceed":isTTY?await client.input.confirm("You are about to capture a trace against a production deployment. Continue?",!1)?"proceed":"declined":(output_manager_default.error("Use --yes to capture traces on production from non-interactive contexts."),"non-tty-no-yes")}import{createHash}from"crypto";import{chmod,mkdir,readFile,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var FALLBACK_TTL_MS=5*60*1e3,EXPIRY_BUFFER_MS=30*1e3,CACHE_SCHEMA_VERSION=1;function resolveCacheDir(override){return override||join(getGlobalPathConfig(),"cache","traces")}function cacheFilename(teamId,host){let key=`${teamId??""}:${host}`;return`${createHash("sha256").update(key).digest("hex")}.json`}function cachePath(cacheDir,teamId,host){return join(cacheDir,cacheFilename(teamId,host))}async function readCache(path){let raw;try{raw=await readFile(path,"utf8")}catch{return null}try{let parsed=JSON.parse(raw);return!parsed||typeof parsed.token!="string"||typeof parsed.expiresAt!="number"||parsed.schemaVersion!==CACHE_SCHEMA_VERSION?null:parsed}catch{return output_manager_default.debug(`Trace cookie cache file is corrupt at ${path}; re-issuing.`),null}}async function writeCache(path,entry){await mkdir(dirname(path),{recursive:!0}),await writeFile(path,JSON.stringify(entry),{mode:384}),await chmod(path,384)}async function issueToken(client,{teamId,projectId,hostname}){let body=JSON.stringify({projectId,hostname}),response=await client.fetch("/v1/projects/traces/session",{method:"POST",body,headers:{"Content-Type":"application/json"},accountId:teamId});if(!response?.token)throw new Error("Trace session response is missing a token");let expiresAt=typeof response.expiresAt=="number"?response.expiresAt:Date.now()+FALLBACK_TTL_MS;return{token:response.token,expiresAt}}async function getTraceSessionToken({client,teamId,projectId,host,evictedToken,cacheDir}){let dir=resolveCacheDir(cacheDir),hostname=toHost(host),path=cachePath(dir,teamId,hostname),cached=await readCache(path);if(cached&&evictedToken&&cached.token===evictedToken)await unlink(path).catch(()=>{});else if(cached&&Date.now()<cached.expiresAt-EXPIRY_BUFFER_MS)return{token:cached.token,expiresAt:cached.expiresAt,fromCache:!0};let issued=await issueToken(client,{teamId,projectId,hostname});try{await writeCache(path,{token:issued.token,expiresAt:issued.expiresAt,schemaVersion:CACHE_SCHEMA_VERSION})}catch(err){output_manager_default.debug(`Failed to write trace cookie cache: ${err}`)}return{token:issued.token,expiresAt:issued.expiresAt,fromCache:!1}}var TRACE_COOKIE_NAME="_vercel_tracing",SESSION_COOKIE_NAME="_vercel_session";async function lookupDeployment(client,fullUrl,accountId){let deployment=await resolveDeployment(client,fullUrl,accountId);if(!deployment)throw new Error("Deployment not found");return deployment}function resolveTeamId(link,deployment){if(link?.org.type==="team")return link.org.id;if(deployment.ownerId?.startsWith("team_"))return deployment.ownerId}function extractVercelId(headerDump){let lines=headerDump.split(/\r?\n/),lastValue;for(let line of lines){let idx=line.indexOf(":");if(idx===-1)continue;line.slice(0,idx).trim().toLowerCase()==="x-vercel-id"&&(lastValue=line.slice(idx+1).trim())}if(!lastValue)return;let sepIdx=lastValue.lastIndexOf("::");return sepIdx===-1?lastValue:lastValue.slice(sepIdx+2)}function extractFinalStatus(headerDump){let lines=headerDump.split(/\r?\n/),lastStatus;for(let line of lines){let match=line.match(/^HTTP\/[\d.]+\s+(\d{3})/);match&&(lastStatus=Number(match[1]))}return lastStatus}async function runCurlAndCaptureHeaders(curlFlags,json){let tmpDir=await mkdtemp(join2(tmpdir(),"vc-curl-trace-")),headerFile=join2(tmpDir,"headers"),flags=["--dump-header",headerFile,...curlFlags];try{let{exitCode,capturedBody}=await new Promise(resolve=>{let child=spawn("curl",flags,{stdio:json?["inherit","pipe","inherit"]:"inherit",shell:!1}),buf="";json&&child.stdout&&(child.stdout.setEncoding("utf8"),child.stdout.on("data",chunk=>{buf+=chunk})),child.on("error",err=>{err.code==="ENOENT"?output_manager_default.error("curl command not found. Please install curl."):output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve({exitCode:1,capturedBody:buf})}),child.on("close",code=>{resolve({exitCode:code??1,capturedBody:buf})})}),headerDump="";try{headerDump=await readFile2(headerFile,"utf8")}catch(err){output_manager_default.debug(`Failed to read curl header dump: ${err}`)}return{exitCode,headerDump,capturedBody}}finally{await rm(tmpDir,{recursive:!0,force:!0}).catch(()=>{})}}async function trace(client,{fullUrl,link,curlFlags,json,yes,telemetry}){telemetry.trackCliFlagTrace(!0),json&&telemetry.trackCliFlagJson(!0);let accountId=link?.org.id,deployment;try{deployment=await lookupDeployment(client,fullUrl,accountId)}catch(err){return output_manager_default.error(`Failed to look up deployment for tracing: ${err instanceof Error?err.message:String(err)}`),1}let projectId=link?.project.id??deployment.projectId;if(!projectId)return output_manager_default.error("Could not resolve project for trace session. Run `vercel link` and retry."),1;let teamId=resolveTeamId(link,deployment),userId;try{userId=client.authConfig.userId??(await getUser(client)).id}catch(err){return output_manager_default.error(`Failed to resolve user for trace session: ${(0,import_error_utils2.errorToString)(err)}`),1}let deploymentTarget=deployment.target==="production"?"production":"preview",confirmation=await confirmProduction(client,{deploymentTarget,yes,isTTY:!!client.stdin.isTTY});if(confirmation==="non-tty-no-yes")return 1;if(confirmation==="declined")return output_manager_default.log("Trace cancelled."),0;deploymentTarget==="production"&&yes&&telemetry.trackCliFlagYesOnProduction(!0);let session;try{session=await getTraceSessionToken({client,teamId,projectId,host:fullUrl})}catch(err){return output_manager_default.error(`Failed to acquire trace session: ${err instanceof Error?err.message:String(err)}`),1}let{exitCode,headerDump,capturedBody}=await runCurlWithCookie(session.token,userId,curlFlags,json);if(session.fromCache&&extractFinalStatus(headerDump)===401&&exitCode===0){output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");let refreshed;try{refreshed=await getTraceSessionToken({client,teamId,projectId,host:fullUrl,evictedToken:session.token})}catch(err){return output_manager_default.error(`Failed to refresh trace session after 401: ${err instanceof Error?err.message:String(err)}`),1}({exitCode,headerDump,capturedBody}=await runCurlWithCookie(refreshed.token,userId,curlFlags,json))}let requestId=extractVercelId(headerDump);return json?(client.stdout.write(`${JSON.stringify({response:capturedBody,requestId:requestId??null},null,2)}
8
- `),requestId?exitCode:exitCode===0?1:exitCode):requestId?(client.stderr.write(`
9
- Run \`vercel traces inspect ${requestId}\` to fetch the trace.
10
- `),exitCode):(output_manager_default.error("Trace cookie was set but the response did not include an x-vercel-id header."),exitCode===0?1:exitCode)}async function runCurlWithCookie(token,userId,curlFlags,json){let flagsWithCookie=["--header",`Cookie: ${TRACE_COOKIE_NAME}=${token}; ${SESSION_COOKIE_NAME}=${userId}`,...curlFlags];return output_manager_default.debug(`Executing: curl ${flagsWithCookie.map(requoteArgs).join(" ")}`),runCurlAndCaptureHeaders(flagsWithCookie,json)}async function curl(client){return runCurl(client,{})}async function runCurl(client,{forceTrace=!1,args}){let telemetryClient=new CurlTelemetryClient({opts:{store:client.telemetryEventStore}}),setup=setupCurlLikeCommand(client,curlCommand,telemetryClient,{allowFullUrl:!0,args});if(typeof setup=="number")return setup;let{path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,json:jsonFlag}=setup,traceFlag=forceTrace||setup.trace,result=isFullUrl?await getFullUrlAndToken(client,path,protectionBypassFlag):await getDeploymentUrlAndToken(client,"curl",path,{deploymentFlag,protectionBypassFlag,autoConfirm:setup.yes,resolveProjectForTrace:traceFlag});if(typeof result=="number")return result;let{fullUrl,deploymentProtectionToken}=result,curlFlags=[...toolFlags];return deploymentProtectionToken&&curlFlags.unshift("--header",`x-vercel-protection-bypass: ${deploymentProtectionToken}`),curlFlags.unshift("--url",fullUrl),traceFlag?trace(client,{fullUrl,link:result.link??null,curlFlags,json:jsonFlag,yes:setup.yes,telemetry:telemetryClient}):(output_manager_default.debug(`Executing: curl ${curlFlags.map(requoteArgs).join(" ")}`),new Promise(resolve=>{let curlProcess=spawn2("curl",curlFlags,{stdio:"inherit",shell:!1});curlProcess.on("error",err=>{"code"in err&&err.code==="ENOENT"?(output_manager_default.error("curl command not found. Please install curl."),resolve(1)):(output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve(1))}),curlProcess.on("close",code=>{resolve(code??1)})}))}export{requoteArgs,setupCurlLikeCommand,getDeploymentUrlAndToken,curl,runCurl};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{tracesConfigCommand}from"./chunk-GVTXA6HG.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Fetch a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Fetch a trace without the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -1,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,nextCursorOption,yesOption}from"./chunk-AWMQGOS2.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:null,deprecatedShorthand:"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:null,deprecatedShorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"Filter deployments by environment",argument:"ENVIRONMENT",shorthand:"e",type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:null,deprecatedShorthand:"s",type:String,deprecated:!1},nextCursorOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!0},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list --meta key1=value1 --meta key2=value2`},{name:"Paginate deployments for a project, where `1584722256178` is the time in milliseconds since the UNIX epoch",value:`${packageName} list my-app --next <CURSOR>`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
@@ -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-LJBUJ23M.js";import{deploymentOption,environmentOption,gitBranchOption,projectOption,targetOption,yesOption}from"./chunk-AWMQGOS2.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},{...environmentOption,description:"Environment to build for: production, preview, or a custom environment (default: preview)"},targetOption,{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},{...deploymentOption,description:"Deployment ID to pull environment variables from (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},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 --deployment 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 (default: development)",argument:"ENVIRONMENT",shorthand:"e",type:String,deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"},{name:"prod",shorthand:null,type:Boolean,deprecated:!0},{...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};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:["vercel monitors schema --type built-in"]},monitorsAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope flag, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",body:[...JSON.stringify(builtInBody,null,2).split(`
8
- `),"","vercel monitors add --project my-app --body ./rule.json"]},authoringReference],monitorsUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored monitor.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the monitor to team-wide scope."]},{title:"Partial body (patch.json)",body:[...JSON.stringify(patchBody,null,2).split(`
9
- `),"","vercel monitors update ar_abc123 --body ./patch.json","vercel monitors update ar_abc123 --project my-app"]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible monitors in the selected team"},mutationAllOption={...listAllOption,description:"Apply the monitor to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the monitor body from a JSON file"},monitorsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List monitors for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by monitor type"},formatOption,jsonOption],examples:[{name:"List monitors affecting the linked project",value:`${packageName} monitors ls`},{name:"List all monitors in the selected team",value:`${packageName} monitors ls --all`},{name:"Write JSON output",value:`${packageName} monitors ls --all --json`}]},monitorsSchemaSubcommand={name:"schema",aliases:[],description:"Show monitor request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Monitor type to describe"},formatOption,jsonOption],examples:[{name:"List supported monitor types",value:`${packageName} monitors schema`},{name:"Show the built-in monitor schema",value:`${packageName} monitors schema --type built-in`}]},monitorsAddSubcommand={name:"add",aliases:["create"],description:"Create a monitor from a JSON body",helpSections:monitorsAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in monitor",value:`${packageName} monitors add --all --body ./rule.json`}]},monitorsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one monitor by ID",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors inspect ar_abc123 --json`}]},monitorsRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove a monitor",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Remove with confirmation",value:`${packageName} monitors remove ar_abc123`},{name:"Remove without a prompt",value:`${packageName} monitors remove ar_abc123 --yes`}]},monitorsUpdateSubcommand={name:"update",aliases:["patch"],description:"Patch a monitor or change its scope",helpSections:monitorsUpdateHelpSections,arguments:[{name:"monitorId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Move a monitor to a project",value:`${packageName} monitors update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the monitor"},monitorsNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable monitors or one monitor",arguments:[{name:"monitorId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable monitors",value:`${packageName} monitors notifications ls`},{name:"List notification destinations for one monitor",value:`${packageName} monitors notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors notifications ar_abc123 --json`}]},monitorsNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to a monitor",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},monitorsNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} monitors notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the monitor",value:`${packageName} monitors notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},monitorsNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from a monitor",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} monitors notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} monitors notifications unlink ar_abc123 --webhook wh_abc123`}]},monitorsNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for monitors",arguments:[],subcommands:[monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable monitors",value:`${packageName} monitors notifications`},{name:"List destinations for one monitor",value:`${packageName} monitors notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`}]},monitorsCommand={name:"monitors",aliases:[],description:"Create, inspect, list, update, and delete monitors and manage their notification destinations",arguments:[],subcommands:[monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsAggregateCommand],options:monitorsLsSubcommand.options,examples:[{name:"List monitors for the linked project",value:`${packageName} monitors ls`},{name:"Add a monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Update a monitor",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Remove a monitor",value:`${packageName} monitors remove ar_abc123`},{name:"List notification destinations for a monitor",value:`${packageName} monitors notifications ar_abc123`}]};export{monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand,monitorsNotificationsAggregateCommand,monitorsCommand};
@@ -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-7L2K4OKM.js";import{require_types}from"./chunk-KNLGWGUE.js";import{require_build_utils}from"./chunk-XP3FT56R.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}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=100,schedulesSchema={if:{type:"array"},then:{type:"array",maxItems:maxSchedules,items:{...scheduleDefinitionSchema,required:["name","schedule"],properties:{name:scheduleNameSchema,...scheduleDefinitionSchema.properties}}},else:{type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{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},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=path=>/(docker|container)file/i.test(path.split(/[\\/]/).pop()??"");function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let schedules=Array.isArray(config.schedules)?config.schedules.map((schedule,index)=>[`schedules[${index}]`,schedule.name,schedule]):Object.entries(config.schedules??{}).map(([name,schedule])=>[`schedules.${name}`,name,schedule]),serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[path,name,schedule]of schedules){if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidCommand(`\`${path}\` runs a command, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidCommand(`\`${path}\` runs a command as service "${name}", which is already the name of a service or daemon.`)}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"} - \`${path}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return 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(!isDockerfilePath(daemon.entrypoint))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.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let 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,63 +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_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),packageName="vercel",logo="\u25B2",ROW_INDENT=" ".repeat(6),COLUMN_GAP=" ".repeat(2),DEFAULT_LABEL="(default)";function wrap(text,width){let lines=[],line="";for(let word of text.split(/\s+/))line&&line.length+word.length+1>width?(lines.push(line),line=word):line=line?`${line} ${word}`:word;return lines.push(line),lines}function commandRows(commands,allCommands,columns){let label=command=>command.names.join(" | "),labelWidth=Math.max(...allCommands.map(c=>label(c).length)),descriptionIndent=ROW_INDENT.length+labelWidth+COLUMN_GAP.length,descriptionWidth=Math.max(30,columns-descriptionIndent);return commands.map(command=>{let lines=wrap(command.default?`${command.description} ${DEFAULT_LABEL}`:command.description,descriptionWidth);if(command.default){let last=lines.length-1;lines[last]=lines[last].replace(DEFAULT_LABEL,import_chalk.default.bold(DEFAULT_LABEL))}let[first,...rest]=lines;return[`${ROW_INDENT}${label(command).padEnd(labelWidth)}${COLUMN_GAP}${first}`,...rest.map(line=>`${" ".repeat(descriptionIndent)}${line}`)].join(`
8
- `)}).join(`
9
- `)}var help=(commands,columns=80)=>`
10
- ${import_chalk.default.bold(`${logo} ${packageName}`)} [options] <command | path>
11
-
12
- ${import_chalk.default.dim("For deploy command help, run `vercel deploy --help`")}
13
-
14
- ${import_chalk.default.dim("Commands:")}
15
-
16
- ${import_chalk.default.dim("Basic")}
17
-
18
- ${commandRows(commands.filter(command=>command.basic),commands,columns)}
19
-
20
- ${import_chalk.default.dim("Advanced")}
21
-
22
- ${commandRows(commands.filter(command=>!command.basic),commands,columns)}
23
-
24
- ${import_chalk.default.dim("Global Options:")}
25
-
26
- -h, --help Output usage information
27
- -v, --version Output the version number
28
- --changelog Show the 5 latest Vercel product updates
29
- --cwd Current working directory
30
- -A ${import_chalk.default.bold.underline("FILE")}, --local-config=${import_chalk.default.bold.underline("FILE")} Path to the local \`vercel.json\` file
31
- -Q ${import_chalk.default.bold.underline("DIR")}, --global-config=${import_chalk.default.bold.underline("DIR")} Path to the global \`.vercel\` directory
32
- -d, --debug Debug mode (default: off)
33
- --no-color No color mode (default: off)
34
- --non-interactive Run without interactive prompts (default: on when an agent is detected)
35
- -S, --scope Set a custom scope
36
- -t ${import_chalk.default.underline("TOKEN")}, --token=${import_chalk.default.underline("TOKEN")} Login token
37
-
38
- ${import_chalk.default.dim("Examples:")}
39
-
40
- ${import_chalk.default.gray("\u2013")} Deploy the current directory
41
-
42
- ${import_chalk.default.cyan(`$ ${packageName}`)}
43
-
44
- ${import_chalk.default.gray("\u2013")} Deploy a custom path
45
-
46
- ${import_chalk.default.cyan(`$ ${packageName} /usr/src/project`)}
47
-
48
- ${import_chalk.default.gray("\u2013")} Deploy with Environment Variables
49
-
50
- ${import_chalk.default.cyan(`$ ${packageName} --env NODE_ENV=production`)}
51
-
52
- ${import_chalk.default.gray("\u2013")} Show the usage information for the sub command ${import_chalk.default.dim("`list`")}
53
-
54
- ${import_chalk.default.cyan(`$ ${packageName} help list`)}
55
-
56
- ${import_chalk.default.gray("\u2013")} Show the 5 latest Vercel product updates
57
-
58
- ${import_chalk.default.cyan(`$ ${packageName} --changelog`)}
59
-
60
- ${import_chalk.default.gray("\u2013")} Search Vercel product updates
61
-
62
- ${import_chalk.default.cyan(`$ ${packageName} changelog search "AI SDK"`)}
63
- `;export{help};