@vercel/cli-support 66.6.0 → 67.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/chunks/add-PULH4LLG.js +8 -0
  2. package/dist/chunks/add-SWKAAP2V.js +8 -0
  3. package/dist/chunks/add-U3ILHW5T.js +8 -0
  4. package/dist/chunks/{alerts-72Q42HNT.js → alerts-GXY7LZWX.js} +1 -1
  5. package/dist/chunks/build-UNR3B22D.js +7 -0
  6. package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
  7. package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
  8. package/dist/chunks/chunk-2BI5SSHB.js +7 -0
  9. package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
  10. package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
  11. package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
  12. package/dist/chunks/{chunk-DZ77BIEV.js → chunk-2OMMOXFL.js} +1 -1
  13. package/dist/chunks/{chunk-6PDKIOAO.js → chunk-2TJQY7PH.js} +1 -1
  14. package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
  15. package/dist/chunks/{chunk-YOAQNRBN.js → chunk-3C6BMAGB.js} +2 -2
  16. package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
  17. package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
  18. package/dist/chunks/{chunk-QZJOKECY.js → chunk-4GYDXPNC.js} +2 -2
  19. package/dist/chunks/{chunk-H2KNSYPR.js → chunk-55FPQ5MM.js} +1 -1
  20. package/dist/chunks/{chunk-RBW62SOU.js → chunk-55WV4RRW.js} +1 -1
  21. package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
  22. package/dist/chunks/{chunk-D2TVI7KK.js → chunk-5CFLIIMP.js} +4 -4
  23. package/dist/chunks/chunk-5DHOC47O.js +13 -0
  24. package/dist/chunks/{chunk-CSCUVSJM.js → chunk-5GKIRBHJ.js} +1 -1
  25. package/dist/chunks/{chunk-YLLFLPNA.js → chunk-5QMXW5KS.js} +1 -1
  26. package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
  27. package/dist/chunks/{chunk-NLK7NGVP.js → chunk-5ZL2RRO3.js} +1 -1
  28. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  29. package/dist/chunks/chunk-6D44CCJA.js +23 -0
  30. package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
  31. package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
  32. package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
  33. package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-6UWBCYEW.js} +1 -1
  34. package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
  35. package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
  36. package/dist/chunks/chunk-742MHFPK.js +31 -0
  37. package/dist/chunks/chunk-7HQZRU25.js +10 -0
  38. package/dist/chunks/{chunk-QZKRVE44.js → chunk-7J7SOUFS.js} +1 -1
  39. package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
  40. package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
  41. package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
  42. package/dist/chunks/{chunk-OISNKAC6.js → chunk-7W4GWVUP.js} +2 -2
  43. package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
  44. package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
  45. package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
  46. package/dist/chunks/{chunk-6GE4V7MW.js → chunk-ANT2GN7F.js} +2 -2
  47. package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
  48. package/dist/chunks/{chunk-Y77DXGGN.js → chunk-B6YVE4WJ.js} +1 -1
  49. package/dist/chunks/chunk-B7IB5CTS.js +7 -0
  50. package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
  51. package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
  52. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  53. package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
  54. package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
  55. package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
  56. package/dist/chunks/{chunk-FOFX7LHS.js → chunk-C3KNFAVK.js} +1 -1
  57. package/dist/chunks/{chunk-OE26EQSH.js → chunk-C7TNFTTK.js} +1 -1
  58. package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
  59. package/dist/chunks/chunk-CDJ25IKC.js +7 -0
  60. package/dist/chunks/chunk-CO5LKOMH.js +7 -0
  61. package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
  62. package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
  63. package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
  64. package/dist/chunks/chunk-DORCX7UB.js +7 -0
  65. package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
  66. package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
  67. package/dist/chunks/{chunk-N6JHFCWC.js → chunk-EM4OX47A.js} +1 -1
  68. package/dist/chunks/{chunk-VPSR2O55.js → chunk-EOUT7E7U.js} +3 -3
  69. package/dist/chunks/chunk-EYRBV6RM.js +25 -0
  70. package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
  71. package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
  72. package/dist/chunks/chunk-FFHV7BRT.js +7 -0
  73. package/dist/chunks/{chunk-ACN6DBTC.js → chunk-FHUDTYY7.js} +1 -1
  74. package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
  75. package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
  76. package/dist/chunks/{chunk-3A3GU62R.js → chunk-G2CDEA2E.js} +1 -1
  77. package/dist/chunks/chunk-GQXKF3PR.js +7 -0
  78. package/dist/chunks/{chunk-KSGN5OCV.js → chunk-GT3JH2FU.js} +1 -1
  79. package/dist/chunks/{chunk-FFN3EGSF.js → chunk-GWYQXFBP.js} +1 -1
  80. package/dist/chunks/{chunk-BCAI7MED.js → chunk-H75TYZ4K.js} +1 -1
  81. package/dist/chunks/{chunk-W2L24GM7.js → chunk-HT445TYO.js} +1 -1
  82. package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-HZRU7VS6.js} +1 -1
  83. package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
  84. package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-IGJBSAFY.js} +1 -1
  85. package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
  86. package/dist/chunks/chunk-IPORRCTF.js +12 -0
  87. package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
  88. package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
  89. package/dist/chunks/{chunk-R33HJGYA.js → chunk-JYGOOFIW.js} +1 -1
  90. package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
  91. package/dist/chunks/{chunk-JBYROCAC.js → chunk-KC5BRLPR.js} +1 -1
  92. package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
  93. package/dist/chunks/{chunk-QGHAD5A5.js → chunk-KHDRQS6I.js} +1 -1
  94. package/dist/chunks/{chunk-L5PIUIUM.js → chunk-KJUFWRZP.js} +1 -1
  95. package/dist/chunks/chunk-L3DJOYTO.js +11 -0
  96. package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
  97. package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
  98. package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-LIQLOS7B.js} +1 -1
  99. package/dist/chunks/chunk-LYQECLRR.js +10 -0
  100. package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
  101. package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
  102. package/dist/chunks/{chunk-GUGP6OY2.js → chunk-ME52HBX7.js} +1 -1
  103. package/dist/chunks/{chunk-XAGG5BJT.js → chunk-MFOBJA6M.js} +1 -1
  104. package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
  105. package/dist/chunks/chunk-MNDFF42B.js +30 -0
  106. package/dist/chunks/{chunk-AFHZC47H.js → chunk-MPOK5ZI5.js} +1 -1
  107. package/dist/chunks/{chunk-WAFBTC45.js → chunk-N3IQO5HN.js} +1 -1
  108. package/dist/chunks/{chunk-2G2SALNN.js → chunk-NBRW54IL.js} +1 -1
  109. package/dist/chunks/chunk-NJFXR3FN.js +77 -0
  110. package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
  111. package/dist/chunks/chunk-NTSJNYRU.js +11 -0
  112. package/dist/chunks/{chunk-EFP3LK4G.js → chunk-OBBFWQJ3.js} +1 -1
  113. package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OOAIU7WR.js} +1 -1
  114. package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
  115. package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
  116. package/dist/chunks/chunk-PHK4OYIZ.js +8 -0
  117. package/dist/chunks/{chunk-IF6GA273.js → chunk-PKCEKIQP.js} +1 -1
  118. package/dist/chunks/{chunk-33HVDSWP.js → chunk-PYHNDBNH.js} +1 -1
  119. package/dist/chunks/chunk-QFE3RPMA.js +19 -0
  120. package/dist/chunks/{chunk-S4AANAHX.js → chunk-QKK5BAZO.js} +1 -1
  121. package/dist/chunks/{chunk-RDDIWY3O.js → chunk-QPX6N5CV.js} +3 -3
  122. package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
  123. package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
  124. package/dist/chunks/chunk-RNHPL4C7.js +13 -0
  125. package/dist/chunks/chunk-RPYIWRSN.js +7 -0
  126. package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
  127. package/dist/chunks/{chunk-2OMI3IUW.js → chunk-S6QZTDZ3.js} +1 -1
  128. package/dist/chunks/{chunk-5O4AXCN7.js → chunk-SGFMVYFR.js} +1 -1
  129. package/dist/chunks/chunk-SGNDE4YS.js +7 -0
  130. package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
  131. package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
  132. package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
  133. package/dist/chunks/{chunk-TNQUCTJH.js → chunk-THMCHMVZ.js} +1 -1
  134. package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
  135. package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-TRDAU3LX.js} +1 -1
  136. package/dist/chunks/chunk-TVTGVWCV.js +8 -0
  137. package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
  138. package/dist/chunks/chunk-UEFDCTG6.js +7 -0
  139. package/dist/chunks/{chunk-OXS5VO4X.js → chunk-URJT7V4L.js} +1 -1
  140. package/dist/chunks/chunk-UT3HLSJV.js +8 -0
  141. package/dist/chunks/chunk-V5TIFXUP.js +15 -0
  142. package/dist/chunks/chunk-VGSSSQFT.js +7 -0
  143. package/dist/chunks/{chunk-OF32Z3UP.js → chunk-VT7UAUY6.js} +1 -1
  144. package/dist/chunks/{chunk-QRG24GJG.js → chunk-VWFFYVJ2.js} +1 -1
  145. package/dist/chunks/chunk-VWKA6RKB.js +7 -0
  146. package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
  147. package/dist/chunks/{chunk-2D5PTFAY.js → chunk-WOXLDQR3.js} +1 -1
  148. package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-X3LOIVIS.js} +1 -1
  149. package/dist/chunks/{chunk-MINTHN6C.js → chunk-X4ECSRFL.js} +1 -1
  150. package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
  151. package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
  152. package/dist/chunks/{chunk-C335SWOB.js → chunk-X7TIJWNO.js} +1 -1
  153. package/dist/chunks/chunk-XTCRLS6X.js +10 -0
  154. package/dist/chunks/{chunk-KLYFOXYH.js → chunk-XUMXJUE4.js} +3 -3
  155. package/dist/chunks/{chunk-XDWAUOFO.js → chunk-XXLU5IHA.js} +1 -1
  156. package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
  157. package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
  158. package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
  159. package/dist/chunks/{chunk-YEDS2UMW.js → chunk-YBKH3IDY.js} +1 -1
  160. package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
  161. package/dist/chunks/chunk-YKIKCZQ4.js +37 -0
  162. package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
  163. package/dist/chunks/chunk-YMVS467I.js +7 -0
  164. package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
  165. package/dist/chunks/chunk-YTSGFU5T.js +7 -0
  166. package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
  167. package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
  168. package/dist/chunks/{chunk-O7GNYVVM.js → chunk-Z5HRQ3IQ.js} +2 -2
  169. package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
  170. package/dist/chunks/{chunk-F37XFLFP.js → chunk-ZNEXVCPE.js} +1 -1
  171. package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
  172. package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
  173. package/dist/chunks/clear-ZYFF7TKK.js +8 -0
  174. package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
  175. package/dist/chunks/compile-vercel-config-PM32YSEA.js +7 -0
  176. package/dist/chunks/config-BOZHXFS2.js +8 -0
  177. package/dist/chunks/config-PEQFEYH3.js +7 -0
  178. package/dist/chunks/config-validator.mjs +1 -1
  179. package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
  180. package/dist/chunks/create-project-BTOHPKZB.js +7 -0
  181. package/dist/chunks/delete-5ZT5D2ZC.js +9 -0
  182. package/dist/chunks/delete-QOXGYAV7.js +10 -0
  183. package/dist/chunks/describe-PB4P77HZ.js +25 -0
  184. package/dist/chunks/detect-projects-YFNBW57H.js +7 -0
  185. package/dist/chunks/detect-services-ZN2R3RDF.js +7 -0
  186. package/dist/chunks/disable-UB445BYJ.js +7 -0
  187. package/dist/chunks/discard-EDFRCWQJ.js +14 -0
  188. package/dist/chunks/edit-RZUR2MEI.js +9 -0
  189. package/dist/chunks/edit-ZWAA6ERV.js +8 -0
  190. package/dist/chunks/enable-YTPIGKFW.js +7 -0
  191. package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
  192. package/dist/chunks/esm-5GQXHN7C.js +9 -0
  193. package/dist/chunks/esm-FJCIOBBV.js +7 -0
  194. package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
  195. package/dist/chunks/esm-LEQXRLFV.js +9 -0
  196. package/dist/chunks/esm-NHCCFW7Z.js +7 -0
  197. package/dist/chunks/esm-QQ3MUOW4.js +7 -0
  198. package/dist/chunks/esm-T655CG6O.js +7 -0
  199. package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
  200. package/dist/chunks/{export-TOSUN6JO.js → export-GAUHNKEC.js} +2 -3
  201. package/dist/chunks/future-5CMQQWD5.js +7 -0
  202. package/dist/chunks/generate-cert-for-deploy-UIPNZXKH.js +7 -0
  203. package/dist/chunks/image-6E4KXK2L.js +7 -0
  204. package/dist/chunks/import-builders-XWE653DS.js +7 -0
  205. package/dist/chunks/{inspect-GBH7FAW6.js → inspect-6R3QRA5N.js} +1 -1
  206. package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-CAFSMVCJ.js} +1 -1
  207. package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-D7ABHU5K.js} +1 -1
  208. package/dist/chunks/{inspect-DFYVVIJW.js → inspect-INPZEWQW.js} +1 -1
  209. package/dist/chunks/inspect-MTGXZZ56.js +9 -0
  210. package/dist/chunks/inspect-RAXMU5ZB.js +13 -0
  211. package/dist/chunks/{list-HD6KXAIG.js → list-FIHRZBUS.js} +1 -1
  212. package/dist/chunks/list-JBJW5CJ5.js +12 -0
  213. package/dist/chunks/{list-4RRL326Z.js → list-VMOJ7VVX.js} +1 -1
  214. package/dist/chunks/{list-MW2FV253.js → list-ZVDEIXDS.js} +1 -1
  215. package/dist/chunks/login-H2G7BS6W.js +7 -0
  216. package/dist/chunks/login-LKMOWVCB.js +9 -0
  217. package/dist/chunks/logs-VXZM4UHP.js +7 -0
  218. package/dist/chunks/{ls-RKOM46KV.js → ls-C6AD24SN.js} +1 -1
  219. package/dist/chunks/{ls-TLEAYYXQ.js → ls-F7VCPUQX.js} +1 -1
  220. package/dist/chunks/{ls-VFE7PE25.js → ls-GDKBTL2S.js} +1 -1
  221. package/dist/chunks/ls-HDEMDHPT.js +8 -0
  222. package/dist/chunks/ls-JQ27BRGL.js +11 -0
  223. package/dist/chunks/{ls-Q4WGEEBZ.js → ls-LAGLNA5S.js} +1 -1
  224. package/dist/chunks/{ls-I767MTW4.js → ls-Z6MWIX4Y.js} +1 -1
  225. package/dist/chunks/migrate-experimental-services-EDKYGFQN.js +7 -0
  226. package/dist/chunks/mutate-QQV7STKJ.js +9 -0
  227. package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
  228. package/dist/chunks/notifications-RS7NVKX3.js +7 -0
  229. package/dist/chunks/open-FJ2GR5YN.js +7 -0
  230. package/dist/chunks/{openapi-NEYEIRF2.js → openapi-TMDHCYVN.js} +1 -1
  231. package/dist/chunks/permissions-5A7V4SB3.js +7 -0
  232. package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-EVN7NAJK.js} +1 -1
  233. package/dist/chunks/prompt-missing-credentials-KI75QVSM.js +7 -0
  234. package/dist/chunks/publish-XSPN4TNJ.js +15 -0
  235. package/dist/chunks/pull-6UMQJKSF.js +7 -0
  236. package/dist/chunks/purchase-domain-if-available-CT4I2TPX.js +7 -0
  237. package/dist/chunks/push-KY26BHB6.js +7 -0
  238. package/dist/chunks/query-RISEG5SJ.js +7 -0
  239. package/dist/chunks/raw-query-VVRMDGD2.js +8 -0
  240. package/dist/chunks/reauthenticate-OSPJ3JEZ.js +7 -0
  241. package/dist/chunks/{remove-IEEZGRB2.js → remove-2IJXYNP5.js} +1 -1
  242. package/dist/chunks/reorder-V7HLFPNM.js +10 -0
  243. package/dist/chunks/reply-DBWSTVHX.js +9 -0
  244. package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
  245. package/dist/chunks/resolve-NNJNHWK7.js +12 -0
  246. package/dist/chunks/resolve-agent-team-SDRK736H.js +7 -0
  247. package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
  248. package/dist/chunks/restore-JLS3DHVR.js +16 -0
  249. package/dist/chunks/rm-44NX26ZY.js +8 -0
  250. package/dist/chunks/rm-6K2ZAQ26.js +8 -0
  251. package/dist/chunks/rm-KX2MW3CD.js +8 -0
  252. package/dist/chunks/rm-TADMPEWP.js +8 -0
  253. package/dist/chunks/rm-YCOVLR77.js +8 -0
  254. package/dist/chunks/routes-SBMN6SDF.js +7 -0
  255. package/dist/chunks/rule-inspect-4OICMTIG.js +8 -0
  256. package/dist/chunks/{schema-L5VCG6FJ.js → schema-JVSAUVFJ.js} +1 -1
  257. package/dist/chunks/schema-NPCCNUH2.js +14 -0
  258. package/dist/chunks/select-org-PQVCQGYR.js +7 -0
  259. package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
  260. package/dist/chunks/{set-6U4QIX7A.js → set-GBB3DG2V.js} +1 -1
  261. package/dist/chunks/set-XADF6YK4.js +7 -0
  262. package/dist/chunks/setup-and-link-CBVABGTY.js +7 -0
  263. package/dist/chunks/{skills-ZMFZGPQL.js → skills-VPLIJJQG.js} +4 -19
  264. package/dist/chunks/table-SCLK33K7.js +7 -0
  265. package/dist/chunks/tags-PVI45KIL.js +7 -0
  266. package/dist/chunks/{types-CVLZCTL2.js → types-MTNJRJKG.js} +1 -1
  267. package/dist/chunks/{update-A727QN7H.js → update-KIOGBNX7.js} +1 -1
  268. package/dist/chunks/usage-XTWSFFZT.js +15 -0
  269. package/dist/chunks/validate-config-IREIABSK.js +7 -0
  270. package/dist/commands/build/index.js +1 -1
  271. package/dist/commands/deploy/index.js +28 -25
  272. package/dist/commands/dev/index.js +7 -7
  273. package/dist/commands/env/index.js +11 -10
  274. package/dist/commands/link/index.js +3 -3
  275. package/dist/commands/list/index.js +1 -1
  276. package/dist/commands/project/index.js +4 -4
  277. package/dist/commands/tunnel/index.js +1 -1
  278. package/dist/commands-account.js +16 -10
  279. package/dist/commands-ai.js +17 -10
  280. package/dist/commands-blob.js +6 -6
  281. package/dist/commands-core.js +15 -16
  282. package/dist/commands-deployments.js +12 -11
  283. package/dist/commands-flags.js +25 -20
  284. package/dist/commands-integrations.js +3 -3
  285. package/dist/commands-observability.js +38 -28
  286. package/dist/commands-routing.js +4 -4
  287. package/dist/help.js +1 -1
  288. package/dist/index.js +6 -6
  289. package/dist/internal-build-worker.js +1 -1
  290. package/dist/internal-build.js +1 -1
  291. package/dist/package.json +42 -42
  292. package/dist/version.mjs +1 -1
  293. package/package.json +43 -43
  294. package/dist/chunks/add-563RV6JX.js +0 -8
  295. package/dist/chunks/add-HRB6XY33.js +0 -8
  296. package/dist/chunks/add-IUTGTBA4.js +0 -8
  297. package/dist/chunks/build-OMIYCGMR.js +0 -7
  298. package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
  299. package/dist/chunks/chunk-2RRZCRWX.js +0 -7
  300. package/dist/chunks/chunk-4SS6W6JK.js +0 -11
  301. package/dist/chunks/chunk-5J4E2W4F.js +0 -12
  302. package/dist/chunks/chunk-76DSBD4X.js +0 -7
  303. package/dist/chunks/chunk-7W565DJB.js +0 -8
  304. package/dist/chunks/chunk-AIXEVICT.js +0 -37
  305. package/dist/chunks/chunk-BULSRTQE.js +0 -7
  306. package/dist/chunks/chunk-C35SG42R.js +0 -7
  307. package/dist/chunks/chunk-CFJBDBYH.js +0 -7
  308. package/dist/chunks/chunk-DDPH26ZO.js +0 -7
  309. package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
  310. package/dist/chunks/chunk-EFFJUYYS.js +0 -31
  311. package/dist/chunks/chunk-GOI2VVI7.js +0 -19
  312. package/dist/chunks/chunk-GYUNOFDD.js +0 -10
  313. package/dist/chunks/chunk-KDCODXVL.js +0 -25
  314. package/dist/chunks/chunk-KMTHGHJV.js +0 -8
  315. package/dist/chunks/chunk-KQ6X77WP.js +0 -7
  316. package/dist/chunks/chunk-KRP4EMD2.js +0 -10
  317. package/dist/chunks/chunk-OCR5CRTH.js +0 -10
  318. package/dist/chunks/chunk-PKR32I2N.js +0 -30
  319. package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
  320. package/dist/chunks/chunk-SXW2G4WD.js +0 -10
  321. package/dist/chunks/chunk-TC4E2TFA.js +0 -8
  322. package/dist/chunks/chunk-TUB3APDV.js +0 -7
  323. package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
  324. package/dist/chunks/chunk-VF7XWPXA.js +0 -7
  325. package/dist/chunks/chunk-VKVH7LHB.js +0 -7
  326. package/dist/chunks/chunk-VUUU4KDL.js +0 -7
  327. package/dist/chunks/chunk-W3ZH27MN.js +0 -13
  328. package/dist/chunks/chunk-X47GV5HM.js +0 -15
  329. package/dist/chunks/chunk-XBHAU2M3.js +0 -9
  330. package/dist/chunks/chunk-XR2J7PQN.js +0 -12
  331. package/dist/chunks/chunk-YI7NKOCU.js +0 -23
  332. package/dist/chunks/chunk-Z2KANBOU.js +0 -69
  333. package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
  334. package/dist/chunks/clear-TH6G33QK.js +0 -8
  335. package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
  336. package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
  337. package/dist/chunks/config-2SBML7OY.js +0 -8
  338. package/dist/chunks/config-BCKJNJPS.js +0 -7
  339. package/dist/chunks/create-project-I7UXVWIR.js +0 -7
  340. package/dist/chunks/delete-RGHXL4JH.js +0 -9
  341. package/dist/chunks/delete-ZV4SHUTR.js +0 -10
  342. package/dist/chunks/describe-442UUQIF.js +0 -25
  343. package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
  344. package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
  345. package/dist/chunks/disable-MYGA6HVS.js +0 -7
  346. package/dist/chunks/discard-I5TKYCDJ.js +0 -14
  347. package/dist/chunks/edit-KGCUTTOZ.js +0 -8
  348. package/dist/chunks/edit-ZRNGGRVL.js +0 -9
  349. package/dist/chunks/enable-NODSFDKF.js +0 -7
  350. package/dist/chunks/esm-CF5UHWPM.js +0 -7
  351. package/dist/chunks/esm-EYOXGOVF.js +0 -7
  352. package/dist/chunks/esm-IUATPKKB.js +0 -9
  353. package/dist/chunks/esm-L6OKDFWP.js +0 -7
  354. package/dist/chunks/esm-ORQC2ZSA.js +0 -7
  355. package/dist/chunks/esm-PYIZNQIK.js +0 -9
  356. package/dist/chunks/future-RXI2OW2C.js +0 -7
  357. package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
  358. package/dist/chunks/image-6A2EJP4N.js +0 -7
  359. package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
  360. package/dist/chunks/inspect-STKCC3MC.js +0 -9
  361. package/dist/chunks/inspect-VFUV7BDM.js +0 -13
  362. package/dist/chunks/list-6ENV2ZGG.js +0 -12
  363. package/dist/chunks/login-O6NLJ42W.js +0 -7
  364. package/dist/chunks/login-U5VDJURN.js +0 -9
  365. package/dist/chunks/logs-X3KGHA3J.js +0 -7
  366. package/dist/chunks/ls-HRSD6VNW.js +0 -8
  367. package/dist/chunks/ls-OLJMGFTV.js +0 -11
  368. package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
  369. package/dist/chunks/mutate-BJXJON5E.js +0 -9
  370. package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
  371. package/dist/chunks/open-JK42ZTLB.js +0 -7
  372. package/dist/chunks/permissions-3AQO3DCH.js +0 -7
  373. package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
  374. package/dist/chunks/publish-7SCXBVZR.js +0 -15
  375. package/dist/chunks/pull-LAPD5XJG.js +0 -7
  376. package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
  377. package/dist/chunks/push-BCSGQBAM.js +0 -7
  378. package/dist/chunks/query-U72BDMAK.js +0 -7
  379. package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
  380. package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
  381. package/dist/chunks/reorder-YL6L6IWC.js +0 -10
  382. package/dist/chunks/reply-7Y5TN5UV.js +0 -9
  383. package/dist/chunks/resolve-C62436YM.js +0 -12
  384. package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
  385. package/dist/chunks/restore-Z63JM5CN.js +0 -16
  386. package/dist/chunks/rm-C6QSHEA2.js +0 -8
  387. package/dist/chunks/rm-DDKE62T7.js +0 -8
  388. package/dist/chunks/rm-IUB55CCM.js +0 -8
  389. package/dist/chunks/rm-NZX43GMQ.js +0 -8
  390. package/dist/chunks/rm-UBUI7JNY.js +0 -8
  391. package/dist/chunks/routes-TME3VYIF.js +0 -7
  392. package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
  393. package/dist/chunks/schema-P7DFLXCG.js +0 -14
  394. package/dist/chunks/select-org-MBBMOUK2.js +0 -7
  395. package/dist/chunks/set-SCKMJ7LZ.js +0 -7
  396. package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
  397. package/dist/chunks/tags-7M2EW6LU.js +0 -7
  398. package/dist/chunks/usage-HT5JXVAA.js +0 -13
  399. package/dist/chunks/validate-config-Q77XESW5.js +0 -7
