vercel 64.4.0 → 64.7.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 (251) hide show
  1. package/dist/chunks/{add-FRVZLYB5.js → add-J6YV6RJ7.js} +1 -1
  2. package/dist/chunks/{add-UXOTAL3N.js → add-LN5C4Y2G.js} +1 -1
  3. package/dist/chunks/add-UBG7IGYE.js +8 -0
  4. package/dist/chunks/{build-F5GOX2EV.js → build-7QUO5T72.js} +1 -1
  5. package/dist/chunks/chunk-2B2Z447M.js +10 -0
  6. package/dist/chunks/{chunk-MV4WHUIC.js → chunk-2EYJFHEL.js} +1 -1
  7. package/dist/chunks/chunk-2IRZ2C5L.js +9 -0
  8. package/dist/chunks/{chunk-UGMTKOTN.js → chunk-2LMIOQID.js} +1 -1
  9. package/dist/chunks/{chunk-GF7EG5IA.js → chunk-2PSLXHNT.js} +1 -1
  10. package/dist/chunks/chunk-3BTEMYLT.js +7 -0
  11. package/dist/chunks/chunk-4ITTBUCW.js +7 -0
  12. package/dist/chunks/chunk-4KYSK2MS.js +7 -0
  13. package/dist/chunks/{chunk-XXCWQPAH.js → chunk-4XKEOH4J.js} +1 -1
  14. package/dist/chunks/{chunk-TDDZGUU6.js → chunk-54KLVDB5.js} +1 -1
  15. package/dist/chunks/{chunk-6JGC4YDH.js → chunk-6CXHR2ND.js} +2 -2
  16. package/dist/chunks/{chunk-KKQL4AKH.js → chunk-7ENWK2AH.js} +1 -1
  17. package/dist/chunks/{chunk-6RVMAWKT.js → chunk-A4NHFQVX.js} +2 -2
  18. package/dist/chunks/{chunk-QC5AMRWR.js → chunk-AAFST44A.js} +1 -1
  19. package/dist/chunks/chunk-AGH2CMUM.js +7 -0
  20. package/dist/chunks/chunk-ANUSL4ES.js +7 -0
  21. package/dist/chunks/chunk-AOYNYH5D.js +7 -0
  22. package/dist/chunks/chunk-BMQREWR6.js +10 -0
  23. package/dist/chunks/chunk-BXHADCSX.js +7 -0
  24. package/dist/chunks/{chunk-Q5ZGA2RO.js → chunk-CFEJIJGS.js} +1 -1
  25. package/dist/chunks/{chunk-7GFRZWLE.js → chunk-CQQQSUQX.js} +1 -1
  26. package/dist/chunks/{chunk-3E364MJE.js → chunk-D6REP5QQ.js} +1 -1
  27. package/dist/chunks/{chunk-GJP22N6R.js → chunk-D7X7W4F4.js} +1 -1
  28. package/dist/chunks/{chunk-UQIVF4Q2.js → chunk-DD5XIW5T.js} +1 -1
  29. package/dist/chunks/{chunk-ZQKDO5PL.js → chunk-DQLWDDNU.js} +1 -1
  30. package/dist/chunks/{chunk-TCYAAWLB.js → chunk-DX6PPIY7.js} +1 -1
  31. package/dist/chunks/chunk-EU2FGSLR.js +15 -0
  32. package/dist/chunks/{chunk-ZVLDGT4O.js → chunk-EVEH3L3V.js} +1 -1
  33. package/dist/chunks/{chunk-TPVAPVQC.js → chunk-EVXOSCYR.js} +1 -1
  34. package/dist/chunks/chunk-EWK3VAME.js +9 -0
  35. package/dist/chunks/{chunk-6ZRULOO3.js → chunk-EWUSBHX5.js} +1 -1
  36. package/dist/chunks/chunk-F2TLISI5.js +7 -0
  37. package/dist/chunks/chunk-FOGLMAZE.js +7 -0
  38. package/dist/chunks/{chunk-MZLQY2EQ.js → chunk-FZUNGPGO.js} +1 -1
  39. package/dist/chunks/{chunk-JCTXRR4A.js → chunk-GH6O7YJ3.js} +1 -1
  40. package/dist/chunks/{chunk-ZLWTPS5T.js → chunk-GOVZY7W2.js} +1 -1
  41. package/dist/chunks/{chunk-LD5U73LA.js → chunk-HGTMU34S.js} +1 -1
  42. package/dist/chunks/{chunk-ZZ3LJ22B.js → chunk-HJV7CTD4.js} +2 -2
  43. package/dist/chunks/{chunk-444RE4Z5.js → chunk-I7KMJTOY.js} +1 -1
  44. package/dist/chunks/{chunk-WGOQGKS5.js → chunk-IULNLFPX.js} +1 -1
  45. package/dist/chunks/{chunk-OCOVCC5Q.js → chunk-JHB3TYKZ.js} +1 -1
  46. package/dist/chunks/{chunk-H3KYG32S.js → chunk-JJSDTLBW.js} +1 -1
  47. package/dist/chunks/{chunk-6HOVHRWJ.js → chunk-JSCK6WWR.js} +3 -3
  48. package/dist/chunks/chunk-JXKKJ5OI.js +7 -0
  49. package/dist/chunks/{chunk-JV6IPUGX.js → chunk-KJKM2UNP.js} +1 -1
  50. package/dist/chunks/chunk-KJWOXBZV.js +7 -0
  51. package/dist/chunks/chunk-KYMABVTF.js +25 -0
  52. package/dist/chunks/{chunk-ZVTI6BRR.js → chunk-M2NKATEC.js} +1 -1
  53. package/dist/chunks/{chunk-A63VVXW2.js → chunk-MGOPTP7N.js} +1 -1
  54. package/dist/chunks/{chunk-BLAIBYEU.js → chunk-MP27ZZFO.js} +2 -2
  55. package/dist/chunks/{chunk-AA434KXY.js → chunk-N5SAC4AS.js} +1 -1
  56. package/dist/chunks/{chunk-DNTQK2SW.js → chunk-N7YVHGLM.js} +1 -1
  57. package/dist/chunks/{chunk-GWB27IAS.js → chunk-NBNZYZFM.js} +1 -1
  58. package/dist/chunks/chunk-O3AL3QFA.js +7 -0
  59. package/dist/chunks/chunk-O5ZJ5YJP.js +10 -0
  60. package/dist/chunks/{chunk-AQUDXMFH.js → chunk-OGH32TS2.js} +1 -1
  61. package/dist/chunks/chunk-OS62YRSW.js +7 -0
  62. package/dist/chunks/{chunk-QC3HEGFD.js → chunk-P4U47GXI.js} +4 -3
  63. package/dist/chunks/{chunk-OUTCLR64.js → chunk-PA5N7YTJ.js} +1 -1
  64. package/dist/chunks/{chunk-OUHPDA7Q.js → chunk-PADL3C6Z.js} +1 -1
  65. package/dist/chunks/chunk-PE5BSEYV.js +7 -0
  66. package/dist/chunks/{chunk-E6R2QOOR.js → chunk-PNR5J6ZW.js} +1 -1
  67. package/dist/chunks/chunk-PPWMHBWP.js +9 -0
  68. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  69. package/dist/chunks/{chunk-FLBI6DY2.js → chunk-QQ6IA4O5.js} +1 -1
  70. package/dist/chunks/{chunk-YTEZO2SZ.js → chunk-QRCJKCMF.js} +1 -1
  71. package/dist/chunks/{chunk-XJXX4QXA.js → chunk-QW4W2UB6.js} +1 -1
  72. package/dist/chunks/{chunk-DWEDXCBK.js → chunk-R5QHLEAJ.js} +4 -4
  73. package/dist/chunks/chunk-R6Y4Z5VL.js +7 -0
  74. package/dist/chunks/{chunk-U3NQZJQ4.js → chunk-RD7VCVW5.js} +3 -3
  75. package/dist/chunks/chunk-S76ILVQO.js +7 -0
  76. package/dist/chunks/chunk-SADXKDBI.js +7 -0
  77. package/dist/chunks/{chunk-QAETJRKX.js → chunk-SCJH3KSQ.js} +1 -1
  78. package/dist/chunks/{chunk-G2IJOQR3.js → chunk-SQXVQT2O.js} +5 -5
  79. package/dist/chunks/{chunk-OXAPCSYY.js → chunk-TD7MFXUO.js} +1 -1
  80. package/dist/chunks/{chunk-2UMWTCY7.js → chunk-TVHFWIH4.js} +1 -1
  81. package/dist/chunks/{chunk-IIC2A4YN.js → chunk-UI53O6MW.js} +1 -1
  82. package/dist/chunks/chunk-VO6FF6DY.js +7 -0
  83. package/dist/chunks/chunk-WFJEWVTE.js +12 -0
  84. package/dist/chunks/{chunk-6GIP2YPX.js → chunk-WX2KXEZV.js} +1 -1
  85. package/dist/chunks/{chunk-IYCHAIFZ.js → chunk-X44OEPBR.js} +1 -1
  86. package/dist/chunks/{chunk-QCWV7FML.js → chunk-X5HOJBDL.js} +7 -7
  87. package/dist/chunks/{chunk-HTLGLTKD.js → chunk-XGO6AXX5.js} +2 -2
  88. package/dist/chunks/chunk-XOETL6DB.js +96 -0
  89. package/dist/chunks/chunk-Y4GLHDBA.js +9 -0
  90. package/dist/chunks/{chunk-GWZ4VPU3.js → chunk-YE6WQYJH.js} +2 -2
  91. package/dist/chunks/chunk-Z5NJL63U.js +7 -0
  92. package/dist/chunks/chunk-ZOYMKZOR.js +7 -0
  93. package/dist/chunks/{chunk-GLJH35MJ.js → chunk-ZT2HVX54.js} +1 -1
  94. package/dist/chunks/{clear-2VHJFFMM.js → clear-HKGEIG6F.js} +1 -1
  95. package/dist/chunks/{compile-vercel-config-ADKZDUAU.js → compile-vercel-config-ZY34MDLE.js} +1 -1
  96. package/dist/chunks/{config-D22GD5IM.js → config-33ZMAOLB.js} +1 -1
  97. package/dist/chunks/config-VWDIXJZA.js +7 -0
  98. package/dist/chunks/config-validator.mjs +1 -1
  99. package/dist/chunks/delete-OMER3AX3.js +10 -0
  100. package/dist/chunks/{delete-4JCBFL7Y.js → delete-ZHGL7GGN.js} +1 -1
  101. package/dist/chunks/{detect-projects-LFEZ7BQU.js → detect-projects-PNODS4M7.js} +1 -1
  102. package/dist/chunks/{detect-services-A2B6KJO5.js → detect-services-ABFXK5B7.js} +1 -1
  103. package/dist/chunks/disable-OIGHKAMI.js +7 -0
  104. package/dist/chunks/discard-XUMTJVVB.js +14 -0
  105. package/dist/chunks/edit-3DIEWIVC.js +8 -0
  106. package/dist/chunks/{edit-3XGKBSUZ.js → edit-IQ74VVWW.js} +1 -1
  107. package/dist/chunks/enable-AVCTKWMV.js +7 -0
  108. package/dist/chunks/{export-WLJE6AJW.js → export-LS4WTCAJ.js} +1 -1
  109. package/dist/chunks/future-BSDI3CNY.js +7 -0
  110. package/dist/chunks/generate-cert-for-deploy-FEZT4VSA.js +7 -0
  111. package/dist/chunks/image-BIOIWB4M.js +7 -0
  112. package/dist/chunks/{import-builders-FX2XXVRT.js → import-builders-5TVTITKF.js} +1 -1
  113. package/dist/chunks/inspect-2OWYT5HO.js +13 -0
  114. package/dist/chunks/{inspect-DZMXSBMA.js → inspect-4OQTNJ46.js} +1 -1
  115. package/dist/chunks/{inspect-F6NLCWHN.js → inspect-FR333BCC.js} +1 -1
  116. package/dist/chunks/{inspect-UNZR445S.js → inspect-VEBZWYJL.js} +1 -1
  117. package/dist/chunks/{inspect-VVYQWFTM.js → inspect-WPYSJNEK.js} +1 -1
  118. package/dist/chunks/list-LZCBVTIL.js +12 -0
  119. package/dist/chunks/{list-GDI5O246.js → list-Z43SODYP.js} +1 -1
  120. package/dist/chunks/{list-G4E6RG3V.js → list-ZK7VDRVT.js} +2 -2
  121. package/dist/chunks/{login-XPUGYRGM.js → login-36BXMMDQ.js} +1 -1
  122. package/dist/chunks/login-HAND2C3L.js +7 -0
  123. package/dist/chunks/logs-JYROMZI7.js +7 -0
  124. package/dist/chunks/{ls-CGZ3NL5R.js → ls-H3ICVEYT.js} +1 -1
  125. package/dist/chunks/ls-IMAHWKOH.js +8 -0
  126. package/dist/chunks/ls-LYVIYO4J.js +12 -0
  127. package/dist/chunks/ls-M7YO74RP.js +12 -0
  128. package/dist/chunks/ls-QND7WBWE.js +12 -0
  129. package/dist/chunks/ls-VWA57ZVD.js +12 -0
  130. package/dist/chunks/ls-YWZLCIGC.js +11 -0
  131. package/dist/chunks/mutate-JQF3GLZP.js +9 -0
  132. package/dist/chunks/notifications-2SS4R53X.js +7 -0
  133. package/dist/chunks/open-RF3GYOHD.js +7 -0
  134. package/dist/chunks/openapi-GTAWN7OT.js +7 -0
  135. package/dist/chunks/permissions-G4F4PLFB.js +7 -0
  136. package/dist/chunks/prompt-missing-credentials-CV5NLAYI.js +7 -0
  137. package/dist/chunks/publish-KXUGNXEK.js +15 -0
  138. package/dist/chunks/pull-ELQ3GVJJ.js +7 -0
  139. package/dist/chunks/purchase-domain-if-available-QDQJOGOX.js +7 -0
  140. package/dist/chunks/{push-YOAY5F5X.js → push-WSYAQQKI.js} +1 -1
  141. package/dist/chunks/query-ESQIFSJ6.js +12 -0
  142. package/dist/chunks/reauthenticate-H7ZY6BVA.js +7 -0
  143. package/dist/chunks/reorder-SADHAXS4.js +10 -0
  144. package/dist/chunks/{reply-G4EVGJQ3.js → reply-UFH3BEMN.js} +1 -1
  145. package/dist/chunks/{resolve-SNM6MK5J.js → resolve-5THDM4PN.js} +1 -1
  146. package/dist/chunks/resolve-agent-team-MCTKBED5.js +7 -0
  147. package/dist/chunks/restore-3ZTRYEOV.js +16 -0
  148. package/dist/chunks/rm-GUSBRP6P.js +8 -0
  149. package/dist/chunks/rm-HUQFQOP2.js +8 -0
  150. package/dist/chunks/rm-WVA4E2BL.js +8 -0
  151. package/dist/chunks/rm-ZL4VR3BA.js +8 -0
  152. package/dist/chunks/rm-ZQWP6MUB.js +8 -0
  153. package/dist/chunks/routes-ZOLO53UC.js +7 -0
  154. package/dist/chunks/rule-inspect-WJ6ENOME.js +8 -0
  155. package/dist/chunks/{schema-KG4RWQBC.js → schema-7ACGW22H.js} +1 -1
  156. package/dist/chunks/{schema-HWS2SOZS.js → schema-D2CWSXZU.js} +7 -7
  157. package/dist/chunks/{select-org-AAB5RBSB.js → select-org-3BWXFGPH.js} +1 -1
  158. package/dist/chunks/set-5I5CPDY3.js +7 -0
  159. package/dist/chunks/setup-and-link-HJSR6ANM.js +7 -0
  160. package/dist/chunks/skills-C2WOCF5Q.js +590 -0
  161. package/dist/chunks/{tags-O6R6VWPP.js → tags-HTY22QMH.js} +1 -1
  162. package/dist/chunks/{types-Y3NJROKH.js → types-6PREOZWK.js} +1 -1
  163. package/dist/chunks/update-6TDKMDKO.js +8 -0
  164. package/dist/commands/build/index.js +3 -3
  165. package/dist/commands/deploy/index.js +12 -9
  166. package/dist/commands/dev/index.js +15 -102
  167. package/dist/commands/env/index.js +13 -13
  168. package/dist/commands/link/index.js +1 -1
  169. package/dist/commands/list/index.js +2 -2
  170. package/dist/commands-bulk.js +320 -279
  171. package/dist/help.js +1 -1
  172. package/dist/index.js +2 -2
  173. package/dist/internal-build.js +1 -1
  174. package/dist/root-help-commands.mjs +1 -1
  175. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  176. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  177. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  178. package/dist/version.mjs +1 -1
  179. package/package.json +64 -56
  180. package/dist/chunks/add-5RV75RPG.js +0 -8
  181. package/dist/chunks/chunk-2B3A3MOX.js +0 -7
  182. package/dist/chunks/chunk-7NNENHGN.js +0 -7
  183. package/dist/chunks/chunk-AALI66ML.js +0 -9
  184. package/dist/chunks/chunk-BAT6SDBJ.js +0 -10
  185. package/dist/chunks/chunk-BFRDBBSO.js +0 -7
  186. package/dist/chunks/chunk-CMKLX4DC.js +0 -7
  187. package/dist/chunks/chunk-D4MW3RDW.js +0 -7
  188. package/dist/chunks/chunk-ELDHGU6N.js +0 -7
  189. package/dist/chunks/chunk-EXPLBM7J.js +0 -9
  190. package/dist/chunks/chunk-GCSAJUL6.js +0 -13
  191. package/dist/chunks/chunk-GVVIFYQE.js +0 -7
  192. package/dist/chunks/chunk-HJRAWEA2.js +0 -7
  193. package/dist/chunks/chunk-IL7X6EKK.js +0 -9
  194. package/dist/chunks/chunk-ILFUNCJZ.js +0 -7
  195. package/dist/chunks/chunk-ITKS32PG.js +0 -7
  196. package/dist/chunks/chunk-J6O6JW2K.js +0 -7
  197. package/dist/chunks/chunk-KUGXOLL7.js +0 -25
  198. package/dist/chunks/chunk-MI7W4QMV.js +0 -7
  199. package/dist/chunks/chunk-MMPQC2N6.js +0 -7
  200. package/dist/chunks/chunk-NLCTF4EJ.js +0 -14
  201. package/dist/chunks/chunk-UCAE5Z5L.js +0 -7
  202. package/dist/chunks/chunk-VRWLNWNE.js +0 -7
  203. package/dist/chunks/chunk-W3TGCMRW.js +0 -9
  204. package/dist/chunks/chunk-XW4ZWX3I.js +0 -7
  205. package/dist/chunks/chunk-Y24OSBXP.js +0 -7
  206. package/dist/chunks/chunk-YS542RHZ.js +0 -7
  207. package/dist/chunks/chunk-ZBDLYNUF.js +0 -7
  208. package/dist/chunks/config-AZ2O2E4R.js +0 -7
  209. package/dist/chunks/delete-UOY7IFZV.js +0 -10
  210. package/dist/chunks/disable-Q5BTSVR7.js +0 -7
  211. package/dist/chunks/discard-5LQP6CPX.js +0 -14
  212. package/dist/chunks/edit-R5X24DJJ.js +0 -8
  213. package/dist/chunks/enable-V2IPH6TD.js +0 -7
  214. package/dist/chunks/future-6UTK4EFE.js +0 -7
  215. package/dist/chunks/generate-cert-for-deploy-WDKFR34X.js +0 -7
  216. package/dist/chunks/image-IL7IN7MD.js +0 -7
  217. package/dist/chunks/inspect-E2HPGMNI.js +0 -13
  218. package/dist/chunks/list-DXOVBT4F.js +0 -11
  219. package/dist/chunks/login-HU5OFS7T.js +0 -7
  220. package/dist/chunks/logs-EWXTZN4W.js +0 -7
  221. package/dist/chunks/ls-3GNX6IPE.js +0 -8
  222. package/dist/chunks/ls-A3HIPTF5.js +0 -12
  223. package/dist/chunks/ls-A4NEYMKP.js +0 -11
  224. package/dist/chunks/ls-PF2XG6UU.js +0 -12
  225. package/dist/chunks/ls-SZKDUJHV.js +0 -12
  226. package/dist/chunks/ls-TCB7UUPP.js +0 -12
  227. package/dist/chunks/mutate-BQAP2S7A.js +0 -9
  228. package/dist/chunks/notifications-WUCV63TE.js +0 -7
  229. package/dist/chunks/open-QJE5QER2.js +0 -7
  230. package/dist/chunks/openapi-BQSQNXQE.js +0 -7
  231. package/dist/chunks/permissions-6LOJKL5W.js +0 -7
  232. package/dist/chunks/prompt-missing-credentials-IGTCFUA6.js +0 -7
  233. package/dist/chunks/publish-XR24NSTQ.js +0 -15
  234. package/dist/chunks/pull-CXUNHWAO.js +0 -7
  235. package/dist/chunks/purchase-domain-if-available-4YKWAHH5.js +0 -7
  236. package/dist/chunks/query-GHFOZV7K.js +0 -12
  237. package/dist/chunks/reauthenticate-W7QIXLZ3.js +0 -7
  238. package/dist/chunks/reorder-TQGSMCBZ.js +0 -10
  239. package/dist/chunks/resolve-agent-team-43HZCPF3.js +0 -7
  240. package/dist/chunks/restore-3NDP224I.js +0 -16
  241. package/dist/chunks/rm-2TR2KBDP.js +0 -8
  242. package/dist/chunks/rm-IGY6LD6H.js +0 -8
  243. package/dist/chunks/rm-N6ZUA66Z.js +0 -8
  244. package/dist/chunks/rm-OI5VS7GG.js +0 -8
  245. package/dist/chunks/rm-REZG7TP4.js +0 -8
  246. package/dist/chunks/routes-LK2HUGAK.js +0 -7
  247. package/dist/chunks/rule-inspect-NLEABBTP.js +0 -8
  248. package/dist/chunks/rules-XSLHADBV.js +0 -7
  249. package/dist/chunks/set-AJEMEBZU.js +0 -7
  250. package/dist/chunks/setup-and-link-6AIRWXXX.js +0 -7
  251. package/dist/chunks/update-C7XR7CHI.js +0 -8
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{allOption,confirmOption,formatOption,jsonOption,limitOption,nextOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var listCommand={name:"list",aliases:["ls"],description:"List deployments.",arguments:[{name:"app",required:!1}],options:[allOption,{name:"meta",description:"Filter deployments by metadata (e.g.: `-m KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:"m",type:[String],deprecated:!1},{name:"policy",description:"See deployments with provided Deployment Retention policies (e.g.: `-p KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"",argument:"TARGET",shorthand:null,type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:"s",type:String,deprecated:!1},nextOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!1},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list -m key1=value1 -m key2=value2`},{name:"Paginate deployments for a project, where `1584722256178` is the time in milliseconds since the UNIX epoch",value:`${packageName} list my-app --next 1584722256178`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getEnvTargetPlaceholder}from"./chunk-CMKLX4DC.js";import{projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var buildCommand={name:"build",aliases:[],description:"Build the project.",arguments:[],options:[{name:"prod",description:"Build a production deployment",shorthand:null,type:Boolean,deprecated:!1},{name:"target",shorthand:null,type:String,argument:"TARGET",deprecated:!1,description:"Specify the target environment"},{name:"output",description:"Directory where built assets will be written to",shorthand:null,argument:"DIR",type:String,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt about pulling environment variables and project settings when not found locally"},{name:"standalone",description:"Create a standalone build with all dependencies inlined into function output folders",shorthand:null,type:Boolean,deprecated:!1},{name:"id",description:"Deployment ID to pull environment variables from (e.g. dpl_xxx)",shorthand:null,type:String,argument:"ID",deprecated:!1},projectOption],examples:[{name:"Build the project",value:`${packageName} build`},{name:"Build the project in a specific directory",value:`${packageName} build --cwd ./path-to-project`},{name:"Build with deployment-scoped environment variables",value:`${packageName} build --id dpl_xxx`}]};var pullCommand={name:"pull",aliases:[],description:"Pull Environment Variables and project settings into .vercel",arguments:[{name:"project-path",required:!1}],options:[{name:"environment",description:"Deployment environment [development]",argument:"TARGET",shorthand:null,type:String,deprecated:!1},{name:"git-branch",description:"Specify the Git branch to pull specific Environment Variables for",argument:"NAME",shorthand:null,type:String,deprecated:!1},{name:"prod",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip questions when setting up new project using default scope and settings"},projectOption],examples:[{name:"Pull the latest Environment Variables and Project Settings from the cloud",value:`${packageName} pull`},{name:"Pull the latest Environment Variables and Project Settings from the cloud targeting a directory",value:`${packageName} pull ./path-to-project`},{name:"Pull for a specific environment",value:`${packageName} pull --environment=${getEnvTargetPlaceholder()}`},{name:"Pull for a preview feature branch",value:`${packageName} pull --environment=preview --git-branch=feature-branch`},{name:"Pull Environment Variables into an application env file with `vercel env pull`",value:`${packageName} env pull`}]};export{buildCommand,pullCommand};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:["vercel alerts rules schema --type built-in"]},rulesAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope flag, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",body:[...JSON.stringify(builtInBody,null,2).split(`
8
- `),"","vercel alerts rules add --project my-app --body ./rule.json"]},authoringReference],rulesUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored rule.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the rule to team-wide scope."]},{title:"Partial body (patch.json)",body:[...JSON.stringify(patchBody,null,2).split(`
9
- `),"","vercel alerts rules update ar_abc123 --body ./patch.json","vercel alerts rules update ar_abc123 --project my-app"]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible rules in the selected team"},mutationAllOption={...listAllOption,description:"Apply the rule to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the alert rule body from a JSON file"},rulesLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List alert rules for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by rule type"},formatOption,jsonOption],examples:[{name:"List rules affecting the linked project",value:`${packageName} alerts rules ls`},{name:"List all rules in the selected team",value:`${packageName} alerts rules ls --all`},{name:"Write JSON output",value:`${packageName} alerts rules ls --all --json`}]},rulesSchemaSubcommand={name:"schema",aliases:[],description:"Show alert rule request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Rule type to describe"},formatOption,jsonOption],examples:[{name:"List supported rule types",value:`${packageName} alerts rules schema`},{name:"Show the built-in rule schema",value:`${packageName} alerts rules schema --type built-in`}]},rulesAddSubcommand={name:"add",aliases:["create"],description:"Create an alert rule from a JSON body",helpSections:rulesAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped rule",value:`${packageName} alerts rules add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in rule",value:`${packageName} alerts rules add --all --body ./rule.json`}]},rulesInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one alert rule by ID",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules inspect ar_abc123 --json`}]},rulesRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Delete an alert rule",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Delete with confirmation",value:`${packageName} alerts rules remove ar_abc123`},{name:"Delete without a prompt",value:`${packageName} alerts rules remove ar_abc123 --yes`}]},rulesUpdateSubcommand={name:"update",aliases:["patch"],description:"Patch an alert rule or change its scope",helpSections:rulesUpdateHelpSections,arguments:[{name:"ruleId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} alerts rules update ar_abc123 --body ./patch.json`},{name:"Move a rule to a project",value:`${packageName} alerts rules update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the rule"},rulesNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable rules or one alert rule",arguments:[{name:"ruleId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable rules",value:`${packageName} alerts rules notifications ls`},{name:"List notification destinations for one rule",value:`${packageName} alerts rules notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules notifications ar_abc123 --json`}]},rulesNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},rulesNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} alerts rules notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the rule",value:`${packageName} alerts rules notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},rulesNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} alerts rules notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} alerts rules notifications unlink ar_abc123 --webhook wh_abc123`}]},rulesNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for alert rules",arguments:[],subcommands:[rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable rules",value:`${packageName} alerts rules notifications`},{name:"List destinations for one rule",value:`${packageName} alerts rules notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`}]},rulesAggregateCommand={name:"rules",aliases:[],description:"Create, inspect, list, update, and delete alert rules and manage their notification destinations",arguments:[],subcommands:[rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsAggregateCommand],options:[],examples:[{name:"List rules for the linked project",value:`${packageName} alerts rules ls`},{name:"Add a rule",value:`${packageName} alerts rules add --project my-app --body ./rule.json`},{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Update a rule",value:`${packageName} alerts rules update ar_abc123 --body ./patch.json`},{name:"Delete a rule",value:`${packageName} alerts rules remove ar_abc123`},{name:"List notification destinations for a rule",value:`${packageName} alerts rules notifications ar_abc123`}]};export{rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand,rulesNotificationsAggregateCommand,rulesAggregateCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{resolveProjectContext}from"./chunk-6ZRULOO3.js";import{printError}from"./chunk-QAETJRKX.js";import{detectExplicitScope}from"./chunk-IIC2A4YN.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,getErrorRecovery,getExitCodeForReason,outputActionRequired,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getProjectByNameOrId}from"./chunk-U3NQZJQ4.js";import{ProjectNotFound,isAPIError}from"./chunk-XSDAUM4F.js";import{output_manager_default}from"./chunk-M774HRX5.js";function tracingErrorMessage(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function tracingErrorReason(err){let status=isAPIError(err)?err.status:void 0;return status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:status===429?AGENT_REASON.RATE_LIMITED:AGENT_REASON.API_ERROR}function handleTracingApiError(client,err){if(client.nonInteractive){let apiError=isAPIError(err)?err:void 0;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:tracingErrorReason(err),message:tracingErrorMessage(err),...apiError?.status===429&&getErrorRecovery(apiError,client)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(tracingErrorMessage(err)),1):(printError(err),1)}function configError(client,reason,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),getExitCodeForReason(reason)}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE,hint:"Link a project or pass --scope and --project.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"link this directory to a project"}]}),output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?{exitCode:invalidArguments(client,`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`)}:{teamId:link.org.id,projectId:link.project.id,projectName:link.project.name}}export{resolveScope,tracingErrorMessage,tracingErrorReason,handleTracingApiError,invalidArguments,ruleNotFound,confirmationRequired,resolveConfigScope};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption,limitOption,nextOption,projectOption,sinceOption,untilOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var typesSubcommand={name:"types",aliases:[],description:"List available event types with descriptions.",arguments:[],options:[formatOption,jsonOption],examples:[{name:"List all event types",value:`${packageName} activity types`},{name:"Output JSON",value:`${packageName} activity types --json`}]},activityCommand={name:"activity",aliases:[],description:"List user activity events.",arguments:[],subcommands:[{name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},typesSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by event type. Repeatable and comma-separated (e.g. --type deployment --type project-created or --type deployment,project-created)."},sinceOption,untilOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show all team events (ignore linked project auto-scoping)."},limitOption,nextOption,formatOption,jsonOption],examples:[{name:"List events for the linked project",value:`${packageName} activity`},{name:"Filter events by multiple types",value:`${packageName} activity --type deployment --type project-created --since 7d`},{name:"Filter events by comma-separated types",value:`${packageName} activity --type deployment,project-created --since 7d`},{name:"List all team events",value:`${packageName} activity --all --since 30d`},{name:"Output JSON",value:`${packageName} activity --json | jq '.events[]'`},{name:"List activity event types",value:`${packageName} activity types`}]};export{typesSubcommand,activityCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printProjectNotFoundError}from"./chunk-GCSAJUL6.js";import{performDeviceCodeFlow}from"./chunk-E6R2QOOR.js";import{param}from"./chunk-3G3FQYMW.js";import{detectExplicitScope}from"./chunk-IIC2A4YN.js";import{buildCommandWithYes,outputActionRequired}from"./chunk-BAT6SDBJ.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-U3NQZJQ4.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var parseEnv=env=>{if(!env)return{};if(typeof env=="string"&&(env=[env]),Array.isArray(env)){let startingDict={};return env.reduce((o,e)=>{let key,value,equalsSign=e.indexOf("=");return equalsSign===-1?key=e:(key=e.slice(0,equalsSign),value=e.slice(equalsSign+1)),o[key]=value,o},startingDict)}return env};async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId),1;if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-6AIRWXXX.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{getEnvRecords,pullEnvRecords,parseEnv,ensureLink};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{tracesConfigCommand}from"./chunk-J6O6JW2K.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:null,type:String,deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{name:"deployment-id",shorthand:null,type:String,deprecated:!1,description:"Filter by deployment ID"},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Fetch a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open. Only valid with --open. Defaults to timeline."}],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Fetch a trace without the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",value:`${packageName} traces search --next <cursor> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Fetch a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-NLCTF4EJ.js";import{tracesCommand}from"./chunk-ZBDLYNUF.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-J6O6JW2K.js";import"./chunk-BFRDBBSO.js";import"./chunk-2UMWTCY7.js";import"./chunk-Q5ZGA2RO.js";import"./chunk-UGMTKOTN.js";import"./chunk-UQIVF4Q2.js";import"./chunk-ITKS32PG.js";import"./chunk-7NNENHGN.js";import"./chunk-Y24OSBXP.js";import"./chunk-GVVIFYQE.js";import"./chunk-W3TGCMRW.js";import"./chunk-B4YYOSPY.js";import"./chunk-LD5U73LA.js";import"./chunk-VRWLNWNE.js";import"./chunk-TPVAPVQC.js";import"./chunk-JALVF3C2.js";import"./chunk-CMKLX4DC.js";import"./chunk-UCAE5Z5L.js";import{help}from"./chunk-H3KYG32S.js";import"./chunk-773GOZIR.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{TelemetryClient}from"./chunk-KUGXOLL7.js";import"./chunk-VKXEOL4K.js";import"./chunk-NWGBDBZI.js";import"./chunk-4SAVH3H7.js";import"./chunk-MI7W4QMV.js";import"./chunk-VKPZP4LC.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRm(actual){this.trackCliSubcommand({subcommand:"rm",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),rm:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,rm:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command){return output_manager_default.print(help(command,{parent:tracesCommand,columns:client.stderr.columns})),needHelp?0:2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),printHelp(actionMetadata||tracesConfigCommand);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-CGZ3NL5R.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-AJEMEBZU.js")).default(client);case"rm":return configTelemetry.trackCliSubcommandRm(actionOriginal),(await import("./rm-2TR2KBDP.js")).default(client);default:return printHelp(tracesConfigCommand)}}export{config as default};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoutes,withGlobalFlags}from"./chunk-ZVTI6BRR.js";import"./chunk-6ZRULOO3.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-GCSAJUL6.js";import{deleteSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-QAETJRKX.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes delete <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes delete <name-or-id> [...]")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
8
- `),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be deleted:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
9
- `)}if(output_manager_default.print(`
10
- `),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Deletion requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes delete ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Delete ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Deleting ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Deleted")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to delete routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to delete routes"),1}}export{deleteRoute as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-ZVTI6BRR.js";import"./chunk-6ZRULOO3.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-GCSAJUL6.js";import{disableSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-QAETJRKX.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import{outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
@@ -1,14 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,requireProjectContext,withGlobalFlags}from"./chunk-ZVTI6BRR.js";import"./chunk-6ZRULOO3.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-GCSAJUL6.js";import{discardSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-QAETJRKX.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import{outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
8
- ${import_chalk.default.bold("Changes to be discarded:")}
9
-
10
- `),printDiffSummary(changedRoutes),output_manager_default.print(`
11
- `)):output_manager_default.print(`
12
- ${import_chalk.default.gray("No changes detected in staging version.")}
13
-
14
- `),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-OXAPCSYY.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-ZVTI6BRR.js";import"./chunk-6ZRULOO3.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-GCSAJUL6.js";import{editSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-QAETJRKX.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import{outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0],{RoutesEditTelemetryClient}=await import("./routes-LK2HUGAK.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes update.",next:[{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes update <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full flags)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"retry with a unique name or id"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},2),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),2):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix flags per message; see routes update --help"}]},2),output_manager_default.error(error),2}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No update flags provided. In non-interactive mode pass flags such as --name, --src, --dest, --action, header flags, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes update --help"}],hint:"Run vercel routes update --help for all flag options."},2),output_manager_default.error(`No update flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes update --help")} for all options.`),2;if(output_manager_default.log(`
8
- Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to update this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes update <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-ZVTI6BRR.js";import"./chunk-6ZRULOO3.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-GCSAJUL6.js";import{enableSubcommand}from"./chunk-UQIVF4Q2.js";import"./chunk-Q7D7RGXM.js";import"./chunk-QAETJRKX.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import{outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function enable(client,argv){let parsed=await parseSubcommandArgs(argv,enableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes enable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes enable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --help"),when:"add routes first"}]},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled!==!1)return output_manager_default.log(`Route "${route.name}" is already enabled.`),0;let enableStamp=stamp_default();output_manager_default.spinner(`Enabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!0,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Enabled")} route "${route.name}" ${import_chalk.default.gray(enableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to enable route"},1),output_manager_default.error(error.message||"Failed to enable route"),1}}export{enable as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens}from"./chunk-E6R2QOOR.js";import"./chunk-PVASGBEF.js";import"./chunk-EVQJ7SCV.js";import"./chunk-QAETJRKX.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-PPCFQQSU.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{createCertForCns,require_cjs,setupDomain}from"./chunk-DNTQK2SW.js";import"./chunk-JV6IPUGX.js";import"./chunk-O4FDRZ22.js";import"./chunk-T3GQAMBJ.js";import"./chunk-A2RZZQEP.js";import"./chunk-3G3FQYMW.js";import"./chunk-Q7D7RGXM.js";import"./chunk-HVUJNVPS.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{InvalidDomain,NowError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_tldts=__toESM(require_cjs(),1);async function generateCertForDeploy(client,contextName,deployURL){let parsedDomain=(0,import_tldts.parse)(deployURL),{domain}=parsedDomain;if(!domain)return new InvalidDomain(deployURL);output_manager_default.spinner(`Setting custom suffix domain ${domain}`);let result=await setupDomain(client,domain,contextName);if(output_manager_default.stopSpinner(),result instanceof NowError)return result;output_manager_default.spinner(`Generating a wildcard certificate for ${domain}`);let cert=await createCertForCns(client,[domain,`*.${domain}`],contextName);if(output_manager_default.stopSpinner(),cert instanceof NowError)return cert}export{generateCertForDeploy as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var IMAGE_CONFIG={ls:["ls","list"],inspect:["inspect","get"],rm:["rm","remove","delete"]};async function image(client,argv,telemetry){let{subcommand,args}=getSubcommand(argv,IMAGE_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(IMAGE_CONFIG):`Unknown "vcr image" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image --help"),when:"Show valid image subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr image --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-A3HIPTF5.js")).default(client,args,telemetry);case"inspect":return(await import("./inspect-UNZR445S.js")).default(client,args,telemetry);case"rm":return(await import("./rm-IGY6LD6H.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled image subcommand: ${subcommand}`),1}}export{image as default};
@@ -1,13 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-RRWEIG6B.js";import{resolveAlertsScope}from"./chunk-WGOQGKS5.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{formatDate}from"./chunk-YTDK6AHS.js";import"./chunk-GZNDA6SV.js";import{outputError}from"./chunk-ZQKDO5PL.js";import"./chunk-GHAY4PSD.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{inspectSubcommand}from"./chunk-GVVIFYQE.js";import"./chunk-W3TGCMRW.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatted} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
8
- `)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
9
- `)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
10
-
11
- `):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
12
- `))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},2),printError(e),2}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveAlertsScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
13
- `):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,reason=err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403?{hint:"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}export{inspect as default};
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{renderThreadRow}from"./chunk-GNV6PG6W.js";import{handleCommentsParseError,inferBranch,listThreads,resolveCommentsScope}from"./chunk-ZLWTPS5T.js";import{handleValidationError,outputError,validateIntegerRangeWithDefault}from"./chunk-ZQKDO5PL.js";import"./chunk-F4KY2TOK.js";import"./chunk-ID663OJ7.js";import"./chunk-6ZRULOO3.js";import"./chunk-GCSAJUL6.js";import{listSubcommand}from"./chunk-7NNENHGN.js";import"./chunk-QAETJRKX.js";import"./chunk-BS32OUOC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{getScope}from"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import{getFlagsSpecification,stripSensitiveAuthArgs}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function validateStatus(value){let status=value??"unresolved";if(["unresolved","resolved","all"].includes(status))return status}async function resolveAuthors(client,authors,jsonOutput){if(!authors||authors.length===0)return;if(!authors.includes("me"))return authors;let{user}=await getScope(client);return user?authors.map(author=>author==="me"?user.id:author):outputError(client,jsonOutput,"USER_REQUIRED","Can't resolve `--author me` when authenticated as an app. Use an author ID with `--author`, or authenticate with a user token.")}function statusWord(status){return status==="all"?"":` ${status}`}function printActiveFilters(flags){let parts=[];flags["--author"]?.length&&parts.push(`--author ${flags["--author"].join(", ")} (takes a user ID or \`me\` \u2014 usernames match nothing)`);let pagePaths=flags["--page-path"]??flags["--page"];pagePaths?.length&&parts.push(`--page-path ${pagePaths.join(", ")}`),flags["--search"]&&parts.push(`--search ${flags["--search"]}`),flags["--content-id"]?.length&&parts.push(`--content-id ${flags["--content-id"].join(", ")}`),parts.length>0&&output_manager_default.log(`Filters: ${parts.join(" \xB7 ")}`)}function countLine(count,status){return`${count}${statusWord(status)} comment${count===1?"":"s"}`}var SCOPE_FLAG_NAMES=new Set(["--scope","-S","--project","-p","--team","-T"]);function argvFlagTokens(client){return stripSensitiveAuthArgs(client.argv.slice(3))}function scopeFlagsSuffix(client){let tokens=argvFlagTokens(client),out=[];for(let i=0;i<tokens.length;i++){let token=tokens[i],name=token.split("=")[0];SCOPE_FLAG_NAMES.has(name)&&(out.push(token),!token.includes("=")&&i+1<tokens.length&&out.push(tokens[++i]))}return out.length>0?` ${out.join(" ")}`:""}function nextPageFlagsSuffix(client){let tokens=argvFlagTokens(client),out=[];for(let i=0;i<tokens.length;i++){let token=tokens[i];if(!token.startsWith("-"))continue;let name=token.split("=")[0];if(name==="--next"||name==="-N"){!token.includes("=")&&i+1<tokens.length&&i++;continue}out.push(name==="--page"?token.replace(/^--page(?==|$)/,"--page-path"):token),!token.includes("=")&&i+1<tokens.length&&!tokens[i+1].startsWith("-")&&out.push(tokens[++i])}return out.length>0?` ${out.join(" ")}`:""}function shellSafe(value){return/^[A-Za-z0-9._/-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}async function printEmptyState(client,scope,focus,params,status,flags){let probe;try{probe=await listThreads(client,scope.teamId,{...params,branch:void 0,cursor:void 0,limit:20})}catch{output_manager_default.log(`No${statusWord(status)} comments on ${focus.value}.`);return}let branches=new Map;for(let thread of probe.threads){let branch=thread.branch??"(no branch)";branches.set(branch,(branches.get(branch)??0)+1)}if(branches.size===0){output_manager_default.log(`No${statusWord(status)} comments in ${scope.projectName??"this project"} on any branch.`),printActiveFilters(flags);return}output_manager_default.log(`No${statusWord(status)} comments on ${focus.value}.`);let suffix=probe.pagination.nextCursor?"+":"",scopeSuffix=scopeFlagsSuffix(client);if(branches.size===1){let[branch,count]=[...branches.entries()][0];output_manager_default.log(`${count}${suffix}${statusWord(status)} on ${import_chalk.default.bold(branch)} \u2014 run ${getCommandName(`comments --branch ${shellSafe(branch)}${scopeSuffix}`)}`);return}let total=[...branches.values()].reduce((a,b)=>a+b,0);output_manager_default.log(`${total}${suffix}${statusWord(status)} on other branches \u2014 run ${getCommandName(`comments --all-branches${scopeSuffix}`)}`)}async function list(client,telemetry,defaultInvocation){let parsedArgs,flagsSpecification=getFlagsSpecification(listSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"list")}let flags=parsedArgs.flags,pagePaths=flags["--page-path"]??flags["--page"],expectedPositionals=defaultInvocation?1:2;if(parsedArgs.args.length>expectedPositionals)return output_manager_default.error(`Unknown ${defaultInvocation?"subcommand":"argument"} "${parsedArgs.args[expectedPositionals]}". Run \`vercel comments --help\` for usage.`),1;let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionProject(flags["--project"]),telemetry.trackCliOptionBranch(flags["--branch"]),telemetry.trackCliFlagAllBranches(flags["--all-branches"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliOptionPagePath(flags["--page-path"]),telemetry.trackCliOptionPage(flags["--page"]),telemetry.trackCliOptionAuthor(flags["--author"]),telemetry.trackCliOptionContentId(flags["--content-id"]),telemetry.trackCliOptionSearch(flags["--search"]),telemetry.trackCliOptionLimit(flags["--limit"]),telemetry.trackCliOptionNext(flags["--next"]),telemetry.trackCliOptionFormat(flags["--format"]);let status=validateStatus(flags["--status"]);if(!status)return outputError(client,jsonOutput,"INVALID_STATUS",`Invalid --status "${flags["--status"]}". Valid values: unresolved, resolved, all.`);let limitResult=validateIntegerRangeWithDefault(flags["--limit"],{flag:"--limit",min:1,max:100,defaultValue:20});if(!limitResult.valid)return handleValidationError(limitResult,jsonOutput,client);if(flags["--branch"]&&flags["--all-branches"])return outputError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --branch and --all-branches.");let scope=await resolveCommentsScope(client,{project:flags["--project"],requireProject:!0,jsonOutput});if(typeof scope=="number")return scope;let focus,branchFilter;if(flags["--branch"]&&flags["--branch"].length>0)branchFilter=flags["--branch"],focus={value:branchFilter.join(", "),source:"flag"};else if(!flags["--all-branches"]&&scope.linked){let inferred=inferBranch(client.cwd);inferred&&(focus=inferred,branchFilter=[inferred.value])}let authors=await resolveAuthors(client,flags["--author"],jsonOutput);if(typeof authors=="number")return authors;let params={projectId:scope.projectId,branch:branchFilter,status:status==="all"?void 0:status,page:pagePaths,author:authors,contentId:flags["--content-id"],search:flags["--search"],limit:limitResult.value,cursor:flags["--next"]};jsonOutput||output_manager_default.spinner("Fetching comments\u2026");let response;try{response=await listThreads(client,scope.teamId,params)}catch(err){if(isAPIError(err))return outputError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}finally{output_manager_default.stopSpinner()}let threads=response.threads??[],nextCursor=response.pagination?.nextCursor??null;if(jsonOutput){let envelope={scope:{teamId:scope.teamId,...scope.teamSlug&&{teamSlug:scope.teamSlug},...scope.projectId&&{projectId:scope.projectId},...scope.projectName&&{projectName:scope.projectName},...focus&&focus.source!=="flag"&&{inferredBranch:focus.value}},filters:{...status!=="all"&&{status},...focus&&{branch:{value:focus.value,source:focus.source}}},pagination:{nextCursor},threads};return client.stdout.write(`${JSON.stringify(envelope,null,2)}
8
- `),0}let branchLabel=focus?focus.value:"all branches";if(output_manager_default.log(`Comments in ${import_chalk.default.bold(scope.projectName??scope.projectId??"")} \xB7 ${branchLabel}`),threads.length===0)return focus?await printEmptyState(client,scope,focus,params,status,flags):(output_manager_default.log(`No${statusWord(status)} comments in ${scope.projectName??"this project"}.`),printActiveFilters(flags)),0;output_manager_default.print(`
9
- `);for(let thread of threads)output_manager_default.print(`${renderThreadRow(thread,{showBranch:!focus})}
10
-
11
- `);return output_manager_default.log(countLine(threads.length,status)),output_manager_default.log(`To read a thread, run ${getCommandName(`comments inspect <id>${scopeFlagsSuffix(client)}`)}`),nextCursor&&output_manager_default.log(`To display the next page, run ${getCommandName(`comments${nextPageFlagsSuffix(client)} --next ${nextCursor}`)}`),0}export{list as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{login}from"./chunk-AA434KXY.js";import"./chunk-E6R2QOOR.js";import"./chunk-PVASGBEF.js";import"./chunk-B4YYOSPY.js";import"./chunk-EVQJ7SCV.js";import"./chunk-H3KYG32S.js";import"./chunk-773GOZIR.js";import"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-KUGXOLL7.js";import"./chunk-VKXEOL4K.js";import"./chunk-NWGBDBZI.js";import"./chunk-4SAVH3H7.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{login as default};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{collectBuildLogs,displayBuildLogs,displayBuildLogsUntilFinalError,parseLogLines}from"./chunk-TDDZGUU6.js";import"./chunk-AQUDXMFH.js";import"./chunk-O4FDRZ22.js";import"./chunk-IVIZLWZQ.js";import"./chunk-HVUJNVPS.js";import"./chunk-BS32OUOC.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{collectBuildLogs,displayBuildLogs,displayBuildLogsUntilFinalError,parseLogLines};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printRules}from"./chunk-QCWV7FML.js";import"./chunk-RRWEIG6B.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,parseRulesFlagsAndScope,rulesCollectionPath}from"./chunk-AALI66ML.js";import"./chunk-WGOQGKS5.js";import"./chunk-YTDK6AHS.js";import"./chunk-GZNDA6SV.js";import{normalizeRepeatableStringFilters}from"./chunk-ZQKDO5PL.js";import"./chunk-GHAY4PSD.js";import"./chunk-6HOVHRWJ.js";import"./chunk-O4FDRZ22.js";import"./chunk-T3GQAMBJ.js";import"./chunk-P2O5DOYE.js";import"./chunk-ID663OJ7.js";import{rulesLsSubcommand}from"./chunk-W3TGCMRW.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var BUILT_IN_ALERT_TYPES=["usage_anomaly","error_anomaly","botId_anomaly","firewallSystemRule_anomaly","firewallCustomRule_anomaly","testAlert_anomaly","buildTime_anomaly"];var BUILT_IN_ALERT_TYPE_SET=new Set(BUILT_IN_ALERT_TYPES);function parseRuleTypeFilter(client,values,jsonOutput){let types=normalizeRepeatableStringFilters(values);if(types.length===0)return;let invalidType=types.find(type=>type!=="built-in"&&type!=="custom"&&type!=="custom_alert"&&!BUILT_IN_ALERT_TYPE_SET.has(type));if(invalidType)return outputRulesError(client,jsonOutput,"INVALID_RULE_TYPE",`Invalid rule type "${invalidType}". Expected a supported rule type or built-in trigger type.`);let includeCustom=types.includes("custom")||types.includes("custom_alert"),includeAllBuiltIn=types.includes("built-in"),builtInAlertTypes=new Set(types.filter(type=>BUILT_IN_ALERT_TYPE_SET.has(type))),includeBuiltIn=includeAllBuiltIn||builtInAlertTypes.size>0;return{apiType:includeCustom===includeBuiltIn?void 0:includeCustom?"custom":"built-in",matches(rule){return rule.type==="custom"?includeCustom:includeAllBuiltIn?!0:includeBuiltIn?rule.triggers.mode==="all"?!0:rule.triggers.items.some(trigger=>builtInAlertTypes.has(trigger.type)):!1}}}async function ls(client,argv){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(rulesLsSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"alerts rules ls --project <name-or-id>"),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let typeFilter=parseRuleTypeFilter(client,flags["--type"],format.jsonOutput);if(typeof typeFilter=="number")return typeFilter;let scope=await parseRulesFlagsAndScope(client,{"--project":flags["--project"],"--all":flags["--all"]},format.jsonOutput,"alerts rules ls");if(typeof scope=="number")return scope;output_manager_default.spinner("Fetching alert rules\u2026");try{let rules=[],cursor;do{let page=await client.fetch(rulesCollectionPath(scope.teamId,{limit:100,cursor,projectId:scope.projectId,type:typeFilter?.apiType}));rules.push(...page.rules),cursor=page.pagination.next??void 0}while(cursor);let filteredRules=typeFilter?rules.filter(typeFilter.matches):rules;return format.jsonOutput?client.stdout.write(`${JSON.stringify({rules:filteredRules},null,2)}
8
- `):filteredRules.length===0?output_manager_default.log("No alert rules found for this scope"):printRules(filteredRules),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{ls as default};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{repositoryImagesPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatDigest,formatImageStatus,formatRelativeTime,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-IYCHAIFZ.js";import{outputError,validateOptionalIntegerRange}from"./chunk-ZQKDO5PL.js";import"./chunk-KKCBFBJK.js";import{imageLsSubcommand}from"./chunk-2UMWTCY7.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{table}from"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import{AGENT_REASON,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatType(kind){return kind==="index"?"Index":"Image"}function printImages(list){if(list.images.length===0){output_manager_default.log("No images found.");return}let rows=[["Image ID","Digest","Tags","Type","Status","Arch","Size","Created"].map(h=>import_chalk.default.cyan(h)),...list.images.map(image=>[import_chalk.default.bold(image.id),import_chalk.default.dim(formatDigest(image.manifestDigest)),image.tags.length>0?image.tags.join(", "):import_chalk.default.dim("<none>"),formatType(image.kind),formatImageStatus(image.status),image.arch??"-",formatBytes(image.sizeInBytes),formatRelativeTime(image.createdAt)])],tableOutput=table(rows,{hsep:3}).split(`
8
- `).map(line=>line.trimEnd()).join(`
9
- `).replace(/^/gm," ");output_manager_default.print(`
10
- ${tableOutput}
11
- `),list.nextCursor&&output_manager_default.log(`More results available. Re-run with \`--next ${list.nextCursor}\`.`)}async function ls(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(imageLsSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr image ls <repository> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],cursor=parsedArgs.flags["--next"]??parsedArgs.flags["--cursor"],limitFlag=parsedArgs.flags["--limit"],untagged=parsedArgs.flags["--untagged"];telemetry.trackCliOptionProject(project),telemetry.trackCliOptionLimit(limitFlag),telemetry.trackCliOptionNext(parsedArgs.flags["--next"]),telemetry.trackCliOptionCursor(parsedArgs.flags["--cursor"]),telemetry.trackCliFlagUntagged(untagged),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr image ls <repository>");if(typeof missingRepository=="number")return missingRepository;let limitResult=validateOptionalIntegerRange(limitFlag,{flag:"--limit",min:1,max:100});if(!limitResult.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:limitResult.message},2),outputError(client,fr.jsonOutput,limitResult.code,limitResult.message);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryImagesPath(scope,repository,{limit:limitResult.value,cursor,untagged});output_manager_default.spinner("Fetching images...");try{let list=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify(list,null,2)}
12
- `):printImages(list),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{ls as default};
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printRuleNotifications,printRulesNotifications}from"./chunk-G2IJOQR3.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,resolveRulesTeam,ruleNotificationsPath,rulesNotificationsPath}from"./chunk-AALI66ML.js";import"./chunk-WGOQGKS5.js";import"./chunk-ZQKDO5PL.js";import"./chunk-6HOVHRWJ.js";import"./chunk-O4FDRZ22.js";import"./chunk-T3GQAMBJ.js";import"./chunk-P2O5DOYE.js";import{rulesNotificationsLsSubcommand}from"./chunk-W3TGCMRW.js";import{printError}from"./chunk-QAETJRKX.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import{AGENT_STATUS,buildCommandWithGlobalFlags,quoteArg}from"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var PAGE_LIMIT=100;async function fetchRulesNotifications(client,teamId){let notifications={},cursor;do{let page=await client.fetch(rulesNotificationsPath(teamId,{limit:PAGE_LIMIT,cursor}));Object.assign(notifications,page.notifications),cursor=page.pagination.next??void 0}while(cursor);return{notifications}}async function ls(client,argv){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(rulesNotificationsLsSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"alerts rules notifications [rule-id]"),printError(error),2}let format=validateJsonOutput(parsedArgs.flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let[ruleId,extraArg]=parsedArgs.args;if(extraArg)return outputRulesError(client,format.jsonOutput,"INVALID_ARGUMENTS","Expected exactly one rule ID.");let scope=await resolveRulesTeam(client,format.jsonOutput);if(typeof scope=="number")return scope;client.nonInteractive||output_manager_default.spinner(ruleId?"Fetching notification destinations\u2026":"Fetching alert rule notification destinations\u2026");try{if(!ruleId){let result=await fetchRulesNotifications(client,scope.teamId);if(client.nonInteractive){let ruleCount=Object.keys(result.notifications).length,notificationCount=Object.values(result.notifications).reduce((count,notifications)=>count+notifications.length,0);client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,...result,message:`Listed ${notificationCount} notification destination${notificationCount===1?"":"s"} across ${ruleCount} readable alert rule${ruleCount===1?"":"s"}.`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules notifications link <rule-id> --slack-channel <channel-id> --slack-installation-id <installation-id>"),when:"Link a Slack channel to a rule"},{command:buildCommandWithGlobalFlags(client.argv,"alerts rules notifications link <rule-id> --webhook <webhook-id>"),when:"Link an account webhook to a rule"}]},null,2)}
8
- `)}else format.jsonOutput?client.stdout.write(`${JSON.stringify(result,null,2)}
9
- `):printRulesNotifications(result);return 0}let response=await client.fetch(ruleNotificationsPath(scope.teamId,ruleId));if(client.nonInteractive){let count=response.notifications.length;client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,ruleId,notifications:response.notifications,message:`${count} notification destination${count===1?"":"s"} linked to alert rule ${ruleId}.`,next:[{command:buildCommandWithGlobalFlags(client.argv,`alerts rules notifications link ${quoteArg(ruleId)} --webhook <webhook-id>`),when:"Link an account webhook"},{command:buildCommandWithGlobalFlags(client.argv,`alerts rules notifications link ${quoteArg(ruleId)} --slack-channel <channel-id>`),when:"Link a Slack channel"}]},null,2)}
10
- `)}else format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
11
- `):printRuleNotifications(ruleId,response.notifications);return 0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{client.nonInteractive||output_manager_default.stopSpinner()}}export{ls as default};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{repositoriesPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatRelativeTime,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-IYCHAIFZ.js";import{outputError,validateOptionalIntegerRange}from"./chunk-ZQKDO5PL.js";import"./chunk-KKCBFBJK.js";import{listSubcommand}from"./chunk-BFRDBBSO.js";import"./chunk-2UMWTCY7.js";import"./chunk-Q5ZGA2RO.js";import"./chunk-UGMTKOTN.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{table}from"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import{AGENT_REASON,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function printRepositories(list){if(list.repositories.length===0){output_manager_default.log("No repositories found.");return}let rows=[["Name","ID","Created"].map(h=>import_chalk.default.cyan(h)),...list.repositories.map(repo=>[import_chalk.default.bold(repo.name),import_chalk.default.dim(repo.id),formatRelativeTime(repo.createdAt)])],tableOutput=table(rows,{hsep:3}).split(`
8
- `).map(line=>line.trimEnd()).join(`
9
- `).replace(/^/gm," ");output_manager_default.print(`
10
- ${tableOutput}
11
- `),list.nextCursor&&output_manager_default.log(`More results available. Re-run with \`--next ${list.nextCursor}\`.`)}async function ls(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(listSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr ls --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let project=parsedArgs.flags["--project"],cursor=parsedArgs.flags["--next"]??parsedArgs.flags["--cursor"],limitFlag=parsedArgs.flags["--limit"];telemetry.trackCliOptionProject(project),telemetry.trackCliOptionLimit(limitFlag),telemetry.trackCliOptionNext(parsedArgs.flags["--next"]),telemetry.trackCliOptionCursor(parsedArgs.flags["--cursor"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let limitResult=validateOptionalIntegerRange(limitFlag,{flag:"--limit",min:1,max:100});if(!limitResult.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:limitResult.message},2),outputError(client,fr.jsonOutput,limitResult.code,limitResult.message);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoriesPath(scope,{limit:limitResult.value,cursor});output_manager_default.spinner("Fetching repositories...");try{let list=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify(list,null,2)}
12
- `):printRepositories(list),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{ls as default};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{repositoryTagsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatDigest,formatRelativeTime,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrChoice,validateVcrJsonOutput}from"./chunk-IYCHAIFZ.js";import{outputError,validateOptionalIntegerRange}from"./chunk-ZQKDO5PL.js";import"./chunk-KKCBFBJK.js";import{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand}from"./chunk-UGMTKOTN.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{table}from"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-D4MW3RDW.js";import"./chunk-IIC2A4YN.js";import"./chunk-MV4WHUIC.js";import"./chunk-VKXEOL4K.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-ZS2WS4AM.js";import"./chunk-AOWWC6WZ.js";import"./chunk-MY4MONOH.js";import{parseArguments}from"./chunk-ELDHGU6N.js";import{AGENT_REASON,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import"./chunk-U3NQZJQ4.js";import"./chunk-ROPQIBWJ.js";import"./chunk-VKPZP4LC.js";import"./chunk-PPCFQQSU.js";import"./chunk-IJCCFLCQ.js";import"./chunk-ZQME5XUJ.js";import"./chunk-2VBFQZ72.js";import{isAPIError}from"./chunk-XSDAUM4F.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function printTags(list){if(list.tags.length===0){output_manager_default.log("No tags found.");return}let rows=[["Tag","Image ID","Digest","Arch","Size","Created"].map(h=>import_chalk.default.cyan(h)),...list.tags.map(tag=>[import_chalk.default.bold(tag.tag),import_chalk.default.dim(tag.imageId),import_chalk.default.dim(formatDigest(tag.manifestDigest)),tag.arch??"-",formatBytes(tag.sizeInBytes),formatRelativeTime(tag.createdAt)])],tableOutput=table(rows,{hsep:3}).split(`
8
- `).map(line=>line.trimEnd()).join(`
9
- `).replace(/^/gm," ");output_manager_default.print(`
10
- ${tableOutput}
11
- `),list.nextCursor&&output_manager_default.log(`More results available. Re-run with \`--next ${list.nextCursor}\`.`)}async function ls(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(tagsLsSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr tag ls <repository> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],cursor=parsedArgs.flags["--next"]??parsedArgs.flags["--cursor"],limitFlag=parsedArgs.flags["--limit"],sortBy=parsedArgs.flags["--sort-by"],sortOrder=parsedArgs.flags["--sort-order"];telemetry.trackCliOptionProject(project),telemetry.trackCliOptionLimit(limitFlag),telemetry.trackCliOptionNext(parsedArgs.flags["--next"]),telemetry.trackCliOptionCursor(parsedArgs.flags["--cursor"]),telemetry.trackCliOptionSortBy(sortBy),telemetry.trackCliOptionSortOrder(sortOrder),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr tag ls <repository>");if(typeof missingRepository=="number")return missingRepository;let limitResult=validateOptionalIntegerRange(limitFlag,{flag:"--limit",min:1,max:100});if(!limitResult.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:limitResult.message},2),outputError(client,fr.jsonOutput,limitResult.code,limitResult.message);let sortByError=validateVcrChoice(client,"--sort-by",sortBy,TAGS_SORT_BY_CHOICES,fr.jsonOutput);if(typeof sortByError=="number")return sortByError;let sortOrderError=validateVcrChoice(client,"--sort-order",sortOrder,TAGS_SORT_ORDER_CHOICES,fr.jsonOutput);if(typeof sortOrderError=="number")return sortOrderError;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryTagsPath(scope,repository,{limit:limitResult.value,cursor,sortBy,sortOrder});output_manager_default.spinner("Fetching tags...");try{let list=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify(list,null,2)}
12
- `):printTags(list),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{ls as default};