vercel 64.0.2 → 64.2.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 (165) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/{add-XUNOIBOU.js → add-IATD2WUV.js} +1 -1
  3. package/dist/chunks/{add-BXOEELS6.js → add-UPXURHDI.js} +1 -1
  4. package/dist/chunks/{add-FZLHLH56.js → add-WVK3AP46.js} +1 -1
  5. package/dist/chunks/{build-PCEPD6N5.js → build-JOGD3ZEF.js} +1 -1
  6. package/dist/chunks/{chunk-RZGWCQP7.js → chunk-2FHICLHJ.js} +1 -1
  7. package/dist/chunks/{chunk-AG5QQNJ3.js → chunk-2UMWTCY7.js} +1 -1
  8. package/dist/chunks/{chunk-OZ47SVXA.js → chunk-3EU7MN5M.js} +1 -1
  9. package/dist/chunks/{chunk-37QGCN6P.js → chunk-3GSGG4YR.js} +1 -1
  10. package/dist/chunks/{chunk-YCQFJOHY.js → chunk-4BS552UW.js} +5 -2
  11. package/dist/chunks/{chunk-FO7MV3VE.js → chunk-4GL254L4.js} +1 -1
  12. package/dist/chunks/{chunk-34ZJMN36.js → chunk-4IIRQJUW.js} +1 -1
  13. package/dist/chunks/{chunk-K6BJ5GVA.js → chunk-4TTF5E5U.js} +3 -3
  14. package/dist/chunks/{chunk-BDFUWXIX.js → chunk-4VEK7DEH.js} +1 -1
  15. package/dist/chunks/{chunk-X33ZHJ45.js → chunk-5JEU6QSM.js} +1 -1
  16. package/dist/chunks/{chunk-NFJPCOTV.js → chunk-7BOCT55A.js} +1 -1
  17. package/dist/chunks/{chunk-BZ3YIITB.js → chunk-7C6BXZCV.js} +1 -1
  18. package/dist/chunks/{chunk-4R32LMIV.js → chunk-AKM22FBX.js} +1 -1
  19. package/dist/chunks/chunk-BTCKMXWW.js +7 -0
  20. package/dist/chunks/{chunk-MYCQIZU6.js → chunk-CN3IVZJO.js} +1 -1
  21. package/dist/chunks/{chunk-Z4OH72VZ.js → chunk-CRQDQNQZ.js} +1 -1
  22. package/dist/chunks/chunk-EEZLBOSP.js +14 -0
  23. package/dist/chunks/{chunk-WHVT7UXE.js → chunk-EF3YL2R7.js} +1 -1
  24. package/dist/chunks/{chunk-GNKUINRV.js → chunk-EKUHN42H.js} +1 -1
  25. package/dist/chunks/{chunk-S2JJZDW6.js → chunk-FGNMYSLD.js} +2 -2
  26. package/dist/chunks/{chunk-IUF3I4BN.js → chunk-FTY4BCAF.js} +1 -1
  27. package/dist/chunks/{chunk-RNF5CSW6.js → chunk-GSVOI5LW.js} +1 -1
  28. package/dist/chunks/{chunk-IVSKWN3O.js → chunk-GUJVJKO7.js} +1 -1
  29. package/dist/chunks/{chunk-CNU4T7FO.js → chunk-GVVIFYQE.js} +1 -1
  30. package/dist/chunks/{chunk-Z6HYEIYV.js → chunk-HAVEFTOO.js} +1 -1
  31. package/dist/chunks/{chunk-WJ5GXTPJ.js → chunk-I62UUYTS.js} +1 -1
  32. package/dist/chunks/{chunk-FECLYNNO.js → chunk-IRJ5XFT2.js} +2 -2
  33. package/dist/chunks/{chunk-QJKJBD2M.js → chunk-ITKS32PG.js} +1 -1
  34. package/dist/chunks/{chunk-ZYTRVEE3.js → chunk-J3CDVZE7.js} +1 -1
  35. package/dist/chunks/{chunk-UFXKCETS.js → chunk-J6O6JW2K.js} +1 -1
  36. package/dist/chunks/chunk-JEPRHNQU.js +7 -0
  37. package/dist/chunks/{chunk-TNZMCRAP.js → chunk-JNJOUMGF.js} +1 -1
  38. package/dist/chunks/{chunk-KLH6NMWT.js → chunk-KLYIX4HK.js} +3 -3
  39. package/dist/chunks/{chunk-QYDG63GL.js → chunk-KUGY5FIM.js} +1 -1
  40. package/dist/chunks/{chunk-JLXG2XWW.js → chunk-LD5U73LA.js} +1 -1
  41. package/dist/chunks/{chunk-MJD6WHG4.js → chunk-LLPIBKFX.js} +1 -1
  42. package/dist/chunks/{chunk-5IPBCD7K.js → chunk-MI7W4QMV.js} +1 -1
  43. package/dist/chunks/{chunk-Q7CITIB3.js → chunk-N5D4455C.js} +1 -1
  44. package/dist/chunks/{chunk-ASU72O2R.js → chunk-N6ECEBHG.js} +1 -1
  45. package/dist/chunks/{chunk-HKHQBR4Y.js → chunk-NBABZO3A.js} +1 -1
  46. package/dist/chunks/{chunk-YYPNUQDI.js → chunk-NWGBDBZI.js} +1 -1
  47. package/dist/chunks/{chunk-4CDUQXUK.js → chunk-O7JMHULU.js} +1 -1
  48. package/dist/chunks/{chunk-KLZZRZPR.js → chunk-OLWE4UFC.js} +1 -1
  49. package/dist/chunks/{chunk-FIIHB66A.js → chunk-PAN6TUTQ.js} +1 -1
  50. package/dist/chunks/chunk-Q5ZGA2RO.js +7 -0
  51. package/dist/chunks/{chunk-TMMEVR3B.js → chunk-QDOYNWNQ.js} +1 -1
  52. package/dist/chunks/{chunk-RELWXDML.js → chunk-QL3IYPBV.js} +1 -1
  53. package/dist/chunks/chunk-RIDPB64C.js +10 -0
  54. package/dist/chunks/{chunk-P4YB5FAK.js → chunk-SGXN7SMU.js} +1 -1
  55. package/dist/chunks/{chunk-OIB6INSE.js → chunk-SQB4T5FL.js} +1 -1
  56. package/dist/chunks/{chunk-TYTNF34C.js → chunk-SRAC7DI4.js} +1 -1
  57. package/dist/chunks/{chunk-MYX5A5KF.js → chunk-THZR6O2M.js} +1 -1
  58. package/dist/chunks/{chunk-S7XZC23O.js → chunk-TPVAPVQC.js} +1 -1
  59. package/dist/chunks/{chunk-G6B6TVAE.js → chunk-TWKII7HO.js} +1 -1
  60. package/dist/chunks/{chunk-ZEQLYYUJ.js → chunk-TY4PMK7Y.js} +1 -1
  61. package/dist/chunks/{chunk-GRTIWUV2.js → chunk-UCAE5Z5L.js} +1 -1
  62. package/dist/chunks/{chunk-L5FUUGYX.js → chunk-UGMTKOTN.js} +1 -1
  63. package/dist/chunks/{chunk-GHVWBHMT.js → chunk-UJUNGWSD.js} +1 -1
  64. package/dist/chunks/{chunk-QADFMDEL.js → chunk-VURCIZKT.js} +1 -1
  65. package/dist/chunks/chunk-W3TGCMRW.js +9 -0
  66. package/dist/chunks/{chunk-6LXX5P3A.js → chunk-WE3ZJX7P.js} +1 -1
  67. package/dist/chunks/{chunk-7C2QFD5D.js → chunk-WIAAACUI.js} +1 -1
  68. package/dist/chunks/{chunk-RG4ARRCN.js → chunk-WVJYKHGZ.js} +1 -1
  69. package/dist/chunks/{chunk-OAOSM4JQ.js → chunk-WW4VUFHJ.js} +1 -1
  70. package/dist/chunks/{chunk-ZV2YYRGF.js → chunk-WZ7YJDKT.js} +1 -1
  71. package/dist/chunks/{chunk-I3D36ZLJ.js → chunk-X65QKYDM.js} +1 -1
  72. package/dist/chunks/chunk-XSVF2CZM.js +8 -0
  73. package/dist/chunks/{chunk-2JBVMF2Y.js → chunk-Y24OSBXP.js} +1 -1
  74. package/dist/chunks/{chunk-JNPG7MVL.js → chunk-YDM2PMMP.js} +1 -1
  75. package/dist/chunks/{chunk-P2DETVWN.js → chunk-YO4VLAB7.js} +1 -1
  76. package/dist/chunks/{chunk-VYC3AMWW.js → chunk-YP46QVEI.js} +1 -1
  77. package/dist/chunks/{chunk-3AVG55SO.js → chunk-ZBDLYNUF.js} +1 -1
  78. package/dist/chunks/{clear-MO5T5MPM.js → clear-FNH7KUCF.js} +1 -1
  79. package/dist/chunks/{compile-vercel-config-PB3PBGGE.js → compile-vercel-config-4LNHE3YV.js} +1 -1
  80. package/dist/chunks/{config-63EI73DZ.js → config-JEHKUQMZ.js} +1 -1
  81. package/dist/chunks/{config-KZTDW2QM.js → config-W3TVZPSK.js} +1 -1
  82. package/dist/chunks/{delete-2UDSDSP4.js → delete-HCZA6EVL.js} +1 -1
  83. package/dist/chunks/{delete-UB32CPKH.js → delete-LV744KVD.js} +1 -1
  84. package/dist/chunks/{detect-services-WGEJOZNA.js → detect-services-TVZ4HYVB.js} +1 -1
  85. package/dist/chunks/{disable-JIJU4GNV.js → disable-N7WZSMD4.js} +1 -1
  86. package/dist/chunks/{discard-O65PEVZT.js → discard-2DN52DNW.js} +1 -1
  87. package/dist/chunks/{edit-L4FF6DXN.js → edit-CALU7PMG.js} +1 -1
  88. package/dist/chunks/{edit-KWWBA2X3.js → edit-MGJWXNFV.js} +1 -1
  89. package/dist/chunks/{enable-S62D7E5S.js → enable-7GKPLJNR.js} +1 -1
  90. package/dist/chunks/{export-OZ4RCU45.js → export-BSOJAVDV.js} +1 -1
  91. package/dist/chunks/{future-MDYFVS3M.js → future-OV5I5HWT.js} +1 -1
  92. package/dist/chunks/{generate-cert-for-deploy-S5NMGXYT.js → generate-cert-for-deploy-GKQRQ3ZQ.js} +1 -1
  93. package/dist/chunks/{image-OFC55KW4.js → image-NMQWZBTW.js} +1 -1
  94. package/dist/chunks/{import-builders-QHBL27W6.js → import-builders-WLKZNPTB.js} +1 -1
  95. package/dist/chunks/{inspect-XP5PASNY.js → inspect-LF3DIZZ2.js} +1 -1
  96. package/dist/chunks/{inspect-35NUO5W2.js → inspect-LZJ5X3PH.js} +1 -1
  97. package/dist/chunks/{inspect-BNXHORO6.js → inspect-PV6VVAN6.js} +1 -1
  98. package/dist/chunks/{inspect-WCNQQI76.js → inspect-UEDFNY5H.js} +1 -1
  99. package/dist/chunks/{inspect-IXITCFX4.js → inspect-V7M3GSZ7.js} +1 -1
  100. package/dist/chunks/{list-NJ42HMZJ.js → list-64R2DNZA.js} +1 -1
  101. package/dist/chunks/{list-OQOQNY3M.js → list-AFVTD43R.js} +1 -1
  102. package/dist/chunks/{list-5FOC7RBS.js → list-QTTCSTZA.js} +1 -1
  103. package/dist/chunks/{login-X7K2C7IO.js → login-OS6DZT32.js} +1 -1
  104. package/dist/chunks/{login-LGUJR7CK.js → login-SKIDVUB7.js} +1 -1
  105. package/dist/chunks/{logs-EH3XT4WK.js → logs-6AXWBF4D.js} +1 -1
  106. package/dist/chunks/{ls-3M5GSH6T.js → ls-5TZIOB3Q.js} +1 -1
  107. package/dist/chunks/{ls-MCI6TODA.js → ls-723HTK5U.js} +1 -1
  108. package/dist/chunks/{ls-D66KXCEQ.js → ls-A5A3APRI.js} +1 -1
  109. package/dist/chunks/{ls-GG4RSGA4.js → ls-EADWIBEQ.js} +1 -1
  110. package/dist/chunks/{ls-72Y3CWNF.js → ls-UP6KDPCD.js} +1 -1
  111. package/dist/chunks/{ls-EYG5GFIX.js → ls-WSPWJDWP.js} +1 -1
  112. package/dist/chunks/{ls-5SSERJCY.js → ls-YPQ3CTTN.js} +1 -1
  113. package/dist/chunks/{mutate-VM3WSWZD.js → mutate-WHVA5NTT.js} +1 -1
  114. package/dist/chunks/{notifications-T4QZSK34.js → notifications-I4PKIOYY.js} +1 -1
  115. package/dist/chunks/{open-2TSWF7N6.js → open-SV3USET3.js} +1 -1
  116. package/dist/chunks/{openapi-UYT3A457.js → openapi-NZJ6Q5Y2.js} +1 -1
  117. package/dist/chunks/{permissions-IAM4KOAB.js → permissions-3ZMQVJAQ.js} +1 -1
  118. package/dist/chunks/{prompt-missing-credentials-C2JLCS3F.js → prompt-missing-credentials-44DQQXOI.js} +1 -1
  119. package/dist/chunks/{publish-E5CQKZV2.js → publish-EDLEZCAF.js} +1 -1
  120. package/dist/chunks/{pull-FCIBUMPR.js → pull-5DQNSJCA.js} +1 -1
  121. package/dist/chunks/{purchase-domain-if-available-LDWR2G45.js → purchase-domain-if-available-R3YQ2TFP.js} +1 -1
  122. package/dist/chunks/{push-ZWGOHNYH.js → push-6O3JAFDA.js} +1 -1
  123. package/dist/chunks/{query-LYHMXYRT.js → query-MYKQOBG3.js} +1 -1
  124. package/dist/chunks/{reauthenticate-Z62FFYZH.js → reauthenticate-3UH4WWKC.js} +1 -1
  125. package/dist/chunks/{reorder-2ZHAHZTI.js → reorder-IU6GZK4H.js} +1 -1
  126. package/dist/chunks/{reply-6WH2VCFF.js → reply-FG74YRJ3.js} +1 -1
  127. package/dist/chunks/{resolve-RRLE67FD.js → resolve-MD3PGOME.js} +1 -1
  128. package/dist/chunks/{resolve-agent-team-ESQPBTIE.js → resolve-agent-team-X6GPGGDR.js} +1 -1
  129. package/dist/chunks/{restore-3WU5FYUK.js → restore-7KOACNT7.js} +1 -1
  130. package/dist/chunks/rm-CSIBWFYG.js +8 -0
  131. package/dist/chunks/{rm-3T2RJ37B.js → rm-HOE3GJAB.js} +1 -1
  132. package/dist/chunks/{rm-27VKBKTH.js → rm-JRAF4TPV.js} +1 -1
  133. package/dist/chunks/{rm-C6VVMUCP.js → rm-SKKBN7LZ.js} +1 -1
  134. package/dist/chunks/{rm-ZN3VHILG.js → rm-ZF2F2ZE3.js} +1 -1
  135. package/dist/chunks/{routes-PKCKZ5T6.js → routes-3RJGIZYJ.js} +1 -1
  136. package/dist/chunks/{rule-inspect-3XXNK2ON.js → rule-inspect-NICYVQPY.js} +1 -1
  137. package/dist/chunks/rules-NHACEVVC.js +7 -0
  138. package/dist/chunks/{schema-GAUOV4YT.js → schema-3XLZGVH5.js} +2 -2
  139. package/dist/chunks/{schema-XKLWHSSQ.js → schema-ZJASGDRI.js} +1 -1
  140. package/dist/chunks/{select-org-GGUGYGDL.js → select-org-XVAGUP4V.js} +1 -1
  141. package/dist/chunks/{set-6UUR4ZX2.js → set-JOSIBICX.js} +1 -1
  142. package/dist/chunks/{setup-and-link-MCBSB4BW.js → setup-and-link-7GIAMCTM.js} +1 -1
  143. package/dist/chunks/{tags-Z45CQGA6.js → tags-LVP4LVHL.js} +1 -1
  144. package/dist/chunks/{types-FK3W7A2Y.js → types-YEYQERHE.js} +1 -1
  145. package/dist/chunks/{update-BPLPDZSK.js → update-HPEVXFST.js} +1 -1
  146. package/dist/commands/build/index.js +1 -1
  147. package/dist/commands/deploy/index.js +4 -4
  148. package/dist/commands/dev/index.js +2 -2
  149. package/dist/commands/env/index.js +1 -1
  150. package/dist/commands/link/index.js +1 -1
  151. package/dist/commands/list/index.js +1 -1
  152. package/dist/commands-bulk.js +713 -696
  153. package/dist/index.js +2 -5
  154. package/dist/internal-build.js +1 -1
  155. package/dist/root-help-commands.mjs +1 -1
  156. package/dist/version.mjs +1 -1
  157. package/package.json +58 -58
  158. package/dist/chunks/chunk-3CTSLNNG.js +0 -8
  159. package/dist/chunks/chunk-AU42HSQ3.js +0 -7
  160. package/dist/chunks/chunk-FZIRYAXC.js +0 -10
  161. package/dist/chunks/chunk-LU5O3NH7.js +0 -9
  162. package/dist/chunks/chunk-OKFDH3WB.js +0 -12
  163. package/dist/chunks/chunk-QC47UKDR.js +0 -7
  164. package/dist/chunks/rm-CAPJK4ND.js +0 -8
  165. package/dist/chunks/rules-ZJW64O5H.js +0 -7
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{formatOption,jsonOption}from"./chunk-5IPBCD7K.js";import{packageName}from"./chunk-JESNVRVR.js";var specUrlOption={name:"spec-url",shorthand:null,type:String,argument:"URL",deprecated:!1,description:"Fetch endpoints from a custom OpenAPI spec URL instead of the public Vercel spec"},listSubcommand={name:"list",aliases:["ls"],description:"List all available API endpoints",arguments:[],options:[formatOption,jsonOption,specUrlOption,{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"}],examples:[{name:"List all endpoints in table format",value:`${packageName} api list`},{name:"List all endpoints as JSON",value:`${packageName} api list --json`},{name:"List endpoints from a custom OpenAPI spec",value:`${packageName} api list --spec-url https://openapi-internal.vercel.sh --refresh`}]},apiCommand={name:"api",aliases:[],description:"Make authenticated HTTP requests to the Vercel API",arguments:[{name:"endpoint",required:!1}],subcommands:[listSubcommand],options:[{name:"method",shorthand:"X",type:String,argument:"METHOD",deprecated:!1,description:"HTTP method (GET, POST, PUT, PATCH, DELETE). Defaults to GET, or POST if body is provided"},{name:"field",shorthand:"F",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a typed parameter (numbers, booleans parsed). Use @file for file contents"},{name:"raw-field",shorthand:"f",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a string option (no type parsing)"},{name:"header",shorthand:"H",type:[String],argument:"KEY:VALUE",deprecated:!1,description:"Add a custom HTTP header"},{name:"input",shorthand:null,type:String,argument:"FILE",deprecated:!1,description:"Read request body from file (use - for stdin)"},{name:"paginate",shorthand:null,type:Boolean,deprecated:!1,description:"Fetch all pages of results"},{name:"include",shorthand:"i",type:Boolean,deprecated:!1,description:"Include response headers in output"},{name:"silent",shorthand:null,type:Boolean,deprecated:!1,description:"Suppress response output"},{name:"verbose",shorthand:null,type:Boolean,deprecated:!1,description:"Show debug information including full request/response"},{name:"raw",shorthand:null,type:Boolean,deprecated:!1,description:"Output raw JSON without pretty-printing (the default when output is piped)"},{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"},specUrlOption,{name:"generate",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Generate output instead of executing (e.g., --generate=curl)"},{name:"dangerously-skip-permissions",shorthand:null,type:Boolean,deprecated:!1,description:"Skip confirmation prompts for DELETE operations (use with caution)"}],examples:[{name:"Get current user information",value:`${packageName} api /v2/user`},{name:"List projects with team scope",value:`${packageName} api /v9/projects --scope my-team`},{name:"Create a new project",value:`${packageName} api /v10/projects -X POST -F name=my-project`},{name:"Delete a deployment",value:`${packageName} api /v13/deployments/dpl_abc123 -X DELETE`},{name:"Paginate through all deployments",value:`${packageName} api /v6/deployments --paginate`},{name:"Post JSON from file",value:`${packageName} api /v10/projects -X POST --input config.json`},{name:"Add custom header",value:`${packageName} api /v2/user -H "X-Custom-Header: value"`},{name:"Interactive mode (select endpoint)",value:`${packageName} api`},{name:"Interactive mode with a custom OpenAPI spec",value:`${packageName} api --spec-url https://openapi-internal.vercel.sh --refresh`}]};export{listSubcommand,apiCommand};
7
+ import{formatOption,jsonOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var specUrlOption={name:"spec-url",shorthand:null,type:String,argument:"URL",deprecated:!1,description:"Fetch endpoints from a custom OpenAPI spec URL instead of the public Vercel spec"},listSubcommand={name:"list",aliases:["ls"],description:"List all available API endpoints",arguments:[],options:[formatOption,jsonOption,specUrlOption,{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"}],examples:[{name:"List all endpoints in table format",value:`${packageName} api list`},{name:"List all endpoints as JSON",value:`${packageName} api list --json`},{name:"List endpoints from a custom OpenAPI spec",value:`${packageName} api list --spec-url https://openapi-internal.vercel.sh --refresh`}]},apiCommand={name:"api",aliases:[],description:"Make authenticated HTTP requests to the Vercel API",arguments:[{name:"endpoint",required:!1}],subcommands:[listSubcommand],options:[{name:"method",shorthand:"X",type:String,argument:"METHOD",deprecated:!1,description:"HTTP method (GET, POST, PUT, PATCH, DELETE). Defaults to GET, or POST if body is provided"},{name:"field",shorthand:"F",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a typed parameter (numbers, booleans parsed). Use @file for file contents"},{name:"raw-field",shorthand:"f",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a string option (no type parsing)"},{name:"header",shorthand:"H",type:[String],argument:"KEY:VALUE",deprecated:!1,description:"Add a custom HTTP header"},{name:"input",shorthand:null,type:String,argument:"FILE",deprecated:!1,description:"Read request body from file (use - for stdin)"},{name:"paginate",shorthand:null,type:Boolean,deprecated:!1,description:"Fetch all pages of results"},{name:"include",shorthand:"i",type:Boolean,deprecated:!1,description:"Include response headers in output"},{name:"silent",shorthand:null,type:Boolean,deprecated:!1,description:"Suppress response output"},{name:"verbose",shorthand:null,type:Boolean,deprecated:!1,description:"Show debug information including full request/response"},{name:"raw",shorthand:null,type:Boolean,deprecated:!1,description:"Output raw JSON without pretty-printing (the default when output is piped)"},{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"},specUrlOption,{name:"generate",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Generate output instead of executing (e.g., --generate=curl)"},{name:"dangerously-skip-permissions",shorthand:null,type:Boolean,deprecated:!1,description:"Skip confirmation prompts for DELETE operations (use with caution)"}],examples:[{name:"Get current user information",value:`${packageName} api /v2/user`},{name:"List projects with team scope",value:`${packageName} api /v9/projects --scope my-team`},{name:"Create a new project",value:`${packageName} api /v10/projects -X POST -F name=my-project`},{name:"Delete a deployment",value:`${packageName} api /v13/deployments/dpl_abc123 -X DELETE`},{name:"Paginate through all deployments",value:`${packageName} api /v6/deployments --paginate`},{name:"Post JSON from file",value:`${packageName} api /v10/projects -X POST --input config.json`},{name:"Add custom header",value:`${packageName} api /v2/user -H "X-Custom-Header: value"`},{name:"Interactive mode (select endpoint)",value:`${packageName} api`},{name:"Interactive mode with a custom OpenAPI spec",value:`${packageName} api --spec-url https://openapi-internal.vercel.sh --refresh`}]};export{listSubcommand,apiCommand};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-FZIRYAXC.js";import{printAlignedLabel}from"./chunk-N7Q2IESO.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Rule ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
7
+ import{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-RIDPB64C.js";import{printAlignedLabel}from"./chunk-N7Q2IESO.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Rule ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
8
8
  ${renderAlertTable(rows,2)}
9
9
  `)}function commonRows(rule){return[["Name",rule.name],["Rule ID",rule.id],["Type",rule.type],["Scope",formatPublicRuleScope(rule)],["Default",formatBoolean(rule.isDefault)],...rule.createdAt?[["Created",formatDate(rule.createdAt)]]:[],...rule.updatedAt?[["Updated",formatDate(rule.updatedAt)]]:[]]}function notificationRows(rule){return[["Team owner notifications",formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)],...rule.notificationSettings.incidentIoRoutingKey?[["Incident.io routing key",rule.notificationSettings.incidentIoRoutingKey]]:[]]}function printBuiltInRule(rule){output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
10
10
 
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- function getFlagsSpecification(options){let flagsSpecification={};for(let option of options)flagsSpecification[`--${option.name}`]=option.type,option.shorthand&&(flagsSpecification[`-${option.shorthand}`]=`--${option.name}`);return flagsSpecification}var SENSITIVE_AUTH_FLAG_NAMES=new Set(["--token","-t"]);function normalizeFlagName(flag){return flag.includes("=")?flag.slice(0,flag.indexOf("=")):flag}function stripSensitiveAuthArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=normalizeFlagName(arg);if(SENSITIVE_AUTH_FLAG_NAMES.has(name)){!arg.includes("=")&&i+1<args.length&&i++;continue}out.push(arg)}return out}var globalCommandOptions=[{name:"help",shorthand:"h",type:Boolean,description:"Output usage information",deprecated:!1},{name:"version",shorthand:"v",type:Boolean,description:"Output the version number",deprecated:!1},{name:"cwd",shorthand:null,type:String,argument:"DIR",description:"Sets the current working directory for a single run of a command",deprecated:!1},{name:"local-config",shorthand:"A",type:String,argument:"FILE",description:"Path to the local `vercel.json` file",deprecated:!1},{name:"global-config",shorthand:"Q",type:String,argument:"DIR",description:"Path to the global `.vercel` directory",deprecated:!1},{name:"debug",shorthand:"d",type:Boolean,description:"Debug mode (default off)",deprecated:!1},{name:"no-color",shorthand:null,type:Boolean,description:"No color mode (default off)",deprecated:!1},{name:"non-interactive",shorthand:null,type:Boolean,description:"Run without interactive prompts; when an agent is detected this is the default",deprecated:!1},{name:"scope",shorthand:"S",type:String,description:"Set a custom scope",deprecated:!1},{name:"token",shorthand:"t",type:String,argument:"TOKEN",description:"Login token",deprecated:!1},{name:"team",shorthand:"T",type:String,deprecated:!1},{name:"api",shorthand:null,type:String,deprecated:!1}],GLOBAL_CLI_FLAG_NAMES=(()=>{let set=new Set;for(let opt of globalCommandOptions)set.add(`--${opt.name}`),opt.shorthand&&set.add(`-${opt.shorthand}`);return set})();function globalCliFlagTakesValue(flagName){let normalized=normalizeFlagName(flagName);for(let opt of globalCommandOptions)if(`--${opt.name}`===normalized||opt.shorthand&&`-${opt.shorthand}`===normalized)return opt.type===String;return!1}var SUGGESTION_FLAGS_TAKING_VALUE=new Set(["--config","--environment","--git-branch","--id","--value","--status","--name","--slug","--version","--search","--format","--project","--page","--per-page"]);function suggestionFlagTakesSeparateValue(flagName){let name=normalizeFlagName(flagName);return globalCliFlagTakesValue(name)?!0:SUGGESTION_FLAGS_TAKING_VALUE.has(name)}function getSameSubcommandSuggestionFlags(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(!a.startsWith("-")||(out.push(a),a.includes("=")))continue;suggestionFlagTakesSeparateValue(a)&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&out.push(safeArgs[++i])}return out}var GLOBAL_OPTIONS=getFlagsSpecification(globalCommandOptions),arg_common_default=()=>GLOBAL_OPTIONS,yesOption={name:"yes",shorthand:"y",type:Boolean,deprecated:!1,description:"Accept default value for all prompts"},nextOption={name:"next",shorthand:"N",type:Number,deprecated:!1,description:"Show next page of results",argument:"MS"},nextCursorOption={name:"next",shorthand:"N",type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},confirmOption={name:"confirm",shorthand:"c",type:Boolean,deprecated:!0},limitOption={name:"limit",shorthand:null,type:Number,deprecated:!1,description:"Number of results to return per page (default: 20, max: 100)",argument:"NUMBER"},sinceOption={name:"since",shorthand:"s",type:String,argument:"TIME",deprecated:!1,description:"Start time: ISO 8601 or relative, like 1h or 7d"},untilOption={name:"until",shorthand:"u",type:String,argument:"TIME",deprecated:!1,description:"End time: ISO 8601 or relative (default: now)"},forceOption={name:"force",shorthand:"f",type:Boolean,deprecated:!1},formatOption={name:"format",shorthand:"F",type:String,argument:"FORMAT",description:"Specify the output format (json)",deprecated:!1},jsonOption={name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output as JSON"};var allOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List resources across all projects"},projectOption={name:"project",shorthand:null,type:String,argument:"NAME_OR_ID",description:"Project name or ID (defaults to the linked project)",deprecated:!1},deploymentOption={name:"deployment",shorthand:null,type:String,deprecated:!1,description:"The deployment ID or URL to target",argument:"ID|URL"},protectionBypassOption={name:"protection-bypass",shorthand:null,type:String,deprecated:!1,description:"Protection bypass secret for accessing protected deployments",argument:"SECRET"},GLOBAL_LONG_TO_OPT=new Map,GLOBAL_SHORT_TO_OPT=new Map;for(let opt of globalCommandOptions)GLOBAL_LONG_TO_OPT.set(`--${opt.name}`,opt),opt.shorthand&&GLOBAL_SHORT_TO_OPT.set(`-${opt.shorthand}`,opt);function getGlobalFlagsFromArgs(args,options){let delimiterIndex=args.indexOf("--"),cliArgs=delimiterIndex===-1?args:args.slice(0,delimiterIndex),safeArgs=stripSensitiveAuthArgs(cliArgs),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(options?.preserveYes&&(a==="--yes"||a==="-y")){out.push(a);continue}if(options?.preserveConfig&&(a==="--config"||a.startsWith("--config="))){if(out.push(a),a==="--config"){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}continue}let opt;if(a.startsWith("--")&&a.includes("=")){let name=a.slice(2).split("=")[0];opt=GLOBAL_LONG_TO_OPT.get(`--${name}`),opt&&out.push(a);continue}if(opt=GLOBAL_LONG_TO_OPT.get(a)||GLOBAL_SHORT_TO_OPT.get(a),!!opt&&(out.push(a),opt.type===String&&!a.includes("="))){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}}if(options?.preserveProject){let projectOption2=findProjectOption(safeArgs);projectOption2&&out.push(...projectOption2.args)}return out}function findProjectOption(args){for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--")return;if(arg.startsWith("--project="))return{value:arg.slice(10),args:[arg]};if(arg==="--project"){let value=args[i+1];return value&&!value.startsWith("-")?{value,args:[arg,value]}:void 0}}}function getProjectOptionFromArgs(args){return findProjectOption(args)?.value}export{getFlagsSpecification,normalizeFlagName,stripSensitiveAuthArgs,globalCommandOptions,GLOBAL_CLI_FLAG_NAMES,globalCliFlagTakesValue,suggestionFlagTakesSeparateValue,getSameSubcommandSuggestionFlags,arg_common_default,yesOption,nextOption,nextCursorOption,confirmOption,limitOption,sinceOption,untilOption,forceOption,formatOption,jsonOption,allOption,projectOption,deploymentOption,protectionBypassOption,getGlobalFlagsFromArgs,getProjectOptionFromArgs};
7
+ function getFlagsSpecification(options){let flagsSpecification={};for(let option of options)flagsSpecification[`--${option.name}`]=option.type,option.shorthand&&(flagsSpecification[`-${option.shorthand}`]=`--${option.name}`);return flagsSpecification}var SENSITIVE_AUTH_FLAG_NAMES=new Set(["--token","-t"]);function normalizeFlagName(flag){return flag.includes("=")?flag.slice(0,flag.indexOf("=")):flag}function stripSensitiveAuthArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=normalizeFlagName(arg);if(SENSITIVE_AUTH_FLAG_NAMES.has(name)){!arg.includes("=")&&i+1<args.length&&i++;continue}out.push(arg)}return out}var globalCommandOptions=[{name:"help",shorthand:"h",type:Boolean,description:"Output usage information",deprecated:!1},{name:"version",shorthand:"v",type:Boolean,description:"Output the version number",deprecated:!1},{name:"cwd",shorthand:null,type:String,argument:"DIR",description:"Sets the current working directory for a single run of a command",deprecated:!1},{name:"local-config",shorthand:"A",type:String,argument:"FILE",description:"Path to the local `vercel.json` file",deprecated:!1},{name:"global-config",shorthand:"Q",type:String,argument:"DIR",description:"Path to the global `.vercel` directory",deprecated:!1},{name:"debug",shorthand:"d",type:Boolean,description:"Debug mode (default off)",deprecated:!1},{name:"no-color",shorthand:null,type:Boolean,description:"No color mode (default off)",deprecated:!1},{name:"non-interactive",shorthand:null,type:Boolean,description:"Run without interactive prompts; when an agent is detected this is the default",deprecated:!1},{name:"scope",shorthand:"S",type:String,description:"Set a custom scope",deprecated:!1},{name:"token",shorthand:"t",type:String,argument:"TOKEN",description:"Login token",deprecated:!1},{name:"team",shorthand:"T",type:String,deprecated:!1},{name:"api",shorthand:null,type:String,deprecated:!1}],GLOBAL_CLI_FLAG_NAMES=(()=>{let set=new Set;for(let opt of globalCommandOptions)set.add(`--${opt.name}`),opt.shorthand&&set.add(`-${opt.shorthand}`);return set})();function globalCliFlagTakesValue(flagName){let normalized=normalizeFlagName(flagName);for(let opt of globalCommandOptions)if(`--${opt.name}`===normalized||opt.shorthand&&`-${opt.shorthand}`===normalized)return opt.type===String;return!1}var SUGGESTION_FLAGS_TAKING_VALUE=new Set(["--config","--environment","--git-branch","--id","--value","--status","--name","--slug","--version","--search","--format","--project","--page","--per-page"]);function suggestionFlagTakesSeparateValue(flagName){let name=normalizeFlagName(flagName);return globalCliFlagTakesValue(name)?!0:SUGGESTION_FLAGS_TAKING_VALUE.has(name)}function getSameSubcommandSuggestionFlags(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(!a.startsWith("-")||(out.push(a),a.includes("=")))continue;suggestionFlagTakesSeparateValue(a)&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&out.push(safeArgs[++i])}return out}var GLOBAL_OPTIONS=getFlagsSpecification(globalCommandOptions),arg_common_default=()=>GLOBAL_OPTIONS,yesOption={name:"yes",shorthand:"y",type:Boolean,deprecated:!1,description:"Accept default value for all prompts"},nextOption={name:"next",shorthand:"N",type:Number,deprecated:!1,description:"Show next page of results",argument:"MS"},nextCursorOption={name:"next",shorthand:"N",type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},confirmOption={name:"confirm",shorthand:"c",type:Boolean,deprecated:!0},limitOption={name:"limit",shorthand:null,type:Number,deprecated:!1,description:"Number of results to return per page (default: 20, max: 100)",argument:"NUMBER"},sinceOption={name:"since",shorthand:"s",type:String,argument:"TIME",deprecated:!1,description:"Start time: ISO 8601 or relative, like 1h or 7d"},untilOption={name:"until",shorthand:"u",type:String,argument:"TIME",deprecated:!1,description:"End time: ISO 8601 or relative (default: now)"},forceOption={name:"force",shorthand:"f",type:Boolean,deprecated:!1},formatOption={name:"format",shorthand:"F",type:String,argument:"FORMAT",description:"Specify the output format (json)",deprecated:!0},jsonOption={name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output as JSON"};var allOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List resources across all projects"},projectOption={name:"project",shorthand:null,type:String,argument:"NAME_OR_ID",description:"Project name or ID (defaults to the linked project)",deprecated:!1},deploymentOption={name:"deployment",shorthand:null,type:String,deprecated:!1,description:"The deployment ID or URL to target",argument:"ID|URL"},protectionBypassOption={name:"protection-bypass",shorthand:null,type:String,deprecated:!1,description:"Protection bypass secret for accessing protected deployments",argument:"SECRET"},GLOBAL_LONG_TO_OPT=new Map,GLOBAL_SHORT_TO_OPT=new Map;for(let opt of globalCommandOptions)GLOBAL_LONG_TO_OPT.set(`--${opt.name}`,opt),opt.shorthand&&GLOBAL_SHORT_TO_OPT.set(`-${opt.shorthand}`,opt);function getGlobalFlagsFromArgs(args,options){let delimiterIndex=args.indexOf("--"),cliArgs=delimiterIndex===-1?args:args.slice(0,delimiterIndex),safeArgs=stripSensitiveAuthArgs(cliArgs),out=[];for(let i=0;i<safeArgs.length;i++){let a=safeArgs[i];if(options?.preserveYes&&(a==="--yes"||a==="-y")){out.push(a);continue}if(options?.preserveConfig&&(a==="--config"||a.startsWith("--config="))){if(out.push(a),a==="--config"){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}continue}let opt;if(a.startsWith("--")&&a.includes("=")){let name=a.slice(2).split("=")[0];opt=GLOBAL_LONG_TO_OPT.get(`--${name}`),opt&&out.push(a);continue}if(opt=GLOBAL_LONG_TO_OPT.get(a)||GLOBAL_SHORT_TO_OPT.get(a),!!opt&&(out.push(a),opt.type===String&&!a.includes("="))){let next=safeArgs[i+1];next&&!next.startsWith("-")&&(out.push(next),i++)}}if(options?.preserveProject){let projectOption2=findProjectOption(safeArgs);projectOption2&&out.push(...projectOption2.args)}return out}function findProjectOption(args){for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--")return;if(arg.startsWith("--project="))return{value:arg.slice(10),args:[arg]};if(arg==="--project"){let value=args[i+1];return value&&!value.startsWith("-")?{value,args:[arg,value]}:void 0}}}function getProjectOptionFromArgs(args){return findProjectOption(args)?.value}export{getFlagsSpecification,normalizeFlagName,stripSensitiveAuthArgs,globalCommandOptions,GLOBAL_CLI_FLAG_NAMES,globalCliFlagTakesValue,suggestionFlagTakesSeparateValue,getSameSubcommandSuggestionFlags,arg_common_default,yesOption,nextOption,nextCursorOption,confirmOption,limitOption,sinceOption,untilOption,forceOption,formatOption,jsonOption,allOption,projectOption,deploymentOption,protectionBypassOption,getGlobalFlagsFromArgs,getProjectOptionFromArgs};
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-RELWXDML.js";import{getExitCodeForErrorCode,handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-5UEBA6N6.js";import{isJSONObject}from"./chunk-KLH6NMWT.js";import{getScope}from"./chunk-ZV2YYRGF.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-FZIRYAXC.js";import{getProjectByNameOrId}from"./chunk-K6BJ5GVA.js";import{ProjectNotFound,isAPIError}from"./chunk-YIIPBH2D.js";import{output_manager_default}from"./chunk-75IAMKGV.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
7
+ import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-QL3IYPBV.js";import{getExitCodeForErrorCode,handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-5UEBA6N6.js";import{isJSONObject}from"./chunk-KLYIX4HK.js";import{getScope}from"./chunk-WZ7YJDKT.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-RIDPB64C.js";import{getProjectByNameOrId}from"./chunk-4TTF5E5U.js";import{ProjectNotFound,isAPIError}from"./chunk-YIIPBH2D.js";import{output_manager_default}from"./chunk-75IAMKGV.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
8
8
  `):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
9
9
  `)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to alert rules in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage alert rules in this team.":err.status>=500?`The alert rules endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the rule belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel alerts rules schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"alerts rules --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `alerts rules` subcommands"}]},2)}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-FZIRYAXC.js";import{printAlignedLabel}from"./chunk-N7Q2IESO.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var CRITICAL_DELIVERY_DESCRIPTION="Critical only (escalated by Vercel Agent)";function formatMinimumSeverity(notification){let level=notification.minimumSeverityLevel;return level==="critical"?CRITICAL_DELIVERY_DESCRIPTION:level?`${level[0].toUpperCase()}${level.slice(1)} and above`:notification.type==="webhook"&&!("url"in notification.webhook)?"Details unavailable":"Rule setting"}function formatProjectScope(scope){return scope.type==="all"?"all projects":`${scope.projectName} (${scope.projectId})`}function formatNotificationExpanded(notification,index){if(notification.type==="slack")return[` ${index+1}. ${import_chalk.default.bold("Slack")} ${import_chalk.default.cyan(`#${notification.channelName}`)}`,` ${import_chalk.default.dim("Project scope:")} ${formatProjectScope(notification.projectScope)}`,` ${import_chalk.default.dim("Channel ID:")} ${notification.channelId}`,` ${import_chalk.default.dim("Slack installation ID:")} ${notification.configId}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
7
+ import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-RIDPB64C.js";import{printAlignedLabel}from"./chunk-N7Q2IESO.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var CRITICAL_DELIVERY_DESCRIPTION="Critical only (escalated by Vercel Agent)";function formatMinimumSeverity(notification){let level=notification.minimumSeverityLevel;return level==="critical"?CRITICAL_DELIVERY_DESCRIPTION:level?`${level[0].toUpperCase()}${level.slice(1)} and above`:notification.type==="webhook"&&!("url"in notification.webhook)?"Details unavailable":"Rule setting"}function formatProjectScope(scope){return scope.type==="all"?"all projects":`${scope.projectName} (${scope.projectId})`}function formatNotificationExpanded(notification,index){if(notification.type==="slack")return[` ${index+1}. ${import_chalk.default.bold("Slack")} ${import_chalk.default.cyan(`#${notification.channelName}`)}`,` ${import_chalk.default.dim("Project scope:")} ${formatProjectScope(notification.projectScope)}`,` ${import_chalk.default.dim("Channel ID:")} ${notification.channelId}`,` ${import_chalk.default.dim("Slack installation ID:")} ${notification.configId}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
8
8
  `);let{webhook}=notification;return[` ${index+1}. ${import_chalk.default.bold("Webhook")}`,` ${import_chalk.default.dim("Webhook ID:")} ${webhook.id}`,` ${import_chalk.default.dim("URL:")} ${"url"in webhook?webhook.url:"Details unavailable"}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
9
9
  `)}function formatRuleExpanded(ruleId,notifications){let lines=[` ${import_chalk.default.bold(ruleId)}`];return notifications.length===0?lines.push(` ${import_chalk.default.dim("No notification destinations")}`):lines.push(notifications.map((notification,index)=>formatNotificationExpanded(notification,index)).join(`
10
10