@@ -0,0 +1,7 @@
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{CAN_MAX,ChannelPath,HttpError,forbidden,unauthorized}from"./chunk-NMY2YZ6M.js";var PERMISSIONS=["read","post","react","label","sync","manage"],InvalidCan=class extends Error{code="invalid_can";constructor(message2){super(message2),this.name="InvalidCan"}},IMPLIES={read:[],post:[],react:["read"],label:["read"],sync:["read"],manage:["read","post","react","label","sync"]},ORDER=new Map(PERMISSIONS.map((permission,index)=>[permission,index])),SHAPE="write *, a channel, or a channel and its subtree (feedback/)";function parsePattern(pattern){if(pattern==="*")return{kind:"all"};if(pattern.includes("*")){let before=pattern.slice(0,pattern.indexOf("*")).replace(/\/+$/,"");throw new InvalidCan(`invalid channel pattern ${pattern}: ${before===""?"write * for every channel":ChannelPath.safeParse(before).success?`write ${before}/ for ${before} and its subtree`:SHAPE}`)}let subtree=pattern.endsWith("/"),path=subtree?pattern.slice(0,-1):pattern;if(!ChannelPath.safeParse(path).success)throw new InvalidCan(`invalid channel pattern ${pattern||"(empty)"}: ${SHAPE}`);return subtree?{kind:"subtree",path}:{kind:"exact",path}}var key=pattern=>pattern.kind==="all"?"*":pattern.kind==="subtree"?`${pattern.path}/`:pattern.path;function expand(grant){let out=new Set,add=permission=>{if(!ORDER.has(permission))throw new InvalidCan(`unknown permission ${String(permission)}: use ${PERMISSIONS.join(", ")}`);if(!out.has(permission)){out.add(permission);for(let implied of IMPLIES[permission])add(implied)}};for(let permission of grant==="all"?PERMISSIONS:grant)add(permission);return out}var NOTHING=new Set;function compile(entries){let all=null,exact=new Map,subtrees=[];for(let[pattern,permissions]of entries)pattern.kind==="all"?all=permissions:pattern.kind==="exact"?exact.set(pattern.path,permissions):subtrees.push([pattern.path,permissions]);return subtrees.sort((a,b)=>b[0].length-a[0].length),{all,exact,subtrees}}var under=(channel,path)=>channel===path||channel.startsWith(`${path}/`);function resolve(rules,channel,subtreeOnly=!1){if(!subtreeOnly){let exact=rules.exact.get(channel);if(exact)return exact}for(let[path,permissions]of rules.subtrees)if(under(channel,path))return permissions;return rules.all??NOTHING}var at=(rules,pattern)=>pattern.kind==="all"?rules.all??NOTHING:resolve(rules,pattern.path,pattern.kind==="subtree"),equal=(a,b)=>a.size===b.size&&[...a].every(permission=>b.has(permission));function parent(rules,pattern){if(pattern.kind==="exact")return resolve(rules,pattern.path,!0);if(pattern.kind==="subtree"){for(let[path,permissions]of rules.subtrees)if(path!==pattern.path&&under(pattern.path,path))return permissions}return rules.all??NOTHING}function canonical(entries){let rules=compile(entries);return compile(entries.filter(([pattern,permissions])=>pattern.kind==="all"?permissions.size>0:!equal(permissions,parent(rules,pattern))))}function entriesOf(can){return can==="all"||Array.isArray(can)?[[{kind:"all"},expand(can)]]:Object.entries(can).map(([pattern,grant])=>[parsePattern(pattern),expand(grant)])}var entriesIn=rules=>[...rules.all?[[{kind:"all"},rules.all]]:[],...rules.subtrees.map(([path,permissions])=>[{kind:"subtree",path},permissions]),...[...rules.exact].map(([path,permissions])=>[{kind:"exact",path},permissions])],RULES=Symbol("board.access"),READABLE_MAX=4096,isAccess=value=>typeof value=="object"&&RULES in value;function fromRules(rules){let entries=entriesIn(rules),everywhere=permission=>(rules.all?.has(permission)??!1)&&entries.every(([,permissions])=>permissions.has(permission)),uniform=rules.exact.size===0&&rules.subtrees.length===0?rules.all?.has("read")??!1:null,readable=new Map,compiled={[RULES]:rules,can:(permission,channel)=>resolve(rules,channel).has(permission),readable(channel){if(uniform!==null)return uniform;let found=readable.get(channel);return found===void 0&&(readable.size>=READABLE_MAX&&readable.clear(),readable.set(channel,found=resolve(rules,channel).has("read"))),found},readsAll:everywhere("read"),everywhere,anywhere:permission=>entries.some(([,permissions])=>permissions.has(permission)),at:(permission,pattern)=>at(rules,parsePattern(pattern)).has(permission),narrow(scope){let other=isAccess(scope)?scope[RULES]:canonical(entriesOf(scope)),patterns=new Map([["*",{kind:"all"}]]);for(let[pattern]of[...entries,...entriesIn(other)])patterns.set(key(pattern),pattern);return fromRules(canonical([...patterns.values()].map(pattern=>{let theirs=at(other,pattern);return[pattern,new Set([...at(rules,pattern)].filter(permission=>theirs.has(permission)))]})))},summary(){let named=entries.map(([pattern,permissions])=>[key(pattern),permissions]);named.sort(([a],[b])=>a==="*"?-1:b==="*"?1:a.localeCompare(b));let out={};for(let[name,permissions]of named)out[name]=[...permissions].sort((a,b)=>ORDER.get(a)-ORDER.get(b));return out}};return Object.freeze(compiled)}function compileAccess(can){return fromRules(canonical(entriesOf(can)))}var FULL_ACCESS=compileAccess("all"),NO_ACCESS=compileAccess([]);var RANK=new Map(["principal","group","everyone"].map((level,index)=>[level,index])),namedIn=can=>entriesOf(can);function closest(matched){let byPattern=new Map;for(let grant of matched)for(let[pattern,permissions]of namedIn(grant.can)){let name=key(pattern),found=byPattern.get(name);if(!found||RANK.get(grant.level)<RANK.get(found.level))byPattern.set(name,{pattern,level:grant.level,permissions:new Set(permissions),sources:[grant.source]});else if(found.level===grant.level){for(let permission of permissions)found.permissions.add(permission);found.sources.includes(grant.source)||found.sources.push(grant.source)}}return byPattern}function combine(matched){return fromRules(canonical([...closest(matched).values()].map(({pattern,permissions})=>[pattern,permissions])))}function decide(matched,channel){let covering=[...closest(matched).values()].filter(({pattern})=>pattern.kind==="all"?!0:pattern.kind==="exact"?pattern.path===channel:under(channel,pattern.path)),specificity=({pattern})=>pattern.kind==="exact"?1/0:pattern.kind==="subtree"?pattern.path.length:-1,[winner,...beaten]=covering.sort((a,b)=>specificity(b)-specificity(a));return winner?{pattern:key(winner.pattern),over:beaten.map(({pattern})=>key(pattern)),level:winner.level,sources:winner.sources,permissions:[...winner.permissions].sort((a,b)=>ORDER.get(a)-ORDER.get(b))}:{pattern:null,over:[],level:null,sources:[],permissions:[]}}function canText(access){let entries=Object.entries(access.summary()).map(([pattern,permissions])=>`${pattern}=${permissions.join(",")}`);return entries.length>0?entries.join(";"):"*="}function parseCan(header,name="x-board-can"){if(header.length>4e3)throw new InvalidCan(`${name} is longer than ${CAN_MAX} characters`);let out={},entries=header.split(";").map(entry=>entry.trim());if(entries.every(entry=>entry===""))throw new InvalidCan(`${name} is empty: write pattern=permissions, like dev/=read,post`);for(let entry of entries){if(entry==="")continue;let split=entry.indexOf("=");if(split<0)throw new InvalidCan(`${name} entry ${entry} needs =: write pattern=permissions, like dev/=read,post`);let pattern=entry.slice(0,split).trim(),list=entry.slice(split+1).trim();if(Object.hasOwn(out,pattern))throw new InvalidCan(`${name} lists ${pattern} twice`);parsePattern(pattern);let permissions=list===""?[]:list.split(",").map(permission=>permission.trim());if(permissions.length===1&&permissions[0]==="all"){out[pattern]="all";continue}for(let permission of permissions)if(!ORDER.has(permission))throw new InvalidCan(`${name}: unknown permission ${permission||"(empty)"}: use ${PERMISSIONS.join(", ")}, or all`);out[pattern]=permissions}return out}function levelOf(principal,facts){let{caller}=facts;switch(principal.kind){case"everyone":return"everyone";case"all-users":return caller.kind==="user"&&facts.member===!0?"group":null;case"user":return caller.kind==="user"&&caller.userId===principal.userId?"principal":null;case"all-projects":return caller.kind==="project"&&facts.teamProject===!0&&principal.environments.includes(caller.environment)?"group":null;case"project":return caller.kind==="project"&&caller.projectId===principal.projectId&&(principal.teamId===void 0||caller.teamId===void 0||caller.teamId===principal.teamId)&&principal.environments.includes(caller.environment)?"principal":null;case"github":{if(caller.kind!=="github")return null;let same=principal.repositoryId!==void 0?caller.repositoryId===principal.repositoryId:caller.repository===principal.repository,workflow=principal.workflow===void 0||caller.ref!==void 0&&caller.workflowRef===`${caller.repository}/${principal.workflow}@${caller.ref}`,branch=principal.branch===void 0||caller.ref===`refs/heads/${principal.branch}`,event=principal.event===void 0||caller.event===principal.event;return same&&workflow&&branch&&event?"principal":null}case"app":return caller.kind==="app"&&caller.clientId===principal.clientId?"principal":null;case"all-apps":return caller.kind==="app"&&facts.teamApp===!0?"group":null;case"oidc":return caller.kind==="oidc"&&caller.issuer===principal.issuer&&Object.entries(principal.claims).every(([name,allowed])=>{let value=caller.claims[name];if(value===void 0)return!1;let given=String(value);return(typeof allowed=="string"?[allowed]:allowed).some(one=>{let prefix=name==="sub"?subPrefix(one):null;return prefix===null?given===one:given.startsWith(prefix)})})?"principal":null}}function subPrefix(value){if(!value.endsWith("*"))return null;let prefix=value.slice(0,-1);return/.[:/]$/.test(prefix)&&!prefix.includes("*")?prefix:null}var RANK2={principal:0,group:1,everyone:2};function matchedFor(facts,own=!1){let matched=[];for(let grant of facts.grants){let best=null;for(let principal of grant.principals){if(own&&principal.kind==="everyone")continue;let level=levelOf(principal,facts);level!==null&&(best===null||RANK2[level]<RANK2[best])&&(best=level)}best!==null&&matched.push({level:best,can:grant.can,source:{grant}})}return matched}function admits(facts,matched=matchedFor(facts)){return facts.caller.kind==="user"&&facts.member===!0?!0:matched.some(found=>found.level!=="everyone")}function limited(access,facts){let out=facts.cap===void 0?access:access.narrow({"*":[...facts.cap]});return facts.can!==void 0&&(out=out.narrow(compileAccess(facts.can))),out}function grantAccess(facts){let matched=matchedFor(facts);return admits(facts,matched)?{caller:limited(combine(matched),facts),own:limited(combine(matchedFor(facts,!0)),facts)}:null}function explainGrants(facts,channel){let matched=matchedFor(facts);if(!admits(facts,matched))return{pattern:null,over:[],level:null,grants:[],capped:!1,permissions:[]};let decision=decide(matched,channel),cap=facts.cap===void 0?null:compileAccess({"*":[...facts.cap]}),capped=cap?decision.permissions.filter(permission=>cap.can(permission,channel)):[...decision.permissions],token=facts.can===void 0?null:compileAccess(facts.can);return{pattern:decision.pattern,over:[...decision.over],level:decision.level,grants:decision.sources.map(source=>source.grant),capped:capped.length<decision.permissions.length,permissions:token?capped.filter(permission=>token.can(permission,channel)):capped}}var VERCEL_ISSUER=/^https:\/\/oidc\.vercel\.com(?:\/[a-z0-9-]+)?$/;var issuerName=iss=>{let url=new URL(iss);return`${url.host}${url.pathname.replace(/\/+$/,"")}`.replace(/[%:]/g,char=>char==="%"?"%25":"%3A")},subFits=sub=>!/[\s+\]]/.test(sub);function trustedIssuers(issuers){let named=new Map;for(let iss of issuers){let name=issuerName(iss),other=named.get(name);if(other!==void 0&&other!==iss)throw new Error(`oidc issuers ${other} and ${iss} name the same principals, oidc:${name}:<sub>: pin one of them`);named.set(name,iss)}return new Set(issuers)}var DEFAULT_CAN=Object.freeze({"*":Object.freeze(["read","post","react","label"])});function privateHost(host){let name=host.toLowerCase().replace(/\.$/,"");return name.startsWith("[")||/^\d+(\.\d+){3}$/.test(name)||/^\d+$/.test(name)||!name.includes(".")||name==="localhost"?!0:/\.(localhost|local|internal|home|lan|corp|intranet)$/.test(name)}var userIdOf=id=>id.split(":").slice(2).join(":");function callerFacts(principal,facts,team){let claims=facts?.claims??{};return principal.kind==="person"?{caller:{kind:"user",userId:userIdOf(principal.id)},member:!0}:facts?.issuer==="vercel"?{caller:{kind:"project",projectId:String(claims.project_id??""),environment:String(claims.environment??""),...typeof claims.owner_id=="string"?{teamId:claims.owner_id}:{}},teamProject:team!==null&&claims.owner_id===team}:facts?.issuer==="github"?{caller:{kind:"github",repository:String(claims.repository??""),...claims.repository_id!==void 0?{repositoryId:String(claims.repository_id)}:{},...claims.workflow_ref!==void 0?{workflowRef:String(claims.workflow_ref)}:{},...claims.ref!==void 0?{ref:String(claims.ref)}:{},...claims.event_name!==void 0?{event:String(claims.event_name)}:{}}}:facts?.issuer==="oidc"?{caller:{kind:"oidc",issuer:facts.iss,claims}}:null}function verifiedIssuers(base,granted){let taken=new Set(base.map(issuerName)),issuers=[...base];for(let issuer of granted){if(base.includes(issuer))continue;let url=URL.parse(issuer);if(url?.protocol!=="https:"||privateHost(url.hostname))continue;let name=issuerName(issuer);taken.has(name)||(taken.add(name),issuers.push(issuer))}return issuers}var grantIssuers=grants=>[...new Set(grants.flatMap(grant=>grant.principals.flatMap(principal=>principal.kind==="oidc"?[principal.issuer]:[])))],notGranted=(who,grant)=>new HttpError(403,"forbidden",`this token can't use this board: no grant lets in ${who}`,{hint:`Grant it: vb grants create ${grant}`});function createAuthority(options){async function factsFor(principal,facts,team,snapshot){let grants=snapshot??(options.grants?await options.grants():[]),known=callerFacts(principal,facts,team);return{grants,facts:known?{...known,grants}:null}}async function byGrants(principal,facts,snapshot){let claims=facts?.claims??{},own=facts?.issuer==="vercel"?await options.project():null,environment=String(claims.environment??""),here=boardEnvironment(),ownDeployment=own!==null&&own.id!==null&&claims.project_id===own.id;if(ownDeployment&&here!==null&&environment===here)return{fixed:FULL_ACCESS};if(!facts)throw forbidden("this token can't use this board");let{grants,facts:found}=await factsFor(principal,facts,own?.teamId??null,snapshot);if(found&&admits(found))return{facts:found};if(facts.issuer==="oidc"&&!grantIssuers(grants).includes(facts.iss))throw unauthorized(`untrusted issuer: ${facts.iss}`);if(facts.issuer==="oidc")throw forbidden("this token can't use this board: no grant lets in its claims");if(facts.issuer==="github"){let repository=String(claims.repository??"");throw notGranted(repository||"its repository",`--github ${repository||"<OWNER/REPO>"}`)}let project=String(claims.project_id??"")||"<PROJECT_ID>",grant2=`--project ${project} --environment ${environment||"<ENVIRONMENT>"}`;throw ownDeployment?new HttpError(403,"forbidden",`this token can't use this board: it runs in ${here??"no Vercel environment"}, and its ${environment||"unnamed"} deployments need a grant`,{hint:`Grant them: vb grants create ${grant2}`}):notGranted(`project ${project} in ${environment||"no environment"}`,grant2)}async function resolve2(principal,snapshot){let hosted=principal.facts?.issuer==="host";if(principal.id.startsWith("board:")||principal.kind==="external"&&!hosted)return{fixed:FULL_ACCESS};if(hosted){if(!options.hosts)throw forbidden("this token can't use this board: its board no longer takes a host's principals");let{exp}=principal.facts.claims;if(typeof exp=="number"&&exp*1e3<=Date.now())throw unauthorized("token expired")}if(principal.kind==="person"){if(!options.grants)return{fixed:FULL_ACCESS};let{facts}=await factsFor(principal,null,null,snapshot);return{facts}}return byGrants(principal,(hosted?void 0:principal.facts)??factsFromId(principal.id),snapshot)}async function grant(principal,snapshot){let resolved=await resolve2(principal,snapshot),scope=principal.scope===void 0?void 0:parseCan(principal.scope);if("fixed"in resolved)return scope===void 0?resolved.fixed:resolved.fixed.narrow(scope);let decided=grantAccess({...resolved.facts,...scope!==void 0?{can:scope}:{}});if(!decided)throw forbidden("this token can't use this board");return decided.caller}async function accessNow(principal,snapshot){try{return await grant(principal,snapshot)}catch(error){let status=error.status;if(status===401||status===403)return null;throw error}}return{grant,accessNow,resolve:resolve2}}var boardEnvironment=()=>process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||null;function factsFromId(id){let deployment=id.match(/^vercel:project:([^:]+):([^:]+)$/);return deployment?{issuer:"vercel",iss:"",claims:{project_id:deployment[1],environment:deployment[2]}}:null}var TOKENS=Symbol("board.oidcTokens"),LOGINS=Symbol("board.logins"),namesByLogin=authenticate=>LOGINS in authenticate,verifiedTokens=new WeakSet;function markVerified(principal){return verifiedTokens.add(principal),principal}var verifiesTokens=authenticate=>TOKENS in authenticate,fromTokens=principal=>verifiedTokens.has(principal),PRINCIPAL_ID=/^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*:[^\s+\]]{1,200}$/,KINDS=["person","deployment","workflow","external"];function hostPrincipal(value){let fail=why=>{throw new TypeError(`authenticate returned an invalid principal: ${why}`)};(typeof value!="object"||value===null)&&fail("not an object"),(typeof value.id!="string"||!PRINCIPAL_ID.test(value.id)||value.id.startsWith("board:"))&&fail(`id must look like \`vercel:user:<id>\`, got ${JSON.stringify(value.id)}`),KINDS.includes(value.kind)||fail(`kind must be one of ${KINDS.join(", ")}`),(typeof value.handle!="string"||!/^\S{1,64}$/.test(value.handle))&&fail("handle must be 1-64 characters, no spaces");let expiresAt=value.expiresAt??null;if(expiresAt!==null&&(!(expiresAt instanceof Date)||Number.isNaN(expiresAt.getTime()))&&fail("expiresAt must be a Date or null"),expiresAt!==null&&expiresAt.getTime()<=Date.now())throw unauthorized("token expired");let claims=expiresAt===null?{}:{exp:Math.floor(expiresAt.getTime()/1e3)};return{id:value.id,kind:value.kind,handle:value.handle,expiresAt,facts:{issuer:"host",iss:"",claims}}}var JOSEError=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(message2,options){super(message2,options),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},JWTClaimValidationFailed=class extends JOSEError{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JWTExpired=class extends JOSEError{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JOSEAlgNotAllowed=class extends JOSEError{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},JOSENotSupported=class extends JOSEError{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var JWSInvalid=class extends JOSEError{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},JWTInvalid=class extends JOSEError{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var JWKSInvalid=class extends JOSEError{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},JWKSNoMatchingKey=class extends JOSEError{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(message2="no applicable key found in the JSON Web Key Set",options){super(message2,options)}},JWKSMultipleMatchingKeys=class extends JOSEError{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(message2="multiple matching keys found in the JSON Web Key Set",options){super(message2,options)}},JWKSTimeout=class extends JOSEError{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(message2="request timed out",options){super(message2,options)}},JWSSignatureVerificationFailed=class extends JOSEError{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(message2="signature verification failed",options){super(message2,options)}};function table(entries){let out={__proto__:null};for(let alg in entries)out[alg]={...entries[alg],alg};return out}var sig=[["verify"],["sign"]];function hmac(bits){let subtle={name:"HMAC",hash:`SHA-${bits}`};return{kty:["oct"],secret:!0,subtle,signing:subtle,usages:sig}}function rsa(bits,saltLength){let subtle={name:saltLength?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${bits}`};return{kty:["RSA"],subtle,signing:saltLength?{...subtle,saltLength}:subtle,usages:sig,minRsaBits:2048}}function ecdsa(crv,bits){return{kty:["EC"],crv,subtle:{name:"ECDSA",namedCurve:crv},signing:{name:"ECDSA",hash:`SHA-${bits}`},usages:sig}}function eddsa(){let subtle={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle,signing:subtle,usages:sig}}function mldsa(parameterSet){let subtle={name:`ML-DSA-${parameterSet}`};return{kty:["AKP"],subtle,signing:subtle,usages:sig}}var JWS=table({HS256:hmac(256),HS384:hmac(384),HS512:hmac(512),RS256:rsa(256),RS384:rsa(384),RS512:rsa(512),PS256:rsa(256,32),PS384:rsa(384,48),PS512:rsa(512,64),ES256:ecdsa("P-256",256),ES384:ecdsa("P-384",384),ES512:ecdsa("P-521",512),EdDSA:eddsa(),Ed25519:eddsa(),"ML-DSA-44":mldsa(44),"ML-DSA-65":mldsa(65),"ML-DSA-87":mldsa(87)});function jwsAlgorithm(alg){let entry=typeof alg=="string"?JWS[alg]:void 0;if(!entry)throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);return entry}var encoder=new TextEncoder,decoder=new TextDecoder,strictDecoder=new TextDecoder("utf-8",{fatal:!0}),UINT32_RANGE=2**32;function concat(...buffers){let size=buffers.reduce((acc,{length})=>acc+length,0),buf=new Uint8Array(size),i=0;for(let buffer of buffers)buf.set(buffer,i),i+=buffer.length;return buf}var NON_ASCII=/[^\x00-\x7f]/;function encode(string){if(typeof string=="string"&&string.length>=128){if(NON_ASCII.test(string))throw new TypeError("non-ASCII string encountered in encode()");return encoder.encode(string)}let bytes=new Uint8Array(string.length);for(let i=0;i<string.length;i++){let code=string.charCodeAt(i);if(code>127)throw new TypeError("non-ASCII string encountered in encode()");bytes[i]=code}return bytes}function decodeBase64(encoded,url=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(encoded,{alphabet:url?"base64url":"base64"});if(url){if(encoded.includes("+")||encoded.includes("/"))throw new TypeError("Invalid base64url");encoded=encoded.replace(/-/g,"+").replace(/_/g,"/")}let binary=atob(encoded),bytes=new Uint8Array(binary.length);for(let i=0;i<binary.length;i++)bytes[i]=binary.charCodeAt(i);return bytes}var invalid="The input to be decoded is not correctly encoded.";function decode(input){try{return decodeBase64(typeof input=="string"?input:decoder.decode(input),!0)}catch(cause){throw new TypeError(invalid,{cause})}}function isObject(input){if(typeof input!="object"||input===null||Object.prototype.toString.call(input)!=="[object Object]")return!1;let prototype=Object.getPrototypeOf(input);return prototype===null||Object.getPrototypeOf(prototype)===null}function isJwkSet(input){return isObject(input)&&Array.isArray(input.keys)&&Array.from(input.keys).every(isObject)}function isDisjoint(...headers){let parameters=new Set;for(let header of headers)if(header)for(let parameter of Object.keys(header)){if(parameters.has(parameter))return!1;parameters.add(parameter)}return!0}function decodeBase64url(value,label,ErrorClass){try{return decode(value)}catch(cause){throw new ErrorClass(`Failed to base64url decode the ${label}`,{cause})}}function encodeAsciiMember(value,label,ErrorClass){try{return encode(value)}catch(cause){throw new ErrorClass(`The ${label} is not a valid base64url string`,{cause})}}function parseJoseHeader(encodedProtectedHeader,ErrorClass,message2){let parsed;try{parsed=JSON.parse(strictDecoder.decode(decode(encodedProtectedHeader)))}catch(cause){throw new ErrorClass(message2,{cause})}if(!isObject(parsed))throw new ErrorClass(message2);return parsed}var JWS_RECOGNIZED={__proto__:null,b64:!0};function validateAlgorithms(option,algorithms){if(algorithms!==void 0&&(!Array.isArray(algorithms)||algorithms.some(s=>typeof s!="string")))throw new TypeError(`"${option}" option must be an array of strings`);return algorithms===void 0?void 0:new Set(algorithms)}function validateCrit(Err,recognizedDefault,recognizedOption,protectedHeader,joseHeader){if(joseHeader.crit!==void 0&&protectedHeader?.crit===void 0)throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');if(!protectedHeader||protectedHeader.crit===void 0)return[];if(!Array.isArray(protectedHeader.crit)||protectedHeader.crit.length===0||protectedHeader.crit.some(input=>typeof input!="string"||input.length===0))throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let recognized=recognizedOption===void 0?recognizedDefault:{__proto__:null,...recognizedOption,...recognizedDefault};for(let parameter of protectedHeader.crit){if(!(parameter in recognized))throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);if(!Object.hasOwn(joseHeader,parameter)||joseHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" is missing`);if(recognized[parameter]&&(!Object.hasOwn(protectedHeader,parameter)||protectedHeader[parameter]===void 0))throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`)}return protectedHeader.crit}function validateB64(protectedHeader,extensions){if(extensions.includes("b64")){let b64=protectedHeader.b64;if(typeof b64!="boolean")throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return b64}return!0}var tag=key2=>key2[Symbol.toStringTag],jwkMatchesOp=(entry,key2,usage)=>{let{alg}=entry;if(key2.use!==void 0){let expected=usage==="sign"||usage==="verify"?"sig":"enc";if(key2.use!==expected)throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`)}if(key2.alg!==void 0&&key2.alg!==alg)throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);if(Array.isArray(key2.key_ops)){let expectedKeyOp=usage==="encrypt"||usage==="decrypt"?entry.ops?.[usage==="encrypt"?0:1]:usage;if(expectedKeyOp&&!key2.key_ops.includes(expectedKeyOp))throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`)}};async function prepareKey(entry,key2,usage){let{alg,secret}=entry,requiresPrivateKey=usage==="decrypt"||usage==="sign";if(secret&&key2 instanceof Uint8Array)return key2;let normalized,keyObject;if(isObject(key2)){if(normalized=normalizeJwk(key2),typeof normalized.kty!="string")throw invalidKeyType(alg,key2,secret);if(!(secret?normalized.kty==="oct"&&typeof normalized.k=="string":normalized.kty!=="oct"&&(requiresPrivateKey?normalized.kty==="AKP"&&typeof normalized.priv=="string"||typeof normalized.d=="string":normalized.d===void 0&&normalized.priv===void 0)))throw new TypeError(secret?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${requiresPrivateKey?"private":"public"} JWK`);if(jwkMatchesOp(entry,normalized,usage),normalized.kty==="oct")return decode(normalized.k);if(!Object.isFrozen(key2)){let{key_ops}=key2;Array.isArray(key_ops)&&Object.freeze(key_ops),Object.freeze(key2)}}else{if(!isKeyLike(key2))throw invalidKeyType(alg,key2,secret);let expectedType=secret?"secret":requiresPrivateKey?"private":"public";if(key2.type!==expectedType&&(secret||["secret","public","private"].includes(key2.type)))throw new TypeError(`${tag(key2)} instances must be of type "${expectedType}" for the ${alg} algorithm`);if(isCryptoKey(key2))return key2;if(keyObject=key2,keyObject.type==="secret")return keyObject.export()}cache||=new WeakMap;let cacheKey=key2,cached=cache.get(cacheKey);if(cached?.[alg])return cached[alg];if(cached||cache.set(cacheKey,cached={}),keyObject&&typeof keyObject.toCryptoKey=="function"){let isPublic=keyObject.type==="public",crv=nist[keyObject.asymmetricKeyDetails?.namedCurve],params=entry.resolve?.({crv,asymmetricKeyType:keyObject.asymmetricKeyType})??entry.subtle;return cached[alg]=keyObject.toCryptoKey(params,isPublic,entry.usages[isPublic?0:1])}return normalized??=keyObject.export({format:"jwk"}),normalized.alg=alg,cached[alg]=await jwkToKey(entry,normalized)}var cache,nist={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};var isCryptoKey=key2=>{if(key2?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return key2 instanceof CryptoKey}catch{return!1}},isKeyObject=key2=>key2?.[Symbol.toStringTag]==="KeyObject",isKeyLike=key2=>isCryptoKey(key2)||isKeyObject(key2);function message(msg,actual,...types){if(types.length>2){let last=types.pop();msg+=`one of type ${types.join(", ")}, or ${last}.`}else types.length===2?msg+=`one of type ${types[0]} or ${types[1]}.`:msg+=`of type ${types[0]}.`;return actual==null?msg+=` Received ${actual}`:typeof actual=="function"&&actual.name?msg+=` Received function ${actual.name}`:typeof actual=="object"&&actual!=null&&actual.constructor?.name&&(msg+=` Received an instance of ${actual.constructor.name}`),msg}function invalidKeyType(alg,actual,secret){let types=["CryptoKey","KeyObject","JSON Web Key"];return secret&&types.push("Uint8Array"),new TypeError(message(`Key for the ${alg} algorithm must be `,actual,...types))}var unusable=(name,prop="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);function checkUsage(key2,usage){if(usage&&!key2.usages.includes(usage))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`)}function checkModulusLength(alg,key2){let{modulusLength}=key2.algorithm;if(typeof modulusLength!="number"||modulusLength<2048)throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`)}function checkCryptoKey(key2,expected,usage){let algorithm=key2.algorithm;if(algorithm.name!==expected.name)throw unusable(expected.name);if(expected.hash&&algorithm.hash?.name!==expected.hash)throw unusable(expected.hash,"algorithm.hash");if(expected.namedCurve&&algorithm.namedCurve!==expected.namedCurve)throw unusable(expected.namedCurve,"algorithm.namedCurve");if(expected.length!==void 0&&algorithm.length!==expected.length)throw unusable(expected.length,"algorithm.length");checkUsage(key2,usage)}function snapshotJwk(jwk){return{__proto__:null,...jwk}}function normalizeJwk(jwk){let normalized=snapshotJwk(jwk);if(normalized.ext!==void 0&&typeof normalized.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(normalized.key_ops!==void 0){let value=normalized.key_ops,keyOps=Array.isArray(value)?[...value]:void 0;if(!keyOps||keyOps.some(operation=>typeof operation!="string")||new Set(keyOps).size!==keyOps.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');normalized.key_ops=keyOps}return normalized}async function jwkToKey(entry,jwk,extractable){if(!entry.kty.includes(jwk.kty))throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let algorithm=entry.resolve?.({kty:jwk.kty,crv:jwk.crv})??entry.subtle,isPrivate=!!(jwk.d||jwk.priv),keyData={...jwk,ext:extractable??jwk.ext};return keyData.kty!=="AKP"&&delete keyData.alg,delete keyData.use,crypto.subtle.importKey("jwk",keyData,algorithm,keyData.ext??!isPrivate,jwk.key_ops??entry.usages[isPrivate?1:0])}async function rawKey(key2,expected,usage,extractable=!1){return key2 instanceof Uint8Array&&(key2=await crypto.subtle.importKey("raw",key2,expected,extractable,[usage])),checkCryptoKey(key2,expected,usage),key2}function prepareVerify(options){return[options&&validateAlgorithms("algorithms",options.algorithms),options?.crit]}function parseProtectedHeader(encodedProtectedHeader){return encodedProtectedHeader===void 0?{}:parseJoseHeader(encodedProtectedHeader,JWSInvalid,"JWS Protected Header is invalid")}function encodeCompactUnencodedPayload(payload){try{return encode(payload)}catch(cause){throw new JWSInvalid("JWS Compact Serialization payload must use only ASCII characters",{cause})}}async function verifySignature(jws,shared,key2,encodeUnencodedPayload,parsedProtected){let{protected:encodedProtectedHeader,header,payload:inputPayload}=jws,protectedHeader=parsedProtected??parseProtectedHeader(encodedProtectedHeader);if(!isDisjoint(protectedHeader,header))throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let joseHeader={...protectedHeader,...header},b64=validateB64(protectedHeader,validateCrit(JWSInvalid,JWS_RECOGNIZED,shared[1],protectedHeader,joseHeader)),{alg}=joseHeader;if(typeof alg!="string"||!alg)throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(shared[0]&&!shared[0].has(alg))throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');if(b64){if(typeof inputPayload!="string")throw new JWSInvalid("JWS Payload must be a string")}else if(typeof inputPayload!="string"&&!(inputPayload instanceof Uint8Array))throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");let signingPayload=b64||typeof inputPayload!="string"?inputPayload:encodeUnencodedPayload(inputPayload),resolvedKey=!1;typeof key2=="function"&&(key2=await key2(protectedHeader,jws),resolvedKey=!0);let entry=jwsAlgorithm(alg),signingInput=concat(encodedProtectedHeader!==void 0?encode(encodedProtectedHeader):new Uint8Array,encode("."),typeof signingPayload=="string"?shared[2]??=encodeAsciiMember(signingPayload,"payload",JWSInvalid):signingPayload),signature=decodeBase64url(jws.signature,"signature",JWSInvalid),verificationKey=await prepareKey(entry,key2,"verify"),cryptoKey=await rawKey(verificationKey,entry.subtle,"verify");entry.minRsaBits&&checkModulusLength(entry.alg,cryptoKey);let verified=!1;try{verified=await crypto.subtle.verify(entry.signing,cryptoKey,signature,signingInput)}catch(cause){throw new JWSSignatureVerificationFailed(void 0,{cause})}if(!verified)throw new JWSSignatureVerificationFailed;let result={payload:typeof signingPayload=="string"?decodeBase64url(signingPayload,"payload",JWSInvalid):signingPayload};return encodedProtectedHeader!==void 0&&(result.protectedHeader=protectedHeader),header!==void 0&&(result.unprotectedHeader=header),resolvedKey?[{...result,key:verificationKey},b64]:[result,b64]}async function verifyCompact(jws,shared,key2){if(jws instanceof Uint8Array&&(jws=decoder.decode(jws)),typeof jws!="string")throw new JWSInvalid("Compact JWS must be a string or Uint8Array");let{0:protectedHeader,1:payload,2:signature,length}=jws.split(".");if(length!==3)throw new JWSInvalid("Invalid Compact JWS");return verifySignature({payload,protected:protectedHeader,signature},shared,key2,encodeCompactUnencodedPayload)}var epoch=date=>Math.floor(date.getTime()/1e3),multipliers={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},REGEX=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,checkFailed="check_failed";function invalidDuration(){throw new TypeError("Invalid time period format")}function secs(str){typeof str!="string"&&invalidDuration();let matched=REGEX.exec(str);(!matched||matched[4]&&matched[1])&&invalidDuration();let value=parseFloat(matched[2]),durationSeconds=Math.round(value*multipliers[matched[3][0].toLowerCase()]);return Number.isFinite(durationSeconds)||invalidDuration(),matched[1]==="-"||matched[4]==="ago"?-durationSeconds:durationSeconds}function validateInput(label,input){if(!Number.isFinite(input))throw new TypeError(`Invalid ${label} input`);return input}var normalizeTyp=value=>{let normalized=value.toLowerCase();return value.includes("/")?normalized:`application/${normalized}`},checkAudiencePresence=(audPayload,audOption)=>typeof audPayload=="string"?audOption.includes(audPayload):Array.isArray(audPayload)?audOption.some(aud=>audPayload.includes(aud)):!1;function validateNumericDate(claimsSet,claim,required=!1){let value=claimsSet[claim];if(!(value===void 0&&!required)){if(typeof value!="number")throw new JWTClaimValidationFailed(`"${claim}" claim must be a number`,claimsSet,claim,"invalid");return value}}function unexpectedClaim(claimsSet,claim){throw new JWTClaimValidationFailed(`unexpected "${claim}" claim value`,claimsSet,claim,checkFailed)}function validateClaimsSet(protectedHeader,claimsSetBytes,options={}){let claimsSet;try{claimsSet=JSON.parse(strictDecoder.decode(claimsSetBytes))}catch(cause){throw new JWTInvalid("JWT Claims Set must be a top-level JSON object",{cause})}if(!isObject(claimsSet))throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");let{typ}=options;if(typ!==void 0&&(typeof protectedHeader.typ!="string"||normalizeTyp(protectedHeader.typ)!==normalizeTyp(typ)))throw new JWTClaimValidationFailed('unexpected "typ" JWT header value',claimsSet,"typ",checkFailed);let{requiredClaims=[],issuer,subject,audience,maxTokenAge}=options,presenceCheck=[...requiredClaims];maxTokenAge!==void 0&&presenceCheck.push("iat"),audience!==void 0&&presenceCheck.push("aud"),subject!==void 0&&presenceCheck.push("sub"),issuer!==void 0&&presenceCheck.push("iss");for(let claim of new Set(presenceCheck.reverse()))if(!Object.hasOwn(claimsSet,claim))throw new JWTClaimValidationFailed(`missing required "${claim}" claim`,claimsSet,claim,"missing");issuer!==void 0&&!(Array.isArray(issuer)?issuer:[issuer]).includes(claimsSet.iss)&&unexpectedClaim(claimsSet,"iss"),subject!==void 0&&claimsSet.sub!==subject&&unexpectedClaim(claimsSet,"sub"),audience!==void 0&&!checkAudiencePresence(claimsSet.aud,typeof audience=="string"?[audience]:audience)&&unexpectedClaim(claimsSet,"aud");let{clockTolerance}=options,tolerance=0;if(typeof clockTolerance=="string")tolerance=secs(clockTolerance);else if(clockTolerance!==void 0){if(typeof clockTolerance!="number")throw new TypeError("Invalid clockTolerance option type");tolerance=clockTolerance}validateInput("clockTolerance option",tolerance);let{currentDate}=options,now=validateInput("currentDate option",epoch(currentDate===void 0?new Date:currentDate)),iat=validateNumericDate(claimsSet,"iat",maxTokenAge!==void 0),nbf=validateNumericDate(claimsSet,"nbf");if(nbf!==void 0&&nbf>now+tolerance)throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed',claimsSet,"nbf",checkFailed);let exp=validateNumericDate(claimsSet,"exp");if(exp!==void 0&&exp<=now-tolerance)throw new JWTExpired('"exp" claim timestamp check failed',claimsSet,"exp",checkFailed);if(maxTokenAge!==void 0){let age=now-iat,max=validateInput("maxTokenAge option",typeof maxTokenAge=="number"?maxTokenAge:secs(maxTokenAge));if(age-tolerance>max)throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)',claimsSet,"iat",checkFailed);if(age<-tolerance)throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',claimsSet,"iat",checkFailed)}return claimsSet}async function jwtVerify(jwt,key2,options){let[verified,b64]=await verifyCompact(jwt,prepareVerify(options),key2);if(!b64)throw new JWTInvalid("JWTs MUST NOT use unencoded payload");let payload=validateClaimsSet(verified.protectedHeader,verified.payload,options);return{...verified,payload}}function isUsableJWK(jwk,entry,alg,kid){let{kty,key_ops:keyOps,ext,kid:jwkKid,alg:jwkAlg,use,crv}=jwk;return(ext===void 0||typeof ext=="boolean")&&(keyOps===void 0||Array.isArray(keyOps)&&keyOps.every((operation,index)=>typeof operation=="string"&&keyOps.indexOf(operation)===index)&&keyOps.includes("verify"))&&entry.kty.includes(kty)&&(kid===void 0||typeof kid=="string"&&kid===jwkKid)&&(jwkAlg===void 0?kty!=="AKP":alg===jwkAlg)&&(use===void 0||use==="sig")&&(!entry.crv||crv===entry.crv)}async function importWithAlgCache(cache2,jwk,entry){let cached=cache2.get(jwk)||cache2.set(jwk,{}).get(jwk),{alg}=entry;if(cached[alg]===void 0){let pending=jwkToKey(entry,jwk,!0).then(key2=>{if(key2.type!=="public")throw new JWKSInvalid("JSON Web Key Set members must be public keys");return cached[alg]=key2,key2}).catch(error=>{throw cached[alg]===pending&&delete cached[alg],error});cached[alg]=pending}return cached[alg]}function createLocalJWKSet(jwks){let snapshot;try{snapshot=structuredClone(jwks)}catch(cause){throw new JWKSInvalid("JSON Web Key Set malformed",{cause})}if(!isJwkSet(snapshot))throw new JWKSInvalid("JSON Web Key Set malformed");let metadata=snapshot.keys.map(jwk=>{let normalized=snapshotJwk(jwk);return Array.isArray(normalized.key_ops)&&(normalized.key_ops=[...normalized.key_ops]),normalized}),cached=new WeakMap;return Object.defineProperty(async(protectedHeader,token)=>{let{alg,kid}={...protectedHeader,...token?.header},entry=typeof alg=="string"?JWS[alg]:void 0;if(!entry||entry.secret)throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');let candidates=snapshot.keys.filter((_,index)=>isUsableJWK(metadata[index],entry,alg,kid)),{0:jwk,length}=candidates;if(!length)throw new JWKSNoMatchingKey;if(length!==1){let error=new JWKSMultipleMatchingKeys;throw error[Symbol.asyncIterator]=async function*(){for(let jwk2 of candidates)try{yield await importWithAlgCache(cached,jwk2,entry)}catch{}},error}return importWithAlgCache(cached,jwk,entry)},"jwks",{value:()=>structuredClone(snapshot)})}function isCloudflareWorkers(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var USER_AGENT;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(USER_AGENT="jose/v6.2.14");var customFetch=Symbol();async function fetchJwks(url,headers,signal,fetchImpl=fetch){let response=await fetchImpl(url,{method:"GET",signal,redirect:"manual",headers}).catch(err=>{throw err.name==="TimeoutError"?new JWKSTimeout(void 0,{cause:err}):err});if(response.status!==200)throw new JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await response.json()}catch(cause){throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON",{cause})}}var jwksCache=Symbol();function isFreshFor(timestamp,duration){return Number.isFinite(timestamp)&&Date.now()<timestamp+duration}function validateDuration(value,fallback,option){if(Number.isNaN(value))throw new TypeError(`"${option}" option must not be NaN`);return typeof value=="number"?value:fallback}function createRemoteJWKSet(url,options){if(!(url instanceof URL))throw new TypeError("url must be an instance of URL");let href=new URL(url.href).href,opts=options??{},timeoutOption=opts.timeoutDuration;if(typeof timeoutOption=="number"&&(!Number.isInteger(timeoutOption)||timeoutOption<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');let timeoutDuration=typeof timeoutOption=="number"?timeoutOption:5e3,cooldownDuration=validateDuration(opts.cooldownDuration,3e4,"cooldownDuration"),cacheMaxAge=validateDuration(opts.cacheMaxAge,6e5,"cacheMaxAge"),headers=new Headers(opts.headers);USER_AGENT&&!headers.has("User-Agent")&&headers.set("User-Agent",USER_AGENT),headers.has("accept")||headers.set("accept","application/json, application/jwk-set+json");let fetchImpl=opts[customFetch],cache2=opts[jwksCache],jwksTimestamp,pendingFetch,reloadSequence=0,appliedSequence=0,local;if(cache2&&typeof cache2=="object"){let{uat,jwks}=cache2;isFreshFor(uat,cacheMaxAge)&&isJwkSet(jwks)&&(jwksTimestamp=uat,local=createLocalJWKSet(jwks))}let reload=async()=>{if(pendingFetch&&isCloudflareWorkers()&&(pendingFetch=void 0),!pendingFetch){let sequence=++reloadSequence,current=pendingFetch=fetchJwks(href,headers,AbortSignal.timeout(timeoutDuration),fetchImpl).then(json=>{let next=createLocalJWKSet(json);if(sequence<=appliedSequence)return;local=next;let updatedAt=Date.now();cache2&&(cache2.uat=updatedAt,cache2.jwks=json),jwksTimestamp=updatedAt,appliedSequence=sequence}).finally(()=>{pendingFetch===current&&(pendingFetch=void 0)})}await pendingFetch};return Object.defineProperties(async(protectedHeader,token)=>{(!local||!isFreshFor(jwksTimestamp,cacheMaxAge))&&await reload();try{return await local(protectedHeader,token)}catch(err){if(err instanceof JWKSNoMatchingKey&&!isFreshFor(jwksTimestamp,cooldownDuration))return await reload(),local(protectedHeader,token);throw err}},{coolingDown:{get:()=>isFreshFor(jwksTimestamp,cooldownDuration),enumerable:!0},fresh:{get:()=>isFreshFor(jwksTimestamp,cacheMaxAge),enumerable:!0},reload:{value:reload,enumerable:!0},reloading:{get:()=>!!pendingFetch,enumerable:!0},jwks:{value:()=>local?.jwks(),enumerable:!0}})}function decodeJwt(jwt){if(typeof jwt!="string")throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");let{1:encodedPayload,length}=jwt.split(".");if(length===5)throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(length!==3)throw new JWTInvalid("Invalid JWT");if(!encodedPayload)throw new JWTInvalid("JWTs must contain a payload");let claimsSetBytes;try{claimsSetBytes=decode(encodedPayload)}catch(cause){throw new JWTInvalid("Failed to base64url decode the payload",{cause})}let claimsSet;try{claimsSet=JSON.parse(strictDecoder.decode(claimsSetBytes))}catch(cause){throw new JWTInvalid("Failed to parse the decoded payload as JSON",{cause})}if(!isObject(claimsSet))throw new JWTInvalid("Invalid JWT Claims Set");return claimsSet}export{PERMISSIONS,InvalidCan,parsePattern,compileAccess,FULL_ACCESS,canText,parseCan,explainGrants,VERCEL_ISSUER,issuerName,subFits,trustedIssuers,DEFAULT_CAN,privateHost,verifiedIssuers,grantIssuers,createAuthority,TOKENS,namesByLogin,markVerified,verifiesTokens,fromTokens,hostPrincipal,jwtVerify,createRemoteJWKSet,decodeJwt};
@@ -0,0 +1,7 @@
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{pull}from"./chunk-6D44CCJA.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{getLinkedProject,warnEnvFileSymlink}from"./chunk-NJFXR3FN.js";import{EnvFileSymlinkError}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";async function createBlobStore(client,input,accountId,requestOptions){let result=await client.fetch("/v1/storage/stores/blob",{...requestOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(input),accountId});if(!result.store?.id)throw new Error("Blob creation returned no store ID.");return{id:result.store.id,region:result.store.region}}async function connectResourceToProject(client,projectId,storeId,environments,options){let path=`/v1/storage/stores/${encodeURIComponent(storeId)}/connections`;return client.fetch(path,{retry:options?.retry,bailOn429:options?.bailOn429,signal:options?.signal,json:!0,method:"POST",body:{envVarEnvironments:environments,projectId,type:"integration",...options?.envVarPrefix!==void 0?{envVarPrefix:options.envVarPrefix}:{}},accountId:options?.accountId})}var import_chalk=__toESM(require_source(),1);var VALID_ENVIRONMENTS=["production","preview","development"],ENV_PULL_FAILED_MESSAGE="Failed to pull environment variables. You can run `vercel env pull` manually.";function validateEnvironments(environments){let invalid=environments.filter(env=>!VALID_ENVIRONMENTS.includes(env));return invalid.length>0?{valid:!1,invalid}:{valid:!0}}async function postProvisionSetup(client,resourceName,resourceId,contextName,options={}){let dashboardUrl=options.integrationSlug&&options.installationId?`https://vercel.com/d/dashboard/integrations/${options.integrationSlug}/${options.installationId}/resources/${resourceId}`:`https://vercel.com/${contextName}/~/stores/integration/${resourceId}`;output_manager_default.log(indent_default(`Dashboard: ${output_manager_default.link(dashboardUrl,dashboardUrl,{fallback:!1})}`,4));let baseResult={exitCode:0,dashboardUrl,connected:!1,environments:[],envPulled:!1};if(options.noConnect)return baseResult;let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return{...baseResult,exitCode:linkedProject.exitCode};if(linkedProject.status==="not_linked")return baseResult;let{project}=linkedProject,environments=[...new Set(options.environments&&options.environments.length>0?options.environments:[...VALID_ENVIRONMENTS])];output_manager_default.debug(`Selected environments: ${JSON.stringify(environments)}`),output_manager_default.spinner(`Connecting ${import_chalk.default.bold(resourceName)} to ${import_chalk.default.bold(project.name)}...`),output_manager_default.debug(`Connecting resource ${resourceId} to project ${project.id}`);try{await connectResourceToProject(client,project.id,resourceId,environments,options.prefix?{envVarPrefix:options.prefix}:void 0)}catch(error){return output_manager_default.stopSpinner(),options.onProjectConnectFailed?.(project.id,error),output_manager_default.error(`Failed to connect: ${error.message}`),{...baseResult,exitCode:1,project:{id:project.id,name:project.name},environments,connectError:error.message}}output_manager_default.stopSpinner(),output_manager_default.log(`${import_chalk.default.bold(resourceName)} successfully connected to ${import_chalk.default.bold(project.name)}`),options.onProjectConnected?.(project.id);let envPulled=!1;if(!options.noEnvPull)try{await pull(client,["--yes"],"vercel-cli:integration:add")!==0?output_manager_default.warn(ENV_PULL_FAILED_MESSAGE):envPulled=!0}catch(err){if(!(err instanceof EnvFileSymlinkError))throw err;warnEnvFileSymlink(client,err)}return{...baseResult,project:{id:project.id,name:project.name},connected:!0,environments,envPulled}}async function getLinkedProjectField(client,noConnect,field="name"){if(noConnect)return{value:void 0};let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?{value:void 0,exitCode:linkedProject.exitCode}:linkedProject.status==="linked"?{value:linkedProject.project[field]}:{value:void 0}}export{createBlobStore,connectResourceToProject,VALID_ENVIRONMENTS,ENV_PULL_FAILED_MESSAGE,validateEnvironments,postProvisionSetup,getLinkedProjectField};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{permissionsAggregateCommand}from"./chunk-6CJFPT4F.js";import{tagsAggregateCommand}from"./chunk-ZZD5W5KT.js";import{imageAggregateCommand}from"./chunk-VHSAI6FS.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-CFJBDBYH.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},platformOption={name:"platform",shorthand:null,type:String,deprecated:!1,description:"Target platform for the build (default: linux/amd64).",argument:"PLATFORM"},pushOption={name:"push",shorthand:null,type:Boolean,deprecated:!1,description:"Push the image after building. With Docker this builds and pushes in one step (Buildx enables zstd compression); Podman and Buildah build, then push with zstd compression."},publicOption={name:"public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository public.",legacyValues:{on:"true",off:"false"}},noPublicOption={name:"no-public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository private."},listSubcommand={name:"ls",aliases:["list"],description:"List container registry repositories for a project",arguments:[],options:[projectScopeOption,limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"List repositories for a specific project as JSON",value:`${packageName} vcr ls --project my-app --json`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a repository by name",value:`${packageName} vcr inspect my-repository`}]},addSubcommand={name:"create",aliases:["add"],description:"Create a container registry repository",arguments:[{name:"name",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Create a repository",value:`${packageName} vcr create my-repository`}]},configSubcommand={name:"update",aliases:["config"],description:"Update a container registry repository, such as the repository's visibility",arguments:[{name:"repository",required:!0}],options:[publicOption,noPublicOption,projectScopeOption,formatOption,jsonOption],examples:[{name:"Make a repository public",value:`${packageName} vcr update my-repository --public`},{name:"Make a repository private",value:`${packageName} vcr update my-repository --no-public`}]},removeSubcommand={name:"delete",aliases:["rm","del","remove"],description:"Delete a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a repository",value:`${packageName} vcr delete my-repository`},{name:"Delete a repository without the confirmation prompt",value:`${packageName} vcr delete my-repository --yes`}]},loginSubcommand={name:"login",aliases:[],description:"Authenticate a container tool (docker, podman, or buildah) with the Vercel Container Registry",arguments:[{name:"engine",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Log in with Docker",value:`${packageName} vcr login docker`},{name:"Log in with Podman",value:`${packageName} vcr login podman`},{name:"Log in with Buildah",value:`${packageName} vcr login buildah`},{name:"Log in for a specific project",value:`${packageName} vcr login docker --project my-app`}]},buildSubcommand={name:"build",aliases:[],description:"Build a container image tagged for the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"path",required:!1},{name:"name",required:!1}],options:[projectScopeOption,platformOption,pushOption],examples:[{name:"Build the current directory into the linked project (repository defaults to the project name, tag to latest)",value:`${packageName} vcr build docker`},{name:"Build and push in one step (Docker Buildx enables zstd compression)",value:`${packageName} vcr build docker --push`},{name:"Build a specific context path with a repository and tag",value:`${packageName} vcr build docker ./app my-api:1.2.3`},{name:"Pass extra options through to the container tool",value:`${packageName} vcr build docker . -- --no-cache --build-arg KEY=value`}]},pushSubcommand={name:"push",aliases:[],description:"Push a container image to the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"name",required:!1}],options:[projectScopeOption],examples:[{name:"Push the linked project image (repository defaults to the project name, tag to latest)",value:`${packageName} vcr push docker`},{name:"Push a specific repository and tag",value:`${packageName} vcr push docker my-api:1.2.3`}]},vcrCommand={name:"vcr",aliases:[],description:"Manage Vercel Container Registry repositories and images (see `vcr image`).",arguments:[],subcommands:[listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,tagsAggregateCommand,imageAggregateCommand,permissionsAggregateCommand],options:[],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"Create a repository",value:`${packageName} vcr create my-app`},{name:"List images in a repository",value:`${packageName} vcr image ls my-app`}]};export{listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,vcrCommand};
7
+ import{permissionsAggregateCommand}from"./chunk-JDDPCL3K.js";import{tagsAggregateCommand}from"./chunk-23FY4PR3.js";import{imageAggregateCommand}from"./chunk-6FEMU5YF.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-DORCX7UB.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},platformOption={name:"platform",shorthand:null,type:String,deprecated:!1,description:"Target platform for the build (default: linux/amd64).",argument:"PLATFORM"},pushOption={name:"push",shorthand:null,type:Boolean,deprecated:!1,description:"Push the image after building. With Docker this builds and pushes in one step (Buildx enables zstd compression); Podman and Buildah build, then push with zstd compression."},publicOption={name:"public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository public.",legacyValues:{on:"true",off:"false"}},noPublicOption={name:"no-public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository private."},listSubcommand={name:"ls",aliases:["list"],description:"List container registry repositories for a project",arguments:[],options:[projectScopeOption,limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"List repositories for a specific project as JSON",value:`${packageName} vcr ls --project my-app --json`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a repository by name",value:`${packageName} vcr inspect my-repository`}]},addSubcommand={name:"create",aliases:["add"],description:"Create a container registry repository",arguments:[{name:"name",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Create a repository",value:`${packageName} vcr create my-repository`}]},configSubcommand={name:"update",aliases:["config"],description:"Update a container registry repository, such as the repository's visibility",arguments:[{name:"repository",required:!0}],options:[publicOption,noPublicOption,projectScopeOption,formatOption,jsonOption],examples:[{name:"Make a repository public",value:`${packageName} vcr update my-repository --public`},{name:"Make a repository private",value:`${packageName} vcr update my-repository --no-public`}]},removeSubcommand={name:"delete",aliases:["rm","del","remove"],description:"Delete a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a repository",value:`${packageName} vcr delete my-repository`},{name:"Delete a repository without the confirmation prompt",value:`${packageName} vcr delete my-repository --yes`}]},loginSubcommand={name:"login",aliases:[],description:"Authenticate a container tool (docker, podman, or buildah) with the Vercel Container Registry",arguments:[{name:"engine",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Log in with Docker",value:`${packageName} vcr login docker`},{name:"Log in with Podman",value:`${packageName} vcr login podman`},{name:"Log in with Buildah",value:`${packageName} vcr login buildah`},{name:"Log in for a specific project",value:`${packageName} vcr login docker --project my-app`}]},buildSubcommand={name:"build",aliases:[],description:"Build a container image tagged for the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"path",required:!1},{name:"name",required:!1}],options:[projectScopeOption,platformOption,pushOption],examples:[{name:"Build the current directory into the linked project (repository defaults to the project name, tag to latest)",value:`${packageName} vcr build docker`},{name:"Build and push in one step (Docker Buildx enables zstd compression)",value:`${packageName} vcr build docker --push`},{name:"Build a specific context path with a repository and tag",value:`${packageName} vcr build docker ./app my-api:1.2.3`},{name:"Pass extra options through to the container tool",value:`${packageName} vcr build docker . -- --no-cache --build-arg KEY=value`}]},pushSubcommand={name:"push",aliases:[],description:"Push a container image to the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"name",required:!1}],options:[projectScopeOption],examples:[{name:"Push the linked project image (repository defaults to the project name, tag to latest)",value:`${packageName} vcr push docker`},{name:"Push a specific repository and tag",value:`${packageName} vcr push docker my-api:1.2.3`}]},vcrCommand={name:"vcr",aliases:[],description:"Manage Vercel Container Registry repositories and images (see `vcr image`).",arguments:[],subcommands:[listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,tagsAggregateCommand,imageAggregateCommand,permissionsAggregateCommand],options:[],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"Create a repository",value:`${packageName} vcr create my-app`},{name:"List images in a repository",value:`${packageName} vcr image ls my-app`}]};export{listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,vcrCommand};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{__commonJS}from"./chunk-BZENIQ7N.js";var require_balanced_match=__commonJS({"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports,module){"use strict";module.exports=balanced;function balanced(a,b,str){a instanceof RegExp&&(a=maybeMatch(a,str)),b instanceof RegExp&&(b=maybeMatch(b,str));var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result,ai=str.indexOf(a),bi=str.indexOf(b,ai+1),i=ai;if(ai>=0&&bi>0){if(a===b)return[ai,bi];for(begs=[],left=str.length;i>=0&&!result;)i==ai?(begs.push(i),ai=str.indexOf(a,i+1)):begs.length==1?result=[begs.pop(),bi]:(beg=begs.pop(),beg<left&&(left=beg,right=bi),bi=str.indexOf(b,i+1)),i=ai<bi&&ai>=0?ai:bi;begs.length&&(result=[left,right])}return result}}});export{require_balanced_match};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{ROOT_HELP_GROUPS}from"./chunk-BDXK4TCN.js";import{buildCommandExampleLines,buildCommandOptionLines,createHelpTheme,helpColumns,helpLiterals,helpRows,helpSection,helpUsage}from"./chunk-5KSBRQI2.js";import{globalCommandOptions}from"./chunk-CFJBDBYH.js";var ROOT_HELP_EXAMPLES=[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a linked project without prompts",value:"vercel deploy --yes --non-interactive"},{name:"Show help for a command",value:"vercel domains --help"},{name:"Find the command for a task and show its help page",value:'vercel help search "add a domain" --with-help'}];function help(commands,columns=80,theme=createHelpTheme()){columns=helpColumns(columns);let sections=Object.keys(ROOT_HELP_GROUPS).flatMap(group=>{let rows=commands.filter(command=>command.group===group);return rows.length?[helpSection(group,helpRows(rows.map(command=>({syntax:helpLiterals(command.names),description:`${command.description}${command.default?" (default)":""}`})),columns,theme),theme)]:[]});return[`${helpUsage(theme)} ${theme.reference("vercel")} [options] [command | path]`,...sections,buildCommandOptionLines([...globalCommandOptions,{name:"changelog",shorthand:null,type:Boolean,deprecated:!1,description:"Show the 5 latest Vercel product updates"}],{columns,theme},"Global Options"),buildCommandExampleLines({examples:ROOT_HELP_EXAMPLES},columns,theme)].filter(Boolean).join(`
7
+ import{ROOT_HELP_GROUPS}from"./chunk-RHFNVIFD.js";import{buildCommandExampleLines,buildCommandOptionLines,createHelpTheme,helpColumns,helpLiterals,helpRows,helpSection,helpUsage}from"./chunk-5727HGA6.js";import{globalCommandOptions}from"./chunk-DORCX7UB.js";var ROOT_HELP_EXAMPLES=[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a linked project without prompts",value:"vercel deploy --yes --non-interactive"},{name:"Show help for a command",value:"vercel domains --help"},{name:"Find the command for a task and show its help page",value:'vercel help search "add a domain" --with-help'}];function help(commands,columns=80,theme=createHelpTheme()){columns=helpColumns(columns);let sections=Object.keys(ROOT_HELP_GROUPS).flatMap(group=>{let rows=commands.filter(command=>command.group===group);return rows.length?[helpSection(group,helpRows(rows.map(command=>({syntax:helpLiterals(command.names),description:`${command.description}${command.default?" (default)":""}`})),columns,theme),theme)]:[]});return[`${helpUsage(theme)} ${theme.reference("vercel")} [options] [command | path]`,...sections,buildCommandOptionLines([...globalCommandOptions,{name:"changelog",shorthand:null,type:Boolean,deprecated:!1,description:"Show the 5 latest Vercel product updates"}],{columns,theme},"Global Options"),buildCommandExampleLines({examples:ROOT_HELP_EXAMPLES},columns,theme)].filter(Boolean).join(`
8
8
 
9
9
  `)+`
10
10
  `}export{ROOT_HELP_EXAMPLES,help};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{confirmOption,deploymentOption,environmentOption,forceOption,formatOption,jsonOption,projectOption,targetOption,yesOption}from"./chunk-CFJBDBYH.js";var deprecatedArchiveSplitTgz="split-tgz",initSubcommand={name:"init",aliases:[],description:"Create a manual deployment that can be continued later",hidden:!0,arguments:[],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,projectOption],examples:[{name:"Create a manual deployment",value:"vercel deploy init"},{name:"Create a manual production deployment",value:"vercel deploy init --prod"}]},continueSubcommand={name:"continue",aliases:[],description:"Continue a manual deployment by uploading build outputs",hidden:!0,arguments:[],options:[{...deploymentOption,description:"The deployment ID to continue (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"error",shorthand:null,type:String,argument:"MESSAGE",deprecated:!1,description:"Mark the deployment as errored with a message"}],examples:[{name:"Continue a deployment by ID",value:"vercel deploy continue --deployment dpl_xxx"}]},describeSubcommand={name:"describe",aliases:[],description:"Prepare deployment functions for provisioning in your AWS account",hidden:!0,arguments:[],options:[{...deploymentOption,description:"Deployment ID used with vercel build --deployment (required)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"aws-account-id",shorthand:null,type:String,argument:"AWS_ACCOUNT",deprecated:!1,description:"12-digit AWS account ID for provisioning (required)"},jsonOption],examples:[{name:"Prepare a deployment for provisioning",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012"},{name:"Return artifact paths as JSON",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012 --json"}],helpSections:[{title:"Notes",body:["Uses the team in .vercel/project.json. Run vercel build --deployment first.","Writes descriptor.json, function ZIPs, and runtime layers to .vercel/<DEPLOYMENT>/. Keep these artifacts private.","Preserves the original build in .vercel/<DEPLOYMENT>/build/ and replaces .vercel/output with a code-free continuation.","Does not create AWS resources. Provision the described functions before running vercel deploy continue --deployment <DEPLOYMENT>.","Edge Functions and service outputs are not supported."]}]},deployCommand={name:"deploy",aliases:[],description:"Deploy your project to Vercel. Use `--temporary` to create a temporary deployment without logging in. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`). Use `--dry` to inspect the detected framework preset and source files without deploying.",arguments:[{name:"project-path",required:!1}],subcommands:[initSubcommand,continueSubcommand,describeSubcommand],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"turbo",shorthand:null,type:Boolean,deprecated:!1,description:"Use a Turbo build machine for this deployment"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prebuilt",shorthand:null,type:Boolean,deprecated:!1,description:"Use in combination with `vc build`. Deploy an existing build"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"temporary",shorthand:null,type:Boolean,deprecated:!1,description:"Create a temporary deployment without logging in. When logged in, use `--delete-project-after` instead"},{name:"delete-project-after",shorthand:null,type:String,argument:"DURATION",deprecated:!1,description:"Create a temporary project that is deleted automatically after 1h, 1d, 1w, 2w, or 30d. Only applies when the deploy creates the project"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"no-wait",shorthand:null,type:Boolean,deprecated:!1,description:"Don't wait for the deployment to finish"},{name:"verify",shorthand:null,type:Boolean,deprecated:!1,description:"Load the deployment URL once it is ready and report the status code, size, and page title, even with Deployment Protection on (creates the project's Protection Bypass for Automation secret if missing). Exits 1 if the load fails. Can't be used with --no-wait or --dry"},{name:"dry",shorthand:null,type:Boolean,deprecated:!1,description:"Inspect the detected framework preset and source files without uploading or creating a deployment. Non-TTY output includes every file as JSON"},{name:"create-if-missing",shorthand:null,type:Boolean,deprecated:!1,description:"Create the --project if it doesn't exist yet. Needed only when --project names a new project with --yes or in non-interactive mode. Can't be used with --dry"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{name:"logs",shorthand:null,deprecatedShorthand:"l",type:Boolean,deprecated:!1,description:"Print the build logs"},{name:"guidance",shorthand:null,type:Boolean,deprecated:!1,description:"Receive command suggestions once deployment is complete"},{name:"no-logs",shorthand:null,type:Boolean,deprecated:!0,description:"Do not print the build logs"},{name:"name",shorthand:"n",type:String,deprecated:!0},{name:"no-clipboard",shorthand:null,type:Boolean,deprecated:!0},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,{...projectOption,description:"Project name or ID to deploy to, without linking this directory (default: linked project). A missing name is created; with --yes or in non-interactive mode, add --create-if-missing"}],examples:[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a single HTML file",value:"vercel ./index.html"},{name:"Deploy a custom path",value:"vercel /usr/src/project"},{name:"Deploy to production and check that the URL loads",value:"vercel deploy --prod --verify"},{name:"Deploy with run-time Environment Variables",value:"vercel --env NODE_ENV=production"},{name:"Deploy with prebuilt outputs",value:["vercel build","vercel deploy --prebuilt"]},{name:"Deploy using a Turbo build machine",value:"vercel deploy --turbo"},{name:"Inspect deployment inputs without deploying",value:"vercel deploy --dry"},{name:"Get every deployment file as JSON",value:"vercel deploy --dry --json"},{name:"Write Deployment URL to a file",value:"vercel > deployment-url.txt"}]};export{deprecatedArchiveSplitTgz,initSubcommand,continueSubcommand,describeSubcommand,deployCommand};
7
+ import{confirmOption,deploymentOption,environmentOption,forceOption,formatOption,jsonOption,projectOption,targetOption,yesOption}from"./chunk-DORCX7UB.js";var deprecatedArchiveSplitTgz="split-tgz",initSubcommand={name:"init",aliases:[],description:"Create a manual deployment that can be continued later",hidden:!0,arguments:[],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,projectOption],examples:[{name:"Create a manual deployment",value:"vercel deploy init"},{name:"Create a manual production deployment",value:"vercel deploy init --prod"}]},continueSubcommand={name:"continue",aliases:[],description:"Continue a manual deployment by uploading build outputs",hidden:!0,arguments:[],options:[{...deploymentOption,description:"The deployment ID to continue (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"error",shorthand:null,type:String,argument:"MESSAGE",deprecated:!1,description:"Mark the deployment as errored with a message"}],examples:[{name:"Continue a deployment by ID",value:"vercel deploy continue --deployment dpl_xxx"}]},describeSubcommand={name:"describe",aliases:[],description:"Prepare deployment functions for provisioning in your AWS account",hidden:!0,arguments:[],options:[{...deploymentOption,description:"Deployment ID used with vercel build --deployment (required)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"aws-account-id",shorthand:null,type:String,argument:"AWS_ACCOUNT",deprecated:!1,description:"12-digit AWS account ID for provisioning (required)"},jsonOption],examples:[{name:"Prepare a deployment for provisioning",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012"},{name:"Return artifact paths as JSON",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012 --json"}],helpSections:[{title:"Notes",body:["Uses the team in .vercel/project.json. Run vercel build --deployment first.","Writes descriptor.json, function ZIPs, and runtime layers to .vercel/<DEPLOYMENT>/. Keep these artifacts private.","Preserves the original build in .vercel/<DEPLOYMENT>/build/ and replaces .vercel/output with a code-free continuation.","Does not create AWS resources. Provision the described functions before running vercel deploy continue --deployment <DEPLOYMENT>.","Edge Functions and service outputs are not supported."]}]},deployCommand={name:"deploy",aliases:[],description:"Deploy your project to Vercel. Use `--temporary` to create a temporary deployment without logging in. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`). Use `--dry` to inspect the detected framework preset and source files without deploying.",arguments:[{name:"project-path",required:!1}],subcommands:[initSubcommand,continueSubcommand,describeSubcommand],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"turbo",shorthand:null,type:Boolean,deprecated:!1,description:"Use a Turbo build machine for this deployment"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prebuilt",shorthand:null,type:Boolean,deprecated:!1,description:"Use in combination with `vc build`. Deploy an existing build"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"temporary",shorthand:null,type:Boolean,deprecated:!1,description:"Create a temporary deployment without logging in. When logged in, use `--delete-project-after` instead"},{name:"delete-project-after",shorthand:null,type:String,argument:"DURATION",deprecated:!1,description:"Create a temporary project that is deleted automatically after 1h, 1d, 1w, 2w, or 30d. Only applies when the deploy creates the project"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"no-wait",shorthand:null,type:Boolean,deprecated:!1,description:"Don't wait for the deployment to finish"},{name:"verify",shorthand:null,type:Boolean,deprecated:!1,description:"Load the deployment URL once it is ready and report the status code, size, and page title, even with Deployment Protection on (creates the project's Protection Bypass for Automation secret if missing). Exits 1 if the load fails. Can't be used with --no-wait or --dry"},{name:"dry",shorthand:null,type:Boolean,deprecated:!1,description:"Inspect the detected framework preset and source files without uploading or creating a deployment. Non-TTY output includes every file as JSON"},{name:"create-if-missing",shorthand:null,type:Boolean,deprecated:!1,description:"Create the --project if it doesn't exist yet. Needed only when --project names a new project with --yes or in non-interactive mode. Can't be used with --dry"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{name:"logs",shorthand:null,deprecatedShorthand:"l",type:Boolean,deprecated:!1,description:"Print the build logs"},{name:"guidance",shorthand:null,type:Boolean,deprecated:!1,description:"Receive command suggestions once deployment is complete"},{name:"no-logs",shorthand:null,type:Boolean,deprecated:!0,description:"Do not print the build logs"},{name:"name",shorthand:"n",type:String,deprecated:!0},{name:"no-clipboard",shorthand:null,type:Boolean,deprecated:!0},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,{...projectOption,description:"Project name or ID to deploy to, without linking this directory (default: linked project). A missing name is created; with --yes or in non-interactive mode, add --create-if-missing"}],examples:[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a single HTML file",value:"vercel ./index.html"},{name:"Deploy a custom path",value:"vercel /usr/src/project"},{name:"Deploy to production and check that the URL loads",value:"vercel deploy --prod --verify"},{name:"Deploy with run-time Environment Variables",value:"vercel --env NODE_ENV=production"},{name:"Deploy with prebuilt outputs",value:["vercel build","vercel deploy --prebuilt"]},{name:"Deploy using a Turbo build machine",value:"vercel deploy --turbo"},{name:"Inspect deployment inputs without deploying",value:"vercel deploy --dry"},{name:"Get every deployment file as JSON",value:"vercel deploy --dry --json"},{name:"Write Deployment URL to a file",value:"vercel > deployment-url.txt"}]};export{deprecatedArchiveSplitTgz,initSubcommand,continueSubcommand,describeSubcommand,deployCommand};
@@ -4,9 +4,9 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR}from"./chunk-Z2KANBOU.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
7
+ import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,localConfigFlagPath}from"./chunk-NJFXR3FN.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
8
8
  `).forEach(function(line){var keyValueArr=line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);if(keyValueArr!=null){var key=keyValueArr[1],value=keyValueArr[2]?keyValueArr[2]:"",len=value?value.length:0;len>0&&value.charAt(0)==='"'&&value.charAt(len-1)==='"'&&(value=value.replace(/\\n/gm,`
9
- `)),value=value.replace(/(^['"]|['"]$)/g,"").trim(),obj[key]=value}}),obj}function config(options){var path=".env",encoding="utf8";options&&(options.path&&(path=options.path),options.encoding&&(encoding=options.encoding));try{var parsedObj=parse(fs.readFileSync(path,{encoding}));return Object.keys(parsedObj).forEach(function(key){process.env[key]=process.env[key]||parsedObj[key]}),{parsed:parsedObj}}catch(e){return{error:e}}}module.exports.config=config;module.exports.load=config;module.exports.parse=parse}});var import_dotenv=__toESM(require_main(),1);import{mkdir,readFile,writeFile,unlink,access}from"fs/promises";import{join,basename}from"path";import{fork}from"child_process";async function loadEsbuild(){let nativeLoader=Reflect.get(globalThis,Symbol.for("vercel.cli.loadEsbuild"));return typeof nativeLoader=="function"?nativeLoader():import("esbuild")}var import_build_utils=__toESM(require_build_utils(),1);function toRouteFormat(item){if("src"in item)return item;let{source,destination,headers,statusCode,permanent,...rest}=item,route={src:source,...rest};return destination&&(route.dest=destination),headers&&(route.headers=Object.fromEntries(headers.map(h=>[h.key,h.value]))),statusCode!==void 0?route.status=statusCode:permanent!==void 0&&(route.status=permanent?308:307),route}function normalizeConfig(config){let normalized={...config},{rewrites,redirects,headers}=normalized,allRoutes=normalized.routes||[],hasRoutes=allRoutes.length>0,hasRewrites=(rewrites?.length??0)>0,hasRedirects=(redirects?.length??0)>0,hasHeaders=(headers?.length??0)>0;function hasRouteFormat(items){return items?.some(item=>"src"in item)??!1}if(hasRoutes&&(hasRewrites||hasRedirects||hasHeaders))return normalized;let shouldConvertRewrites=hasRewrites&&hasRouteFormat(rewrites),shouldConvertRedirects=hasRedirects&&hasRouteFormat(redirects),shouldConvertHeaders=hasHeaders&&hasRouteFormat(headers);if((shouldConvertRewrites||shouldConvertRedirects||shouldConvertHeaders)&&(hasRewrites&&!shouldConvertRewrites||hasRedirects&&!shouldConvertRedirects||hasHeaders&&!shouldConvertHeaders))throw new import_build_utils.NowBuildError({code:"INVALID_VERCEL_CONFIG",message:"Transforms (e.g., requestHeaders) require the `routes` format, which cannot be used alongside `rewrites`, `redirects`, or `headers`. Move everything into the `routes` array instead.",link:"https://vercel.com/docs/projects/project-configuration#routes"});return rewrites&&shouldConvertRewrites&&(allRoutes=[...allRoutes,...rewrites.map(toRouteFormat)],delete normalized.rewrites),redirects&&shouldConvertRedirects&&(allRoutes=[...allRoutes,...redirects.map(toRouteFormat)],delete normalized.redirects),headers&&shouldConvertHeaders&&(allRoutes=[...allRoutes,...headers.map(toRouteFormat)],delete normalized.headers),allRoutes.length>0&&(normalized.routes=allRoutes.map(toRouteFormat)),normalized}async function fileExists(filePath){try{return await access(filePath),!0}catch{return!1}}async function findAllVercelConfigFiles(workPath){let foundFiles=[];for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);await fileExists(configPath)&&foundFiles.push(configPath)}return foundFiles}async function findSourceVercelConfigFile(workPath){for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);if(await fileExists(configPath))return basename(configPath)}let tomlPath=join(workPath,"vercel.toml");return await fileExists(tomlPath)?"vercel.toml":null}async function findVercelConfigFile(workPath){let foundFiles=await findAllVercelConfigFiles(workPath);if(foundFiles.length>1)throw new ConflictingConfigFiles(foundFiles,"Multiple vercel config files found. Please use only one configuration file.","https://vercel.com/docs/projects/project-configuration");return foundFiles[0]||null}function parseConfigLoaderError(stderr){if(!stderr.trim())return"";let moduleNotFoundMatch=stderr.match(/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/);if(moduleNotFoundMatch)return`Cannot find package '${moduleNotFoundMatch[1]}'. Make sure it's installed in your project dependencies.`;let syntaxErrorMatch=stderr.match(/SyntaxError: (.+?)(?:\n|$)/);if(syntaxErrorMatch)return`Syntax error: ${syntaxErrorMatch[1]}`;let errorMatch=stderr.match(/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m);return errorMatch?errorMatch[1]:stderr.trim()}async function compileVercelConfig(workPath){let vercelJsonPath=join(workPath,"vercel.json"),nowJsonPath=join(workPath,"now.json"),vercelTomlPath=join(workPath,"vercel.toml"),hasVercelJson=await fileExists(vercelJsonPath),hasNowJson=await fileExists(nowJsonPath),hasVercelToml=await fileExists(vercelTomlPath),vercelConfigPath=await findVercelConfigFile(workPath),vercelDir=join(workPath,VERCEL_DIR),compiledConfigPath=join(vercelDir,"vercel.json");if(hasNowJson)throw new DeprecatedNowJson(nowJsonPath);let foundConfigs=[];if(hasVercelJson&&foundConfigs.push(vercelJsonPath),hasVercelToml&&foundConfigs.push(vercelTomlPath),vercelConfigPath&&foundConfigs.push(vercelConfigPath),foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs,`Multiple config files found: ${foundConfigs.map(f=>basename(f)).join(", ")}. Please use only one configuration method.`,"https://vercel.com/docs/projects/project-configuration");if(!vercelConfigPath&&!hasVercelToml)return hasVercelJson?{configPath:vercelJsonPath,wasCompiled:!1}:await fileExists(compiledConfigPath)?{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:await findSourceVercelConfigFile(workPath)??void 0}:{configPath:null,wasCompiled:!1};if(hasVercelToml)try{let{parse:tomlParse}=await import("./dist-RXYNZPEA.js"),tomlContent=await readFile(vercelTomlPath,"utf8"),config=tomlParse(tomlContent),normalizedConfig=normalizeConfig(config);return await mkdir(vercelDir,{recursive:!0}),await writeFile(compiledConfigPath,JSON.stringify(normalizedConfig,null,2),"utf-8"),output_manager_default.debug(`Compiled ${vercelTomlPath} -> ${compiledConfigPath}`),{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:"vercel.toml"}}catch(error){throw new import_build_utils.NowBuildError({code:error.code??"vercel_toml_parse_failed",message:`Failed to parse vercel.toml: ${error.message}`,link:error.link??"https://vercel.com/docs/projects/project-configuration"})}let sourceConfigPath=vercelConfigPath;(0,import_dotenv.config)({path:join(workPath,".env")}),(0,import_dotenv.config)({path:join(workPath,".env.local")});let tempOutPath=join(vercelDir,"vercel-temp.mjs"),loaderPath=join(vercelDir,"vercel-loader.mjs");try{let{build}=await loadEsbuild();await mkdir(vercelDir,{recursive:!0}),await build({entryPoints:[sourceConfigPath],bundle:!0,platform:"node",format:"esm",outfile:tempOutPath,packages:"external",target:"node20",sourcemap:"inline"}),await writeFile(loaderPath,`
9
+ `)),value=value.replace(/(^['"]|['"]$)/g,"").trim(),obj[key]=value}}),obj}function config(options){var path=".env",encoding="utf8";options&&(options.path&&(path=options.path),options.encoding&&(encoding=options.encoding));try{var parsedObj=parse(fs.readFileSync(path,{encoding}));return Object.keys(parsedObj).forEach(function(key){process.env[key]=process.env[key]||parsedObj[key]}),{parsed:parsedObj}}catch(e){return{error:e}}}module.exports.config=config;module.exports.load=config;module.exports.parse=parse}});var import_dotenv=__toESM(require_main(),1);import{mkdir,readFile,writeFile,unlink,access}from"fs/promises";import{join,basename}from"path";import{fork}from"child_process";async function loadEsbuild(){let nativeLoader=Reflect.get(globalThis,Symbol.for("vercel.cli.loadEsbuild"));return typeof nativeLoader=="function"?nativeLoader():import("esbuild")}var import_build_utils=__toESM(require_build_utils(),1);function toRouteFormat(item){if("src"in item)return item;let{source,destination,headers,statusCode,permanent,...rest}=item,route={src:source,...rest};return destination&&(route.dest=destination),headers&&(route.headers=Object.fromEntries(headers.map(h=>[h.key,h.value]))),statusCode!==void 0?route.status=statusCode:permanent!==void 0&&(route.status=permanent?308:307),route}function normalizeConfig(config){let normalized={...config},{rewrites,redirects,headers}=normalized,allRoutes=normalized.routes||[],hasRoutes=allRoutes.length>0,hasRewrites=(rewrites?.length??0)>0,hasRedirects=(redirects?.length??0)>0,hasHeaders=(headers?.length??0)>0;function hasRouteFormat(items){return items?.some(item=>"src"in item)??!1}if(hasRoutes&&(hasRewrites||hasRedirects||hasHeaders))return normalized;let shouldConvertRewrites=hasRewrites&&hasRouteFormat(rewrites),shouldConvertRedirects=hasRedirects&&hasRouteFormat(redirects),shouldConvertHeaders=hasHeaders&&hasRouteFormat(headers);if((shouldConvertRewrites||shouldConvertRedirects||shouldConvertHeaders)&&(hasRewrites&&!shouldConvertRewrites||hasRedirects&&!shouldConvertRedirects||hasHeaders&&!shouldConvertHeaders))throw new import_build_utils.NowBuildError({code:"INVALID_VERCEL_CONFIG",message:"Transforms (e.g., requestHeaders) require the `routes` format, which cannot be used alongside `rewrites`, `redirects`, or `headers`. Move everything into the `routes` array instead.",link:"https://vercel.com/docs/projects/project-configuration#routes"});return rewrites&&shouldConvertRewrites&&(allRoutes=[...allRoutes,...rewrites.map(toRouteFormat)],delete normalized.rewrites),redirects&&shouldConvertRedirects&&(allRoutes=[...allRoutes,...redirects.map(toRouteFormat)],delete normalized.redirects),headers&&shouldConvertHeaders&&(allRoutes=[...allRoutes,...headers.map(toRouteFormat)],delete normalized.headers),allRoutes.length>0&&(normalized.routes=allRoutes.map(toRouteFormat)),normalized}async function fileExists(filePath){try{return await access(filePath),!0}catch{return!1}}async function findAllVercelConfigFiles(workPath){let foundFiles=[];for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);await fileExists(configPath)&&foundFiles.push(configPath)}return foundFiles}async function findSourceVercelConfigFile(workPath){for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);if(await fileExists(configPath))return basename(configPath)}let tomlPath=join(workPath,"vercel.toml");return await fileExists(tomlPath)?"vercel.toml":null}async function findVercelConfigFile(workPath){let foundFiles=await findAllVercelConfigFiles(workPath);if(foundFiles.length>1)throw new ConflictingConfigFiles(foundFiles,"Multiple vercel config files found. Please use only one configuration file.","https://vercel.com/docs/projects/project-configuration");return foundFiles[0]||null}function parseConfigLoaderError(stderr){if(!stderr.trim())return"";let moduleNotFoundMatch=stderr.match(/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/);if(moduleNotFoundMatch)return`Cannot find package '${moduleNotFoundMatch[1]}'. Make sure it's installed in your project dependencies.`;let syntaxErrorMatch=stderr.match(/SyntaxError: (.+?)(?:\n|$)/);if(syntaxErrorMatch)return`Syntax error: ${syntaxErrorMatch[1]}`;let errorMatch=stderr.match(/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m);return errorMatch?errorMatch[1]:stderr.trim()}async function compileVercelConfig(workPath){let explicitConfigPath=localConfigFlagPath();if(explicitConfigPath)return{configPath:explicitConfigPath,wasCompiled:!1};let vercelJsonPath=join(workPath,"vercel.json"),nowJsonPath=join(workPath,"now.json"),vercelTomlPath=join(workPath,"vercel.toml"),hasVercelJson=await fileExists(vercelJsonPath),hasNowJson=await fileExists(nowJsonPath),hasVercelToml=await fileExists(vercelTomlPath),vercelConfigPath=await findVercelConfigFile(workPath),vercelDir=join(workPath,VERCEL_DIR),compiledConfigPath=join(vercelDir,"vercel.json");if(hasNowJson)throw new DeprecatedNowJson(nowJsonPath);let foundConfigs=[];if(hasVercelJson&&foundConfigs.push(vercelJsonPath),hasVercelToml&&foundConfigs.push(vercelTomlPath),vercelConfigPath&&foundConfigs.push(vercelConfigPath),foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs,`Multiple config files found: ${foundConfigs.map(f=>basename(f)).join(", ")}. Please use only one configuration method.`,"https://vercel.com/docs/projects/project-configuration");if(!vercelConfigPath&&!hasVercelToml)return hasVercelJson?{configPath:vercelJsonPath,wasCompiled:!1}:await fileExists(compiledConfigPath)?{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:await findSourceVercelConfigFile(workPath)??void 0}:{configPath:null,wasCompiled:!1};if(hasVercelToml)try{let{parse:tomlParse}=await import("./dist-RXYNZPEA.js"),tomlContent=await readFile(vercelTomlPath,"utf8"),config=tomlParse(tomlContent),normalizedConfig=normalizeConfig(config);return await mkdir(vercelDir,{recursive:!0}),await writeFile(compiledConfigPath,JSON.stringify(normalizedConfig,null,2),"utf-8"),output_manager_default.debug(`Compiled ${vercelTomlPath} -> ${compiledConfigPath}`),{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:"vercel.toml"}}catch(error){throw new import_build_utils.NowBuildError({code:error.code??"vercel_toml_parse_failed",message:`Failed to parse vercel.toml: ${error.message}`,link:error.link??"https://vercel.com/docs/projects/project-configuration"})}let sourceConfigPath=vercelConfigPath;(0,import_dotenv.config)({path:join(workPath,".env")}),(0,import_dotenv.config)({path:join(workPath,".env.local")});let tempOutPath=join(vercelDir,"vercel-temp.mjs"),loaderPath=join(vercelDir,"vercel-loader.mjs");try{let{build}=await loadEsbuild();await mkdir(vercelDir,{recursive:!0}),await build({entryPoints:[sourceConfigPath],bundle:!0,platform:"node",format:"esm",outfile:tempOutPath,packages:"external",target:"node20",sourcemap:"inline"}),await writeFile(loaderPath,`
10
10
  import { pathToFileURL } from 'url';
11
11
  const configModule = await import(pathToFileURL(process.argv[2]).href);
12
12
  const config = ('default' in configModule) ? configModule.default : ('config' in configModule) ? configModule.config : configModule;
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-PFOOPXTN.js";var positionSchema=external_exports.object({cursor:external_exports.string().min(1).optional(),offset:external_exports.number().int().min(0)});function encodeListCursor(position){return Buffer.from(JSON.stringify(position)).toString("base64url")}function decodeListCursor(value){try{let decoded=JSON.parse(Buffer.from(value,"base64url").toString()),parsed=positionSchema.safeParse(decoded);return parsed.success?parsed.data:void 0}catch{return}}function sliceList(items,start,limit){if(start.cursor!==void 0)return;let end=start.offset+limit;return{items:items.slice(start.offset,end),next:end<items.length?encodeListCursor({offset:end}):null}}async function collectList(fetchPage,start,limit,{maxPages=100}={}){let items=[],seen=new Set,position=start;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(position.cursor),remaining=page.items.slice(position.offset),taken=remaining.slice(0,limit-items.length);if(items.push(...taken),taken.length<remaining.length){let offset=position.offset+taken.length;return{items,next:encodeListCursor({cursor:position.cursor,offset})}}if(!page.cursor)return{items,next:null};if(seen.has(page.cursor))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");if(seen.add(page.cursor),position={cursor:page.cursor,offset:0},items.length===limit)return{items,next:encodeListCursor(position)}}return{items,next:encodeListCursor(position)}}export{decodeListCursor,sliceList,collectList};
7
+ import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-7RABG6HV.js";var positionSchema=external_exports.object({cursor:external_exports.string().min(1).optional(),offset:external_exports.number().int().min(0)});function encodeListCursor(position){return Buffer.from(JSON.stringify(position)).toString("base64url")}function decodeListCursor(value){try{let decoded=JSON.parse(Buffer.from(value,"base64url").toString()),parsed=positionSchema.safeParse(decoded);return parsed.success?parsed.data:void 0}catch{return}}function sliceList(items,start,limit){if(start.cursor!==void 0)return;let end=start.offset+limit;return{items:items.slice(start.offset,end),next:end<items.length?encodeListCursor({offset:end}):null}}async function collectList(fetchPage,start,limit,{maxPages=100}={}){let items=[],seen=new Set,position=start;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(position.cursor),remaining=page.items.slice(position.offset),taken=remaining.slice(0,limit-items.length);if(items.push(...taken),taken.length<remaining.length){let offset=position.offset+taken.length;return{items,next:encodeListCursor({cursor:position.cursor,offset})}}if(!page.cursor)return{items,next:null};if(seen.has(page.cursor))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");if(seen.add(page.cursor),position={cursor:page.cursor,offset:0},items.length===limit)return{items,next:encodeListCursor(position)}}return{items,next:encodeListCursor(position)}}export{decodeListCursor,sliceList,collectList};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_cjs}from"./chunk-L5PIUIUM.js";import{CONTACT_FIELDS,billingFieldsUsed,collectContactInformation,getBillingContact,getDomainPrice,getDomainStatus,isPurchasedSince,mergeContact,missingContactFields,purchaseDomain,readContactFlags}from"./chunk-BCAI7MED.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{amountMatchesPrice,canPromptForCharge,chargeFailureReason,chargeFlagWithValue,formatAmountArg,formatTerm,orderStatusStep,parseAmount,parseOrderWait,printChargeRecovery,refuseUnnamedTeam,reportChargeFailure,reportOrderPending,reportPriceChanged,reportUnknownOutcome,reportUsageError,writeChargeAction}from"./chunk-SYVWRGFQ.js";import{formatUsd}from"./chunk-F4UEGELU.js";import{buySubcommand}from"./chunk-XR2J7PQN.js";import{printError}from"./chunk-33HVDSWP.js";import{param}from"./chunk-3G3FQYMW.js";import{getScope}from"./chunk-NLK7NGVP.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-4SS6W6JK.js";import{validateJsonOutput}from"./chunk-FEJD7MRH.js";import{DomainChargeOutcomeUnknown,DomainPaymentAuthenticationRequired,DomainPriceChanged,DomainPurchaseInProgress,isAPIError}from"./chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{getFlagsSpecification,getGlobalFlagsFromArgs,quoteArg}from"./chunk-CFJBDBYH.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),import_tldts=__toESM(require_cjs(),1),import_error_utils=__toESM(require_dist(),1);var DomainsBuyTelemetryClient=class extends TelemetryClient{trackCliArgumentDomain(v){v&&this.trackCliArgument({arg:"domain",value:this.redactedValue})}trackCliOptionAmount(v){this.trackRedactedCliOption("amount",v)}trackCliFlagUseBillingDetails(v){v&&this.trackCliFlag("use-billing-details")}trackCliOptionFirstName(v){this.trackRedactedCliOption("first-name",v)}trackCliOptionLastName(v){this.trackRedactedCliOption("last-name",v)}trackCliOptionEmail(v){this.trackRedactedCliOption("email",v)}trackCliOptionPhone(v){this.trackRedactedCliOption("phone",v)}trackCliOptionAddress(v){this.trackRedactedCliOption("address",v)}trackCliOptionCity(v){this.trackRedactedCliOption("city",v)}trackCliOptionState(v){this.trackRedactedCliOption("state",v)}trackCliOptionZip(v){this.trackRedactedCliOption("zip",v)}trackCliOptionCountry(v){this.trackRedactedCliOption("country",v)}trackCliOptionCompany(v){this.trackRedactedCliOption("company",v)}trackCliFlagAutoRenew(v){v&&this.trackCliFlag("auto-renew")}trackCliFlagNoAutoRenew(v){v&&this.trackCliFlag("no-auto-renew")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionTimeout(timeout){timeout&&this.trackCliOption({option:"timeout",value:"[TIME]"})}trackCliFlagNoWait(noWait){noWait&&this.trackCliFlag("no-wait")}};function buildBuyCommand(client,domain,opts){let parts=[`domains buy ${domain}`];opts.team&&parts.push(`--scope ${opts.team}`),opts.amount!==void 0&&parts.push(`--amount ${formatAmountArg(opts.amount)}`),opts.useBilling&&parts.push("--use-billing-details");for(let{field,flag}of CONTACT_FIELDS){let value=opts.contact[field];value!==void 0?parts.push(`${flag} ${quoteArg(value)}`):opts.missing.includes(field)&&parts.push(`${flag} <${flag.slice(2)}>`)}return opts.autoRenew===!0&&parts.push("--auto-renew"),opts.autoRenew===!1&&parts.push("--no-auto-renew"),opts.wait?.noWait?parts.push("--no-wait"):opts.wait?.timeout&&parts.push(`--timeout ${quoteArg(opts.wait.timeout)}`),opts.json&&parts.push("--json"),buildCommandWithGlobalFlags(client.argv,parts.join(" "))}function flagFor(field){return CONTACT_FIELDS.find(f=>f.field===field).flag}function usageError(client,message){return reportUsageError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}async function buy(client,argv){let telemetry=new DomainsBuyTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(buySubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error instanceof Error?error.message:String(error)},2),printError(error),2}let{args,flags}=parsedArgs,[domainName]=args;if(telemetry.trackCliArgumentDomain(domainName),telemetry.trackCliOptionAmount(flags["--amount"]),telemetry.trackCliFlagUseBillingDetails(flags["--use-billing-details"]),telemetry.trackCliOptionFirstName(flags["--first-name"]),telemetry.trackCliOptionLastName(flags["--last-name"]),telemetry.trackCliOptionEmail(flags["--email"]),telemetry.trackCliOptionPhone(flags["--phone"]),telemetry.trackCliOptionAddress(flags["--address"]),telemetry.trackCliOptionCity(flags["--city"]),telemetry.trackCliOptionState(flags["--state"]),telemetry.trackCliOptionZip(flags["--zip"]),telemetry.trackCliOptionCountry(flags["--country"]),telemetry.trackCliOptionCompany(flags["--company"]),telemetry.trackCliFlagAutoRenew(flags["--auto-renew"]),telemetry.trackCliFlagNoAutoRenew(flags["--no-auto-renew"]),telemetry.trackCliOptionTimeout(flags["--timeout"]),telemetry.trackCliFlagNoWait(flags["--no-wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),!domainName){if(client.nonInteractive){let globalFlags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`domains buy <domain> ${globalFlags.join(" ")}`.trim());outputAgentError(client,{status:"error",reason:"missing_arguments",message:`Missing domain name. Run: ${cmd}`,next:[{command:cmd,when:"Replace <domain> with the domain to buy"}]},2)}return output_manager_default.error(`Missing domain name. Run ${getCommandName("domains --help")}`),2}if(args.length>1){let extra=args[1].toLowerCase();return usageError(client,extra==="true"||extra==="false"?"Unexpected extra argument. On/off options like --auto-renew don't take a value: pass --auto-renew or --no-auto-renew.":'Unexpected extra argument. domains buy takes one domain; quote option values that contain spaces, like --address "1 Main St".')}let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return usageError(client,formatResult.error);let asJson=formatResult.jsonOutput,{domain:rootDomain,subdomain}=(0,import_tldts.parse)(domainName);if(subdomain||!rootDomain)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_domain",message:`Invalid domain name '${domainName}'. Use a registrable root domain (no subdomain).`},1),output_manager_default.error(`Invalid domain name "${domainName}". Run ${getCommandName("domains --help")}`),1;let amount=parseAmount(flags["--amount"]);if(amount instanceof Error)return usageError(client,amount.message);let wait=parseOrderWait(flags);if(typeof wait=="string")return usageError(client,wait);let fromFlags=readContactFlags(flags);if(typeof fromFlags=="string")return usageError(client,fromFlags);let valuedFlag=chargeFlagWithValue(argv,["--auto-renew","--no-auto-renew","--use-billing-details"]);if(valuedFlag)return usageError(client,valuedFlag);let useBilling=!!flags["--use-billing-details"];if(flags["--auto-renew"]&&flags["--no-auto-renew"])return usageError(client,"Can't use --auto-renew with --no-auto-renew.");let autoRenewChoice=flags["--auto-renew"]?!0:flags["--no-auto-renew"]?!1:void 0,{contextName,team}=await getScope(client),commandOptions={team:team?.slug,useBilling,contact:fromFlags,autoRenew:autoRenewChoice,wait:{noWait:wait.noWait,timeout:flags["--timeout"]===void 0?void 0:wait.timeout},json:asJson},availableStamp=stamp_default(),[domainPrice,domainStatus]=await Promise.all([getDomainPrice(client,domainName),getDomainStatus(client,domainName)]);if(!domainStatus.available){if(await isPurchasedSince(client,domainName,0)){if(!canPromptForCharge(client,asJson)&&team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}return reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew:autoRenewChoice})}return reportChargeFailure(client,asJson,{reason:AGENT_REASON.DOMAIN_NOT_AVAILABLE,message:`The domain ${domainName} is unavailable.`})}if(domainPrice instanceof Error)return reportChargeFailure(client,asJson,{reason:chargeFailureReason(domainPrice),message:domainPrice.message});let{years,purchasePrice,renewalPrice}=domainPrice;if(purchasePrice===null||renewalPrice===null)return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:`The price of ${domainName} was not found.`});output_manager_default.log(`The domain ${param(domainName)} is ${import_chalk.default.underline("available")} to buy under ${import_chalk.default.bold(contextName)}! ${availableStamp()}`);let billing=getBillingContact(team),contact=mergeContact(fromFlags,useBilling?billing:{});if(amount!==void 0&&!amountMatchesPrice(amount,purchasePrice))return reportPriceChanged(client,{verb:"buy",domain:domainName,amount,price:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount:purchasePrice,missing:missingContactFields(contact)}),json:asJson});let autoRenew,contactInformation;if(canPromptForCharge(client,asJson)){if(amount===void 0&&!await client.input.confirm(`Buy now for ${import_chalk.default.bold(formatUsd(purchasePrice))} (${formatTerm(years)})?`,!1))return 0;autoRenew=autoRenewChoice??await client.input.confirm(years===1?`Auto renew yearly for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`:`Auto renew every ${years} years for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`,!0),contactInformation=await collectContactInformation(client,{provided:contact,defaults:mergeContact(fromFlags,billing)})}else{let missing=missingContactFields(contact);if(amount===void 0||missing.length>0||autoRenewChoice===void 0)return requireApproval(client,{domain:domainName,team:team?.slug,contextName,price:purchasePrice,renewalPrice,years,amount,fromFlags,billing,useBilling,autoRenew:autoRenewChoice,wait:commandOptions.wait,json:asJson});if(team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}autoRenew=autoRenewChoice,contactInformation={...contact,companyName:contact.companyName||void 0}}let inspectCommand=buildCommandWithGlobalFlags(client.argv,`domains inspect ${domainName}`),buyResult,purchaseStamp=stamp_default();output_manager_default.spinner("Purchasing");try{buyResult=await purchaseDomain(client,domainName,purchasePrice,years,autoRenew,contactInformation,{waitMs:wait.waitMs,onOrderAccepted:orderId=>{asJson||wait.noWait||(output_manager_default.stopSpinner(),output_manager_default.log(`Order ${orderId} accepted.`),output_manager_default.spinner(`Waiting on the registrar to register ${domainName}`))}})}catch(err){output_manager_default.stopSpinner(),output_manager_default.debug(`Server response: ${(0,import_error_utils.errorToString)(err)}`);let apiError=isAPIError(err)?err:void 0;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:apiError?`Couldn't buy ${domainName}. The API returned an error (${apiError.code}). Nothing was charged.`:`Couldn't buy ${domainName}. The order wasn't sent, so nothing was charged.`},{apiMessage:apiError?.serverMessage})}if(output_manager_default.stopSpinner(),buyResult instanceof DomainPriceChanged)return reportPriceChanged(client,{verb:"buy",domain:domainName,amount:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,missing:[]}),json:asJson});if(buyResult instanceof DomainChargeOutcomeUnknown)return reportUnknownOutcome(client,asJson,{verb:"buy",domain:domainName,inspectCommand,orderId:buyResult.meta.orderId});if(buyResult instanceof DomainPurchaseInProgress){let{orderId}=buyResult.meta;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.PURCHASE_IN_PROGRESS,message:buyResult.message,retryable:!1,data:{domain:domainName,remote:"none",...orderId&&{orderId}},next:[...orderId?[orderStatusStep(client,{verb:"buy",domain:domainName,orderId})]:[],{command:inspectCommand,when:"Once that order finishes, see the domain"}]})}return buyResult instanceof DomainPaymentAuthenticationRequired?reportChargeFailure(client,asJson,{reason:AGENT_REASON.PAYMENT_AUTHENTICATION_REQUIRED,message:buyResult.message,userActionRequired:!0,verification_uri:buyResult.meta.url}):buyResult instanceof Error?reportChargeFailure(client,asJson,{reason:chargeFailureReason(buyResult),message:buyResult.message}):buyResult.status==="already_owned"?reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew,duplicate:{orderId:buyResult.orderId,orderOutcome:buyResult.orderOutcome}}):buyResult.status==="pending"?reportOrderPending(client,asJson,{verb:"buy",domain:domainName,orderId:buyResult.orderId,lastStatus:buyResult.lastStatus,readError:buyResult.readError,inspectCommand,wait}):asJson?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain:domainName,years,charge:{amount:purchasePrice,currency:"USD"},orderId:buyResult.orderId,autoRenew,renewalPrice,message:`Domain ${domainName} purchased.`},null,2)}
7
+ import{require_cjs}from"./chunk-KJUFWRZP.js";import{CONTACT_FIELDS,billingFieldsUsed,collectContactInformation,getBillingContact,getDomainPrice,getDomainStatus,isPurchasedSince,mergeContact,missingContactFields,purchaseDomain,readContactFlags}from"./chunk-H75TYZ4K.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{amountMatchesPrice,canPromptForCharge,chargeFailureReason,chargeFlagWithValue,formatAmountArg,formatTerm,orderStatusStep,parseAmount,parseOrderWait,printChargeRecovery,refuseUnnamedTeam,reportChargeFailure,reportOrderPending,reportPriceChanged,reportUnknownOutcome,reportUsageError,writeChargeAction}from"./chunk-6UWBCYEW.js";import{formatUsd}from"./chunk-3VNS4D7V.js";import{param}from"./chunk-3G3FQYMW.js";import{buySubcommand}from"./chunk-RNHPL4C7.js";import{getScope}from"./chunk-5ZL2RRO3.js";import{TelemetryClient}from"./chunk-EYRBV6RM.js";import{printError}from"./chunk-PYHNDBNH.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-NTSJNYRU.js";import{validateJsonOutput}from"./chunk-KA2KG3SY.js";import{DomainChargeOutcomeUnknown,DomainPaymentAuthenticationRequired,DomainPriceChanged,DomainPurchaseInProgress,isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{getFlagsSpecification,getGlobalFlagsFromArgs,quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),import_tldts=__toESM(require_cjs(),1),import_error_utils=__toESM(require_dist(),1);var DomainsBuyTelemetryClient=class extends TelemetryClient{trackCliArgumentDomain(v){v&&this.trackCliArgument({arg:"domain",value:this.redactedValue})}trackCliOptionAmount(v){this.trackRedactedCliOption("amount",v)}trackCliFlagUseBillingDetails(v){v&&this.trackCliFlag("use-billing-details")}trackCliOptionFirstName(v){this.trackRedactedCliOption("first-name",v)}trackCliOptionLastName(v){this.trackRedactedCliOption("last-name",v)}trackCliOptionEmail(v){this.trackRedactedCliOption("email",v)}trackCliOptionPhone(v){this.trackRedactedCliOption("phone",v)}trackCliOptionAddress(v){this.trackRedactedCliOption("address",v)}trackCliOptionCity(v){this.trackRedactedCliOption("city",v)}trackCliOptionState(v){this.trackRedactedCliOption("state",v)}trackCliOptionZip(v){this.trackRedactedCliOption("zip",v)}trackCliOptionCountry(v){this.trackRedactedCliOption("country",v)}trackCliOptionCompany(v){this.trackRedactedCliOption("company",v)}trackCliFlagAutoRenew(v){v&&this.trackCliFlag("auto-renew")}trackCliFlagNoAutoRenew(v){v&&this.trackCliFlag("no-auto-renew")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionTimeout(timeout){timeout&&this.trackCliOption({option:"timeout",value:"[TIME]"})}trackCliFlagNoWait(noWait){noWait&&this.trackCliFlag("no-wait")}};function buildBuyCommand(client,domain,opts){let parts=[`domains buy ${domain}`];opts.team&&parts.push(`--scope ${opts.team}`),opts.amount!==void 0&&parts.push(`--amount ${formatAmountArg(opts.amount)}`),opts.useBilling&&parts.push("--use-billing-details");for(let{field,flag}of CONTACT_FIELDS){let value=opts.contact[field];value!==void 0?parts.push(`${flag} ${quoteArg(value)}`):opts.missing.includes(field)&&parts.push(`${flag} <${flag.slice(2)}>`)}return opts.autoRenew===!0&&parts.push("--auto-renew"),opts.autoRenew===!1&&parts.push("--no-auto-renew"),opts.wait?.noWait?parts.push("--no-wait"):opts.wait?.timeout&&parts.push(`--timeout ${quoteArg(opts.wait.timeout)}`),opts.json&&parts.push("--json"),buildCommandWithGlobalFlags(client.argv,parts.join(" "))}function flagFor(field){return CONTACT_FIELDS.find(f=>f.field===field).flag}function usageError(client,message){return reportUsageError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}async function buy(client,argv){let telemetry=new DomainsBuyTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(buySubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error instanceof Error?error.message:String(error)},2),printError(error),2}let{args,flags}=parsedArgs,[domainName]=args;if(telemetry.trackCliArgumentDomain(domainName),telemetry.trackCliOptionAmount(flags["--amount"]),telemetry.trackCliFlagUseBillingDetails(flags["--use-billing-details"]),telemetry.trackCliOptionFirstName(flags["--first-name"]),telemetry.trackCliOptionLastName(flags["--last-name"]),telemetry.trackCliOptionEmail(flags["--email"]),telemetry.trackCliOptionPhone(flags["--phone"]),telemetry.trackCliOptionAddress(flags["--address"]),telemetry.trackCliOptionCity(flags["--city"]),telemetry.trackCliOptionState(flags["--state"]),telemetry.trackCliOptionZip(flags["--zip"]),telemetry.trackCliOptionCountry(flags["--country"]),telemetry.trackCliOptionCompany(flags["--company"]),telemetry.trackCliFlagAutoRenew(flags["--auto-renew"]),telemetry.trackCliFlagNoAutoRenew(flags["--no-auto-renew"]),telemetry.trackCliOptionTimeout(flags["--timeout"]),telemetry.trackCliFlagNoWait(flags["--no-wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),!domainName){if(client.nonInteractive){let globalFlags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`domains buy <domain> ${globalFlags.join(" ")}`.trim());outputAgentError(client,{status:"error",reason:"missing_arguments",message:`Missing domain name. Run: ${cmd}`,next:[{command:cmd,when:"Replace <domain> with the domain to buy"}]},2)}return output_manager_default.error(`Missing domain name. Run ${getCommandName("domains --help")}`),2}if(args.length>1){let extra=args[1].toLowerCase();return usageError(client,extra==="true"||extra==="false"?"Unexpected extra argument. On/off options like --auto-renew don't take a value: pass --auto-renew or --no-auto-renew.":'Unexpected extra argument. domains buy takes one domain; quote option values that contain spaces, like --address "1 Main St".')}let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return usageError(client,formatResult.error);let asJson=formatResult.jsonOutput,{domain:rootDomain,subdomain}=(0,import_tldts.parse)(domainName);if(subdomain||!rootDomain)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_domain",message:`Invalid domain name '${domainName}'. Use a registrable root domain (no subdomain).`},1),output_manager_default.error(`Invalid domain name "${domainName}". Run ${getCommandName("domains --help")}`),1;let amount=parseAmount(flags["--amount"]);if(amount instanceof Error)return usageError(client,amount.message);let wait=parseOrderWait(flags);if(typeof wait=="string")return usageError(client,wait);let fromFlags=readContactFlags(flags);if(typeof fromFlags=="string")return usageError(client,fromFlags);let valuedFlag=chargeFlagWithValue(argv,["--auto-renew","--no-auto-renew","--use-billing-details"]);if(valuedFlag)return usageError(client,valuedFlag);let useBilling=!!flags["--use-billing-details"];if(flags["--auto-renew"]&&flags["--no-auto-renew"])return usageError(client,"Can't use --auto-renew with --no-auto-renew.");let autoRenewChoice=flags["--auto-renew"]?!0:flags["--no-auto-renew"]?!1:void 0,{contextName,team}=await getScope(client),commandOptions={team:team?.slug,useBilling,contact:fromFlags,autoRenew:autoRenewChoice,wait:{noWait:wait.noWait,timeout:flags["--timeout"]===void 0?void 0:wait.timeout},json:asJson},availableStamp=stamp_default(),[domainPrice,domainStatus]=await Promise.all([getDomainPrice(client,domainName),getDomainStatus(client,domainName)]);if(!domainStatus.available){if(await isPurchasedSince(client,domainName,0)){if(!canPromptForCharge(client,asJson)&&team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}return reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew:autoRenewChoice})}return reportChargeFailure(client,asJson,{reason:AGENT_REASON.DOMAIN_NOT_AVAILABLE,message:`The domain ${domainName} is unavailable.`})}if(domainPrice instanceof Error)return reportChargeFailure(client,asJson,{reason:chargeFailureReason(domainPrice),message:domainPrice.message});let{years,purchasePrice,renewalPrice}=domainPrice;if(purchasePrice===null||renewalPrice===null)return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:`The price of ${domainName} was not found.`});output_manager_default.log(`The domain ${param(domainName)} is ${import_chalk.default.underline("available")} to buy under ${import_chalk.default.bold(contextName)}! ${availableStamp()}`);let billing=getBillingContact(team),contact=mergeContact(fromFlags,useBilling?billing:{});if(amount!==void 0&&!amountMatchesPrice(amount,purchasePrice))return reportPriceChanged(client,{verb:"buy",domain:domainName,amount,price:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount:purchasePrice,missing:missingContactFields(contact)}),json:asJson});let autoRenew,contactInformation;if(canPromptForCharge(client,asJson)){if(amount===void 0&&!await client.input.confirm(`Buy now for ${import_chalk.default.bold(formatUsd(purchasePrice))} (${formatTerm(years)})?`,!1))return 0;autoRenew=autoRenewChoice??await client.input.confirm(years===1?`Auto renew yearly for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`:`Auto renew every ${years} years for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`,!0),contactInformation=await collectContactInformation(client,{provided:contact,defaults:mergeContact(fromFlags,billing)})}else{let missing=missingContactFields(contact);if(amount===void 0||missing.length>0||autoRenewChoice===void 0)return requireApproval(client,{domain:domainName,team:team?.slug,contextName,price:purchasePrice,renewalPrice,years,amount,fromFlags,billing,useBilling,autoRenew:autoRenewChoice,wait:commandOptions.wait,json:asJson});if(team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}autoRenew=autoRenewChoice,contactInformation={...contact,companyName:contact.companyName||void 0}}let inspectCommand=buildCommandWithGlobalFlags(client.argv,`domains inspect ${domainName}`),buyResult,purchaseStamp=stamp_default();output_manager_default.spinner("Purchasing");try{buyResult=await purchaseDomain(client,domainName,purchasePrice,years,autoRenew,contactInformation,{waitMs:wait.waitMs,onOrderAccepted:orderId=>{asJson||wait.noWait||(output_manager_default.stopSpinner(),output_manager_default.log(`Order ${orderId} accepted.`),output_manager_default.spinner(`Waiting on the registrar to register ${domainName}`))}})}catch(err){output_manager_default.stopSpinner(),output_manager_default.debug(`Server response: ${(0,import_error_utils.errorToString)(err)}`);let apiError=isAPIError(err)?err:void 0;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:apiError?`Couldn't buy ${domainName}. The API returned an error (${apiError.code}). Nothing was charged.`:`Couldn't buy ${domainName}. The order wasn't sent, so nothing was charged.`},{apiMessage:apiError?.serverMessage})}if(output_manager_default.stopSpinner(),buyResult instanceof DomainPriceChanged)return reportPriceChanged(client,{verb:"buy",domain:domainName,amount:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,missing:[]}),json:asJson});if(buyResult instanceof DomainChargeOutcomeUnknown)return reportUnknownOutcome(client,asJson,{verb:"buy",domain:domainName,inspectCommand,orderId:buyResult.meta.orderId});if(buyResult instanceof DomainPurchaseInProgress){let{orderId}=buyResult.meta;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.PURCHASE_IN_PROGRESS,message:buyResult.message,retryable:!1,data:{domain:domainName,remote:"none",...orderId&&{orderId}},next:[...orderId?[orderStatusStep(client,{verb:"buy",domain:domainName,orderId})]:[],{command:inspectCommand,when:"Once that order finishes, see the domain"}]})}return buyResult instanceof DomainPaymentAuthenticationRequired?reportChargeFailure(client,asJson,{reason:AGENT_REASON.PAYMENT_AUTHENTICATION_REQUIRED,message:buyResult.message,userActionRequired:!0,verification_uri:buyResult.meta.url}):buyResult instanceof Error?reportChargeFailure(client,asJson,{reason:chargeFailureReason(buyResult),message:buyResult.message}):buyResult.status==="already_owned"?reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew,duplicate:{orderId:buyResult.orderId,orderOutcome:buyResult.orderOutcome}}):buyResult.status==="pending"?reportOrderPending(client,asJson,{verb:"buy",domain:domainName,orderId:buyResult.orderId,lastStatus:buyResult.lastStatus,readError:buyResult.readError,inspectCommand,wait}):asJson?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain:domainName,years,charge:{amount:purchasePrice,currency:"USD"},orderId:buyResult.orderId,autoRenew,renewalPrice,message:`Domain ${domainName} purchased.`},null,2)}
8
8
  `),0):(client.stdout.write(`${domainName}
9
9
  `),output_manager_default.success(`Domain ${param(domainName)} purchased ${purchaseStamp()}`),output_manager_default.log(`Charged ${formatUsd(purchasePrice)} for ${formatTerm(years)}. Registered to ${contactInformation.firstName} ${contactInformation.lastName} (${contactInformation.email}).`),output_manager_default.note(`You may now use your domain as an alias to your deployments. Run ${getCommandName("alias --help")}`),0)}function reportAlreadyOwned(client,json,domain,contextName,opts={}){let{duplicate,autoRenew}=opts,autoRenewCommand=autoRenew===void 0?void 0:buildCommandWithGlobalFlags(client.argv,`domains auto-renew ${autoRenew?"enable":"disable"} ${domain}`),message=[duplicate?`${domain} is already registered to ${contextName} by an earlier purchase. This run's order ${duplicate.orderId} ${duplicate.orderOutcome==="refunded"?"failed, and its charge was refunded":"failed"}.`:`${domain} is already registered to ${contextName}. Nothing was charged.`,autoRenewCommand?`This run didn't change its auto-renew setting; to turn it ${autoRenew?"on":"off"}, run ${autoRenewCommand}.`:""].filter(Boolean).join(" ");return json?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain,outcome:"unchanged",...duplicate&&{orderId:duplicate.orderId,orderStatus:duplicate.orderOutcome},message,...autoRenewCommand&&{next:[{command:autoRenewCommand,when:`To turn auto-renew ${autoRenew?"on":"off"} for the existing registration`}]}},null,2)}
10
10
  `),0):(client.stdout.write(`${domain}
@@ -0,0 +1,7 @@
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{parseArguments}from"./chunk-INIZJZ3O.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{__toESM}from"./chunk-BZENIQ7N.js";var config=__toESM(require_cli_config(),1);import path from"node:path";var INVOCATION_CWD=Symbol.for("vercel.cli.invocation-cwd"),startupCwd=process.cwd();function getInvocationCwd(){let cwd=Reflect.get(globalThis,INVOCATION_CWD);return typeof cwd=="string"?cwd:startupCwd}function getGlobalPathConfig2(argvSlice=process.argv.slice(2),cwd=getInvocationCwd()){let confFlag=parseArguments(argvSlice,{},{permissive:!0}).flags["--global-config"];return confFlag?path.resolve(cwd,confFlag):config.getGlobalPathConfig()}export{getInvocationCwd,getGlobalPathConfig2 as getGlobalPathConfig};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{Diagnostic,init_dist}from"./chunk-AP6DZGTK.js";init_dist();var FIX_BY_CODE={missing_build_script:"Add a `build` script to your `package.json`, or set a Build Command in your Project Settings.",MISSING_DOTENV_VARS:"Define the missing variables in your `.env` file, or pull them with `vercel env pull`.",MAX_LAMBDA_SIZE_EXCEEDED:"Reduce the function bundle \u2014 trim dependencies or included files, or split the function.",NODE_DEPENDENCY_SYNC_FAILED:"Install your dependencies (e.g. `npm install`) and confirm they resolve, then retry.",INSTALL_COMMAND_FAILED:"Fix the dependency error logged above, then retry.",CONFLICTING_CONFIG_FILES:"Keep a single configuration file \u2014 remove the extra `vercel.json`/`now.json`.",CANT_PARSE_JSON_FILE:"Fix the JSON syntax error at the location shown above, then retry."};function toDiagnostic(err,{syscall,fixes={},fallback}){if(err instanceof Diagnostic)return err;let source=err,message=typeof source?.message=="string"?source.message:String(err),isSyscall=typeof source?.errno=="number"||typeof source?.syscall=="string",code=typeof source?.code=="string"?source.code:void 0,docs=typeof source?.link=="string"?source.link:void 0,action=typeof source?.action=="string"?source.action:void 0,fix=code?Object.hasOwn(fixes,code)?fixes[code]:Object.hasOwn(FIX_BY_CODE,code)?FIX_BY_CODE[code]:void 0:void 0,diagnostic=isSyscall&&syscall?syscall(message,err):!code&&fallback?fallback(message,err):new Diagnostic({why:message,fix,docs,cause:err});return code&&!(isSyscall&&syscall)&&(diagnostic.name=code),docs&&(diagnostic.docs=docs),action&&(diagnostic.action=action),diagnostic}export{FIX_BY_CODE,toDiagnostic};
7
+ import{Diagnostic,init_dist}from"./chunk-RYSO5U3E.js";init_dist();var FIX_BY_CODE={missing_build_script:"Add a `build` script to your `package.json`, or set a Build Command in your Project Settings.",MISSING_DOTENV_VARS:"Define the missing variables in your `.env` file, or pull them with `vercel env pull`.",MAX_LAMBDA_SIZE_EXCEEDED:"Reduce the function bundle \u2014 trim dependencies or included files, or split the function.",NODE_DEPENDENCY_SYNC_FAILED:"Install your dependencies (e.g. `npm install`) and confirm they resolve, then retry.",INSTALL_COMMAND_FAILED:"Fix the dependency error logged above, then retry.",CONFLICTING_CONFIG_FILES:"Keep a single configuration file \u2014 remove the extra `vercel.json`/`now.json`.",CANT_PARSE_JSON_FILE:"Fix the JSON syntax error at the location shown above, then retry."};function toDiagnostic(err,{syscall,fixes={},fallback}){if(err instanceof Diagnostic)return err;let source=err,message=typeof source?.message=="string"?source.message:String(err),isSyscall=typeof source?.errno=="number"||typeof source?.syscall=="string",code=typeof source?.code=="string"?source.code:void 0,docs=typeof source?.link=="string"?source.link:void 0,action=typeof source?.action=="string"?source.action:void 0,fix=code?Object.hasOwn(fixes,code)?fixes[code]:Object.hasOwn(FIX_BY_CODE,code)?FIX_BY_CODE[code]:void 0:void 0,diagnostic=isSyscall&&syscall?syscall(message,err):!code&&fallback?fallback(message,err):new Diagnostic({why:message,fix,docs,cause:err});return code&&!(isSyscall&&syscall)&&(diagnostic.name=code),docs&&(diagnostic.docs=docs),action&&(diagnostic.action=action),diagnostic}export{FIX_BY_CODE,toDiagnostic};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-QPX6N5CV.js";import"./chunk-OOPF73RV.js";import"./chunk-M32HBBPK.js";import"./chunk-D3M2JG5C.js";import"./chunk-GD7AV7BO.js";import{permissionsClearSubcommand}from"./chunk-JDDPCL3K.js";import"./chunk-5ZL2RRO3.js";import"./chunk-NJFXR3FN.js";import"./chunk-M2Q2DUHO.js";import"./chunk-4HR3I3ML.js";import"./chunk-3AFEVHHY.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-ZRFDZO7Y.js";import"./chunk-MXTC4ZAQ.js";import{printError}from"./chunk-PYHNDBNH.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-NTSJNYRU.js";import"./chunk-KA2KG3SY.js";import"./chunk-AW33SRYY.js";import"./chunk-4SAVH3H7.js";import"./chunk-4NTBYNFR.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-7HQZRU25.js";import"./chunk-YTSGFU5T.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-SQ62IODX.js";import{getFlagsSpecification}from"./chunk-DORCX7UB.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-BZENIQ7N.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
8
+ `):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};