@vercel/cli-support 65.10.0 → 65.11.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 (260) hide show
  1. package/dist/chunks/add-4R6FUHQT.js +8 -0
  2. package/dist/chunks/add-F3H4BFJZ.js +8 -0
  3. package/dist/chunks/add-TCOJ4SIQ.js +8 -0
  4. package/dist/chunks/alerts-JGRRCQA4.js +8 -0
  5. package/dist/chunks/build-GOLTZF6S.js +7 -0
  6. package/dist/chunks/{chunk-6NUH6ZPE.js → chunk-2J35YKA2.js} +9 -9
  7. package/dist/chunks/{chunk-GQ4CQDIL.js → chunk-3KJ6HWSX.js} +1 -1
  8. package/dist/chunks/{chunk-STKZTUGE.js → chunk-3TDFSO4X.js} +1 -1
  9. package/dist/chunks/chunk-42FOKWGX.js +8 -0
  10. package/dist/chunks/{chunk-T2FCF46I.js → chunk-4DMKP6AO.js} +2 -2
  11. package/dist/chunks/chunk-4HR3I3ML.js +7 -0
  12. package/dist/chunks/{chunk-5MPZSRYG.js → chunk-4T57TXQ3.js} +1 -1
  13. package/dist/chunks/{chunk-SBEWZ65N.js → chunk-4VP57TOJ.js} +1 -1
  14. package/dist/chunks/{chunk-ZEUREQ4E.js → chunk-5B5CLOKM.js} +1 -1
  15. package/dist/chunks/chunk-5FIY443M.js +7 -0
  16. package/dist/chunks/{chunk-AUIV7YJO.js → chunk-5X635INY.js} +2 -2
  17. package/dist/chunks/{chunk-P6J22UJQ.js → chunk-6ORJPXDQ.js} +1 -1
  18. package/dist/chunks/chunk-74VQ7PQV.js +7 -0
  19. package/dist/chunks/{chunk-VU3RBRDH.js → chunk-7JMN657A.js} +1 -1
  20. package/dist/chunks/{chunk-Q46Q4Y4R.js → chunk-7LPNDK2O.js} +1 -1
  21. package/dist/chunks/{chunk-LIEWXPUC.js → chunk-7MZLV3KK.js} +1 -1
  22. package/dist/chunks/{chunk-YGYUPPAL.js → chunk-7NMC4E66.js} +1 -1
  23. package/dist/chunks/chunk-7ZJ7VUIR.js +7 -0
  24. package/dist/chunks/chunk-A3M2BHWR.js +13 -0
  25. package/dist/chunks/{chunk-US7YJ2RQ.js → chunk-AYZ52QDF.js} +1 -1
  26. package/dist/chunks/{chunk-5IZ33FNL.js → chunk-B56SRT5W.js} +1 -1
  27. package/dist/chunks/{chunk-3PKL2PTF.js → chunk-B6QVH6IG.js} +1 -1
  28. package/dist/chunks/{chunk-3QYXC4PH.js → chunk-BUFEV3T4.js} +1 -1
  29. package/dist/chunks/{chunk-ER7L7HYA.js → chunk-BVR6OIU5.js} +1 -1
  30. package/dist/chunks/{chunk-B4XGTAFO.js → chunk-BW25OFQG.js} +1 -1
  31. package/dist/chunks/{chunk-7LSH3MEB.js → chunk-C5QEQSEX.js} +1 -1
  32. package/dist/chunks/{chunk-VQSSVB6V.js → chunk-CD6ZWCKT.js} +1 -1
  33. package/dist/chunks/chunk-CFYLTZSV.js +7 -0
  34. package/dist/chunks/chunk-D3M2JG5C.js +7 -0
  35. package/dist/chunks/chunk-D7BB5BPA.js +10 -0
  36. package/dist/chunks/{chunk-RUBMVRT6.js → chunk-DR6OJB6P.js} +1 -1
  37. package/dist/chunks/chunk-DRZVM7CB.js +12 -0
  38. package/dist/chunks/{chunk-UQNBUXQA.js → chunk-EBIJ26IV.js} +1 -1
  39. package/dist/chunks/chunk-EGTJTCCW.js +7 -0
  40. package/dist/chunks/{chunk-OJWI6QJ3.js → chunk-EICEQXVS.js} +1 -1
  41. package/dist/chunks/{chunk-NAN5IE3B.js → chunk-EIMHC5UY.js} +1 -1
  42. package/dist/chunks/{chunk-CBMWPDOL.js → chunk-EVBGFSK5.js} +1 -1
  43. package/dist/chunks/{chunk-N5AN4JZL.js → chunk-EZLPMOHM.js} +1 -1
  44. package/dist/chunks/{chunk-JLNF2QTR.js → chunk-F2R7L3ZB.js} +1 -1
  45. package/dist/chunks/chunk-FHMCTV5E.js +7 -0
  46. package/dist/chunks/{chunk-DUCCC22H.js → chunk-FNH3T3CF.js} +1 -1
  47. package/dist/chunks/{chunk-RBIHS5QI.js → chunk-FOE3MWES.js} +1 -1
  48. package/dist/chunks/{chunk-KZLRIAAT.js → chunk-FVTRIRML.js} +1 -1
  49. package/dist/chunks/{chunk-PL6IOUKW.js → chunk-GL66K54F.js} +1 -1
  50. package/dist/chunks/{chunk-SXYA7JSX.js → chunk-HDISAMDF.js} +1 -1
  51. package/dist/chunks/chunk-HKU6D7DU.js +8 -0
  52. package/dist/chunks/{chunk-4WXVKR43.js → chunk-HNH3DPIZ.js} +1 -1
  53. package/dist/chunks/{chunk-U2TQFAO3.js → chunk-HYOWFNOP.js} +1 -1
  54. package/dist/chunks/{chunk-OYIDWI5Y.js → chunk-HZEKH3RO.js} +3 -3
  55. package/dist/chunks/{chunk-6RMW63GB.js → chunk-IHCYNUI2.js} +1 -1
  56. package/dist/chunks/chunk-IOTKHTZH.js +7 -0
  57. package/dist/chunks/{chunk-4VF5BZJP.js → chunk-JTAUWH5V.js} +1 -1
  58. package/dist/chunks/{chunk-S535FZTA.js → chunk-JUSNW3IF.js} +1 -1
  59. package/dist/chunks/{chunk-MKTZDEOJ.js → chunk-K4JTCVNW.js} +1 -1
  60. package/dist/chunks/{chunk-FPREO4VS.js → chunk-LALPOYIA.js} +1 -1
  61. package/dist/chunks/{chunk-YKLTNKQJ.js → chunk-MIIHBRKV.js} +1 -1
  62. package/dist/chunks/{chunk-BK3TNLWO.js → chunk-MO2G2ND2.js} +1 -1
  63. package/dist/chunks/{chunk-NLTZGQB2.js → chunk-MUKXOI2K.js} +1 -1
  64. package/dist/chunks/{chunk-PKZK23PR.js → chunk-NDMQVBTV.js} +1 -1
  65. package/dist/chunks/{chunk-DNLE3KPC.js → chunk-NSPW47RU.js} +1 -1
  66. package/dist/chunks/{chunk-K5KVSA2A.js → chunk-NT2N5UR4.js} +1 -1
  67. package/dist/chunks/{chunk-WYGOYE6C.js → chunk-NTDP6RTQ.js} +1 -1
  68. package/dist/chunks/chunk-NUSKXXZZ.js +20 -0
  69. package/dist/chunks/{chunk-Q2JNATRP.js → chunk-NZW3RIQM.js} +1 -1
  70. package/dist/chunks/chunk-Q2QVK3TH.js +7 -0
  71. package/dist/chunks/{chunk-HTPNGLPH.js → chunk-QDHTI5WK.js} +1 -1
  72. package/dist/chunks/chunk-QROI2U32.js +14 -0
  73. package/dist/chunks/chunk-RAQ6EUNL.js +7 -0
  74. package/dist/chunks/chunk-RDWLLSPU.js +7 -0
  75. package/dist/chunks/chunk-RR5SDYNN.js +8 -0
  76. package/dist/chunks/{chunk-BPRGAX62.js → chunk-SLCPSRDR.js} +1 -1
  77. package/dist/chunks/{chunk-5RYQH3XW.js → chunk-TPJV5UNE.js} +1 -1
  78. package/dist/chunks/{chunk-QXL353OB.js → chunk-TUAS3L5I.js} +1 -1
  79. package/dist/chunks/{chunk-7TR6H6NE.js → chunk-UBJVL3NJ.js} +2 -2
  80. package/dist/chunks/{chunk-6YAYCEDT.js → chunk-UCRMJMH6.js} +2 -2
  81. package/dist/chunks/{chunk-XS3MNHFR.js → chunk-UF2E5BDE.js} +1 -1
  82. package/dist/chunks/{chunk-E7WULWMX.js → chunk-UFXIPUNI.js} +1 -1
  83. package/dist/chunks/{chunk-SR7BZA6N.js → chunk-UNPK7LVC.js} +1 -1
  84. package/dist/chunks/{chunk-FXHB7TTL.js → chunk-VAZ7JG2Z.js} +1 -1
  85. package/dist/chunks/{chunk-52X4YVSG.js → chunk-VKCBEW6R.js} +1 -1
  86. package/dist/chunks/{chunk-FSJFWVUY.js → chunk-VWJXV5ZM.js} +1 -1
  87. package/dist/chunks/{chunk-VTITZEPW.js → chunk-W24TLPO5.js} +1 -1
  88. package/dist/chunks/chunk-WBSFE6IE.js +10 -0
  89. package/dist/chunks/{chunk-LE72YLCC.js → chunk-WMWB7QKG.js} +1 -1
  90. package/dist/chunks/{chunk-XFUUALZS.js → chunk-WNDR5HCU.js} +1 -1
  91. package/dist/chunks/{chunk-DQNP7OQ5.js → chunk-XH2R2EIK.js} +1 -1
  92. package/dist/chunks/{chunk-ZPJHONCZ.js → chunk-XQDHMFQY.js} +1 -1
  93. package/dist/chunks/{chunk-JA6IGJ67.js → chunk-YODQLETL.js} +1 -1
  94. package/dist/chunks/{chunk-36XHIIUT.js → chunk-Z64MQIOE.js} +1 -1
  95. package/dist/chunks/chunk-ZPBGAZC2.js +11 -0
  96. package/dist/chunks/{chunk-75DUL7VI.js → chunk-ZTHW5VNH.js} +1 -1
  97. package/dist/chunks/clear-PECHXMV5.js +8 -0
  98. package/dist/chunks/compile-vercel-config-EM3HYOQC.js +7 -0
  99. package/dist/chunks/config-DA2NZUDH.js +8 -0
  100. package/dist/chunks/config-X6O3DT7V.js +7 -0
  101. package/dist/chunks/config-validator.mjs +1 -1
  102. package/dist/chunks/{connect-git-provider-YIX5ZOU6.js → connect-git-provider-GFAJLQLU.js} +1 -1
  103. package/dist/chunks/contract-RHMWRX4W.js +10 -0
  104. package/dist/chunks/delete-5RN5VW5L.js +9 -0
  105. package/dist/chunks/delete-MT6I7R7K.js +10 -0
  106. package/dist/chunks/detect-services-HSA4JHJX.js +7 -0
  107. package/dist/chunks/disable-LXPZDQMC.js +7 -0
  108. package/dist/chunks/discard-PW65T65S.js +14 -0
  109. package/dist/chunks/edit-WFSONASO.js +8 -0
  110. package/dist/chunks/edit-YID3FOJ3.js +9 -0
  111. package/dist/chunks/enable-X2EKQCIY.js +7 -0
  112. package/dist/chunks/{export-YYQ2J5AT.js → export-25TQ3YBT.js} +1 -1
  113. package/dist/chunks/future-DQBK457G.js +7 -0
  114. package/dist/chunks/generate-cert-for-deploy-OMEACY5G.js +7 -0
  115. package/dist/chunks/image-AO2OZG4W.js +7 -0
  116. package/dist/chunks/import-builders-GSDV4K4A.js +7 -0
  117. package/dist/chunks/{inspect-AHHXHIIP.js → inspect-3W3TUJ6P.js} +1 -1
  118. package/dist/chunks/inspect-4244CRHI.js +13 -0
  119. package/dist/chunks/{inspect-SFM3NWDF.js → inspect-BRYVSQBD.js} +1 -1
  120. package/dist/chunks/inspect-C43IV7X4.js +9 -0
  121. package/dist/chunks/inspect-RP5KXOYQ.js +8 -0
  122. package/dist/chunks/{inspect-RPCDGIP3.js → inspect-TN2QY3BP.js} +1 -1
  123. package/dist/chunks/list-2SY6PZLC.js +12 -0
  124. package/dist/chunks/{list-7WWUYCE6.js → list-6W4UQBY4.js} +1 -1
  125. package/dist/chunks/{list-NXZXKKAR.js → list-WA6Q7DUN.js} +1 -1
  126. package/dist/chunks/list-WBKZGIMQ.js +8 -0
  127. package/dist/chunks/login-K6XBWOFD.js +9 -0
  128. package/dist/chunks/login-OGMXEW5N.js +7 -0
  129. package/dist/chunks/logs-R3ZERQ7M.js +7 -0
  130. package/dist/chunks/{ls-LCUOBWY2.js → ls-4WP6LHLL.js} +1 -1
  131. package/dist/chunks/{ls-ITWXAWSZ.js → ls-EVAQD3LI.js} +1 -1
  132. package/dist/chunks/{ls-5SKRXNSI.js → ls-L5LLKZBV.js} +1 -1
  133. package/dist/chunks/{ls-FOFJU2JJ.js → ls-MAJ4QZTY.js} +1 -1
  134. package/dist/chunks/ls-O5DKK3TY.js +8 -0
  135. package/dist/chunks/ls-PTHGXQLK.js +11 -0
  136. package/dist/chunks/{ls-OY5YTZGN.js → ls-UXE5RSZN.js} +1 -1
  137. package/dist/chunks/mutate-EKZWPQQJ.js +9 -0
  138. package/dist/chunks/{notifications-XAPB2F2T.js → notifications-F5S3RKZF.js} +1 -1
  139. package/dist/chunks/open-KGVG54NN.js +7 -0
  140. package/dist/chunks/{openapi-UUFKDKGC.js → openapi-7TPDTMCU.js} +1 -1
  141. package/dist/chunks/{permissions-FU5OET67.js → permissions-5K7JZOMB.js} +1 -1
  142. package/dist/chunks/{plugin-offer-E5JOW442.js → plugin-offer-JUYWL4I7.js} +1 -1
  143. package/dist/chunks/prompt-missing-credentials-DX2KJB5X.js +7 -0
  144. package/dist/chunks/publish-KIRTO2ZO.js +15 -0
  145. package/dist/chunks/pull-3CRJK7BX.js +7 -0
  146. package/dist/chunks/purchase-domain-if-available-55IXEF43.js +7 -0
  147. package/dist/chunks/push-4YG5HKSD.js +7 -0
  148. package/dist/chunks/{query-VMKIOI3W.js → query-67KQVLTR.js} +1 -1
  149. package/dist/chunks/reauthenticate-SWSBFGDU.js +7 -0
  150. package/dist/chunks/remove-SYTIFVWW.js +9 -0
  151. package/dist/chunks/reorder-TX5MXJEB.js +10 -0
  152. package/dist/chunks/reply-XVK33N5T.js +9 -0
  153. package/dist/chunks/resolve-JZ262ZF4.js +12 -0
  154. package/dist/chunks/resolve-agent-team-BG5YW55B.js +7 -0
  155. package/dist/chunks/restore-IPFL7TKT.js +16 -0
  156. package/dist/chunks/rm-2BCAZGQU.js +8 -0
  157. package/dist/chunks/rm-3CCU3CE6.js +8 -0
  158. package/dist/chunks/rm-5CQV5LYG.js +8 -0
  159. package/dist/chunks/rm-OV4OU6H2.js +8 -0
  160. package/dist/chunks/rm-WFGMOZ3G.js +8 -0
  161. package/dist/chunks/rule-inspect-RFJIIXZH.js +8 -0
  162. package/dist/chunks/{schema-AKVIKCFT.js → schema-753JMRZA.js} +1 -1
  163. package/dist/chunks/schema-SUNFQGUL.js +14 -0
  164. package/dist/chunks/select-org-MPHPWWPU.js +7 -0
  165. package/dist/chunks/set-BR6EEOPB.js +7 -0
  166. package/dist/chunks/set-I3NWZRSI.js +9 -0
  167. package/dist/chunks/setup-and-link-MRTKVOWD.js +7 -0
  168. package/dist/chunks/{skills-JG4MGVKX.js → skills-QZ4AMS2K.js} +28 -16
  169. package/dist/chunks/{tags-4Y4UBA5S.js → tags-7DIZEAVE.js} +1 -1
  170. package/dist/chunks/{types-DSN6Q6HW.js → types-NPUAHKSK.js} +1 -1
  171. package/dist/chunks/{update-R42CXSVE.js → update-7XH7HM5F.js} +1 -1
  172. package/dist/chunks/usage-3BS7JCCU.js +13 -0
  173. package/dist/chunks/{validate-config-XWZ7ZZ3G.js → validate-config-LAD7BU3B.js} +1 -1
  174. package/dist/commands/build/index.js +1 -1
  175. package/dist/commands/deploy/index.js +4 -4
  176. package/dist/commands/dev/index.js +2 -2
  177. package/dist/commands/env/index.js +1 -1
  178. package/dist/commands/link/index.js +1 -1
  179. package/dist/commands/list/index.js +1 -1
  180. package/dist/commands/project/index.js +1 -1
  181. package/dist/commands-account.js +82 -93
  182. package/dist/commands-ai.js +13 -12
  183. package/dist/commands-blob.js +1 -1
  184. package/dist/commands-core.js +56 -59
  185. package/dist/commands-deployments.js +1 -1
  186. package/dist/commands-flags.js +6 -6
  187. package/dist/commands-integrations.js +12 -18
  188. package/dist/commands-observability.js +7 -7
  189. package/dist/commands-routing.js +2 -2
  190. package/dist/help.js +1 -1
  191. package/dist/index.js +7 -7
  192. package/dist/internal-build.js +1 -1
  193. package/dist/launcher-errors.js +1 -1
  194. package/dist/package.json +22 -22
  195. package/dist/root-help-commands.mjs +1 -1
  196. package/dist/version.mjs +1 -1
  197. package/package.json +13 -13
  198. package/dist/chunks/add-4MTUAI2X.js +0 -8
  199. package/dist/chunks/add-JYLWBVVQ.js +0 -8
  200. package/dist/chunks/add-T5ERJ62Z.js +0 -8
  201. package/dist/chunks/build-OGWTTFLG.js +0 -7
  202. package/dist/chunks/chunk-3QFBVAHL.js +0 -8
  203. package/dist/chunks/chunk-5RSSGN2Q.js +0 -8
  204. package/dist/chunks/chunk-BIRSJSAO.js +0 -7
  205. package/dist/chunks/chunk-FOWAVQOH.js +0 -8
  206. package/dist/chunks/chunk-JBU72NEQ.js +0 -7
  207. package/dist/chunks/chunk-NZRBJB6T.js +0 -7
  208. package/dist/chunks/chunk-OII46FDN.js +0 -12
  209. package/dist/chunks/chunk-SNNJRKD6.js +0 -10
  210. package/dist/chunks/chunk-TILI4QBL.js +0 -11
  211. package/dist/chunks/chunk-WKIDCYKL.js +0 -10
  212. package/dist/chunks/chunk-ZCUUCYID.js +0 -13
  213. package/dist/chunks/chunk-ZIC7VWFC.js +0 -14
  214. package/dist/chunks/clear-Z5OO6URI.js +0 -8
  215. package/dist/chunks/compile-vercel-config-ZKUTSDWV.js +0 -7
  216. package/dist/chunks/config-AUTTHXQO.js +0 -8
  217. package/dist/chunks/config-RJ7PLFQD.js +0 -7
  218. package/dist/chunks/delete-QQOC63HV.js +0 -9
  219. package/dist/chunks/delete-WIGSOZR3.js +0 -10
  220. package/dist/chunks/detect-services-J4LGLAHC.js +0 -7
  221. package/dist/chunks/disable-L54VGY5A.js +0 -7
  222. package/dist/chunks/discard-Q5UPTZR2.js +0 -14
  223. package/dist/chunks/edit-FRGMYBW3.js +0 -9
  224. package/dist/chunks/edit-QEDNQ33T.js +0 -8
  225. package/dist/chunks/enable-TGQZWSBG.js +0 -7
  226. package/dist/chunks/future-RYEYLPCG.js +0 -7
  227. package/dist/chunks/generate-cert-for-deploy-Y4KDIFF2.js +0 -7
  228. package/dist/chunks/image-PDPRURMH.js +0 -7
  229. package/dist/chunks/import-builders-H54QCMQ4.js +0 -7
  230. package/dist/chunks/inspect-6IBPIBIJ.js +0 -9
  231. package/dist/chunks/inspect-Q7FYDFL7.js +0 -13
  232. package/dist/chunks/list-GSVERG4S.js +0 -12
  233. package/dist/chunks/login-HEHHQO3F.js +0 -9
  234. package/dist/chunks/login-XKLPSZNN.js +0 -7
  235. package/dist/chunks/logs-NJ46ZSNZ.js +0 -7
  236. package/dist/chunks/ls-MWGIT2YH.js +0 -8
  237. package/dist/chunks/ls-TZN53EJL.js +0 -11
  238. package/dist/chunks/mutate-ZYXVL22A.js +0 -9
  239. package/dist/chunks/open-WPRHI6ND.js +0 -7
  240. package/dist/chunks/prompt-missing-credentials-ZZVTEQQB.js +0 -7
  241. package/dist/chunks/publish-R5IV2BH2.js +0 -15
  242. package/dist/chunks/pull-CQVHIIAN.js +0 -7
  243. package/dist/chunks/purchase-domain-if-available-VMWCMYC2.js +0 -7
  244. package/dist/chunks/push-Y5CUOISM.js +0 -7
  245. package/dist/chunks/reauthenticate-5K7LBTOW.js +0 -7
  246. package/dist/chunks/reorder-W3MXHSGZ.js +0 -10
  247. package/dist/chunks/reply-YH7HRIWQ.js +0 -9
  248. package/dist/chunks/resolve-FWVMWJTG.js +0 -12
  249. package/dist/chunks/resolve-agent-team-6L7AQUA2.js +0 -7
  250. package/dist/chunks/restore-I7L3EOS4.js +0 -16
  251. package/dist/chunks/rm-AWUMNWQU.js +0 -8
  252. package/dist/chunks/rm-HVGUK55W.js +0 -8
  253. package/dist/chunks/rm-M3EMCKSN.js +0 -8
  254. package/dist/chunks/rm-RFCTWU5R.js +0 -8
  255. package/dist/chunks/rm-VREBRM5D.js +0 -8
  256. package/dist/chunks/rule-inspect-SQUCRRGA.js +0 -8
  257. package/dist/chunks/schema-S36QQNJP.js +0 -14
  258. package/dist/chunks/select-org-PRWYXAWW.js +0 -7
  259. package/dist/chunks/set-ZJAC44LV.js +0 -7
  260. package/dist/chunks/setup-and-link-VD53JFQI.js +0 -7
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ async function getWebhook(client,webhookId){return await client.fetch(`/v1/webhooks/${encodeURIComponent(webhookId)}`)}var TEAM_BUDGET={scope:"team"},BUDGET_THRESHOLD_PERCENTS=[50,75,100],PAUSE_AT_PERCENT=100;function buildThresholds({pause,webhookUrl}){return BUDGET_THRESHOLD_PERCENTS.map(percent=>({percent,sendNotifications:!0,triggerWebhook:!!webhookUrl,pauseUsage:percent===PAUSE_AT_PERCENT?!!pause:!1}))}function thresholdsForSet({existing,pause,pauseSpecified,webhookUrl,webhookSpecified}){if(!existing?.length)return buildThresholds({pause,webhookUrl});let next=existing.map(threshold=>({...threshold}));if(pauseSpecified&&(next=applyPauseToThresholds(next,pause)),webhookSpecified){let triggerWebhook=!!webhookUrl;next=next.map(threshold=>({...threshold,triggerWebhook}))}return next}function hasPauseThreshold(thresholds){return thresholds.some(threshold=>threshold.percent===PAUSE_AT_PERCENT)}function pausePercentsOutside100(thresholds){return thresholds.filter(threshold=>threshold.pauseUsage&&threshold.percent!==PAUSE_AT_PERCENT).map(threshold=>threshold.percent)}function applyPauseToThresholds(thresholds,pause){return pause?thresholds.map(threshold=>({...threshold,pauseUsage:threshold.percent===PAUSE_AT_PERCENT})):thresholds.map(threshold=>({...threshold,pauseUsage:!1}))}function budgetAmountDollars(budget){let n=Number(budget.amount);return Number.isFinite(n)?n:0}function spendDollars(spend){return spend?.currentSpend==null?null:spend.currentSpend/100}function percentUsed(spent,amount){return spent!==null&&amount>0?Math.round(spent/amount*100):null}function spendPayload(spent,amount){return{currentSpend:spent,percentUsed:amount===null?null:percentUsed(spent,amount),unit:"usd"}}var NO_RETRY={retries:0};function budgetPauses(budget){return budget.thresholds.some(t=>t.pauseUsage)}function budgetStatePayload(state){return{id:state.id,teamId:state.teamId,scope:state.scope,scopeId:state.scopeId,amount:state.amount,amountUnit:state.amountUnit,status:state.status,pause:state.pause,webhookId:state.webhookId,webhookUrl:state.webhookUrl,webhookStatus:state.webhookStatus,thresholds:state.thresholds}}function setSavedReceipt({team,reloaded,webhookSecret,amount,scope}){let secret=webhookSecret?{webhookSecret}:{};return reloaded?{ok:!0,saved:!0,reloaded:!0,teamSlug:team.slug,...budgetStatePayload(reloaded),...secret}:{ok:!0,saved:!0,reloaded:!1,teamId:team.id,teamSlug:team.slug,scope,amount,amountUnit:"usd",...secret}}function removeReceipt({team,alreadyAbsent,disabled,scope}){return{ok:!0,alreadyAbsent,disabled,teamId:team.id,teamSlug:team.slug,scope}}function selectorQuery(selector){return new URLSearchParams({scope:selector.scope}).toString()}function matchesSelector(budget,selector){return(budget.scope??selector.scope)===selector.scope}function resolvedBudgetScope(budget,selector=TEAM_BUDGET){return budget.scope??selector.scope}async function toBudgetState(client,budget,selector=TEAM_BUDGET){let webhook=await resolveBudgetWebhook(client,budget);return{id:budget.id,teamId:budget.ownerId,scope:resolvedBudgetScope(budget,selector),scopeId:budget.scopeId??null,amount:budgetAmountDollars(budget),amountUnit:"usd",status:budget.status,pause:budgetPauses(budget),webhookId:webhook.webhookId,webhookUrl:webhook.webhookUrl,webhookStatus:webhook.webhookStatus,thresholds:budget.thresholds.map(threshold=>({...threshold}))}}async function resolveBudgetWebhook(client,budget){if(!budget.webhookId)return{webhookId:null,webhookUrl:null,webhookStatus:"absent"};try{let webhook=await getWebhook(client,budget.webhookId);return{webhookId:budget.webhookId,webhookUrl:webhook.url,webhookStatus:"resolved"}}catch{return{webhookId:budget.webhookId,webhookUrl:null,webhookStatus:"unavailable"}}}function formatUsdWhole(dollars){return`$${dollars.toLocaleString("en-US",{maximumFractionDigits:0})}`}function formatUsd(dollars){return`$${dollars.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}async function listBudgets(client,selector){let{data}=await client.fetch(selector?`/v1/budgets?${selectorQuery(selector)}`:"/v1/budgets",{method:"GET"});return data??[]}async function findBudget(client,selector=TEAM_BUDGET){let budgets=(await listBudgets(client,selector)).filter(budget=>matchesSelector(budget,selector));return budgets.find(b=>b.status==="active")??budgets[0]}async function setBudget(client,input){let selector={scope:input.scope};return client.fetch("/v1/budgets",{method:"POST",retry:{retries:0},body:{amount:input.amount,thresholds:input.thresholds,scope:selector.scope,...input.webhookUrl?{webhookUrl:input.webhookUrl}:{}}})}async function removeBudget(client,budgetId){await client.fetch(`/v1/budgets/${encodeURIComponent(budgetId)}`,{method:"DELETE"})}async function getTeamSpend(client,teamId,selector=TEAM_BUDGET,{retry}={}){let params=new URLSearchParams;selector.scope!=="team"&&params.set("scope",selector.scope);let qs=params.toString(),{data}=await client.fetch(`/teams/${encodeURIComponent(teamId)}/spend${qs?`?${qs}`:""}`,{method:"GET",...retry?{retry}:{}});return data??{currentSpend:null,avgSpend:null}}async function listBudgetAlerts(client,selector=TEAM_BUDGET,query={},{retry}={}){let params=new URLSearchParams(selectorQuery(selector));for(let[key,value]of Object.entries(query))value!==void 0&&params.set(key,String(value));let page=await client.fetch(`/v1/budgets/alerts?${params}`,{method:"GET",...retry?{retry}:{}});return{data:page.data??[],nextCursor:page.nextCursor}}export{getWebhook,TEAM_BUDGET,thresholdsForSet,hasPauseThreshold,pausePercentsOutside100,budgetAmountDollars,spendDollars,percentUsed,spendPayload,NO_RETRY,budgetPauses,budgetStatePayload,setSavedReceipt,removeReceipt,toBudgetState,formatUsdWhole,formatUsd,listBudgets,findBudget,setBudget,removeBudget,getTeamSpend,listBudgetAlerts};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,sinceOption,untilOption}from"./chunk-AMPJ6RWT.js";var usageCommand={name:"usage",aliases:[],summary:"Show billing usage and costs",description:"Show billing usage and costs for the current billing cycle or a custom date range",arguments:[],options:[{...sinceOption,description:"Start time: YYYY-MM-DD (midnight LA time), ISO 8601, or relative, like 7d (default: start of the current billing cycle)"},{...untilOption,description:"End time: YYYY-MM-DD (end of day LA time), ISO 8601, or relative; requires --since (default: now)"},{name:"from",shorthand:null,type:String,deprecated:!0},{name:"to",shorthand:null,type:String,deprecated:!0},{name:"breakdown",shorthand:null,type:String,argument:"PERIOD",description:"Show usage breakdown by time period instead of aggregated totals (daily, weekly, monthly)",deprecated:!1},{name:"group-by",shorthand:null,type:String,argument:"DIMENSION",description:"Group usage by a dimension instead of aggregated totals (project, region)",deprecated:!1},formatOption,jsonOption],examples:[{name:"Show usage for the current billing period",value:`${packageName} billing usage`},{name:"Show usage for a custom date range",value:`${packageName} billing usage --since 2025-01-01 --until 2025-01-31`},{name:"Show usage for the last 7 days",value:`${packageName} billing usage --since 7d`},{name:"Show daily usage breakdown",value:`${packageName} billing usage --breakdown daily`},{name:"Show weekly usage breakdown",value:`${packageName} billing usage --breakdown weekly`},{name:"Show usage grouped by project",value:`${packageName} billing usage --group-by project`},{name:"Show usage grouped by region",value:`${packageName} billing usage --group-by region`},{name:"Output usage data as JSON",value:`${packageName} billing usage --json`}]};export{usageCommand};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{getTeams}from"./chunk-SLCPSRDR.js";import{param}from"./chunk-3G3FQYMW.js";import{outputActionRequired}from"./chunk-5X635INY.js";import{getUser}from"./chunk-2J35YKA2.js";import{printAlignedLabel}from"./chunk-PKNEWN4W.js";import{getTeamByIdOrSlug}from"./chunk-2VBFQZ72.js";import{getCommandName,packageName}from"./chunk-VRH7LWOC.js";import{emoji,output_manager_default}from"./chunk-GZLYNPNU.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_build_utils=__toESM(require_build_utils(),1);function getScopeOrTeamFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"){let next=args[i+1];if(typeof next=="string"&&!next.startsWith("-"))return next;continue}if(arg.startsWith("--scope="))return arg.slice(8);if(arg.startsWith("--team="))return arg.slice(7)}return null}async function findExplicitTeam(client,scope){if(!scope)return;let knownUser=client.user??client.authConfig.cachedUser;if(!(knownUser&&(knownUser.id===scope||knownUser.username===scope)))try{let team=await getTeamByIdOrSlug(client,scope,{useCurrentTeam:!1});if(team.id===scope||team.slug===scope)return{type:"team",id:team.id,slug:team.slug}}catch(err){output_manager_default.debug(`Direct team lookup for scope "${scope}" failed: ${err}`)}}async function selectOrg(client,question,autoConfirm,searchable=!1,meta,description){let{config:{currentTeam}}=client,localConfigScope=client.localConfig?.scope,explicitScope=getScopeOrTeamFromArgv(client.argv)??(typeof localConfigScope=="string"?localConfigScope:null)??(0,import_build_utils.getPlatformEnv)("ORG_ID")??null;output_manager_default.spinner("Loading teams\u2026",1e3);let user,teams;try{let explicitTeam=await findExplicitTeam(client,explicitScope);if(explicitTeam)return explicitTeam;[user,teams]=await Promise.all([getUser(client),getTeams(client)])}finally{output_manager_default.stopSpinner()}let formatChoiceName=(name,slug,isCurrent,limited)=>{let title=`${name} (${slug})`;return isCurrent&&(title+=` ${import_chalk.default.bold("(current)")}`),limited&&(title+=` ${emoji("locked")}`),title},personalAccountChoice=user.version==="northstar"?[]:[{name:formatChoiceName(user.name||user.username,user.username,!currentTeam,user.limited),value:{type:"user",id:user.id,slug:user.username}}],orderedTeams=client.ignoresSavedTeam?teams:teams.sort(a=>a.id===user.defaultTeamId?-1:1),choices=[...personalAccountChoice,...orderedTeams.map(team=>({name:formatChoiceName(team.name||team.slug,team.slug,team.id===currentTeam,team.limited),value:{type:"team",id:team.id,slug:team.slug}}))],defaultChoiceIndex=Math.max(choices.findIndex(choice=>choice.value.id===currentTeam),0);meta&&(meta.choiceCount=choices.length);let matchExplicitScope=()=>{if(!explicitScope)return;let match=choices.find(c=>c.value.id===explicitScope||c.value.slug===explicitScope);if(match)return match.value;if(user.id===explicitScope||user.email===explicitScope||user.username===explicitScope)return choices.find(c=>c.value.type==="user")?.value};if(client.nonInteractive||!client.stdin.isTTY){let match=matchExplicitScope();if(match)return match;if(choices.length===1)return choices[0].value;let actionRequired={status:"action_required",reason:"missing_scope",message:choices.length>0?"Provide --scope explicitly. No default is applied in non-interactive mode.":"No teams available.",...choices.length>0&&{userActionRequired:!0,hint:"Ask the user which team to use, then run the matching command in next[]. Do not choose a team yourself."},choices:choices.map(c=>({id:c.value.id,name:c.value.slug})),next:choices.map(c=>({command:`${packageName} link --scope ${c.value.slug}`}))};outputActionRequired(client,actionRequired),output_manager_default.error(choices.length>0?`Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param("--scope <slug>")}, or run ${getCommandName("teams ls")} to list your teams.`:"No teams available."),process.exit(1)}let explicitOrg=matchExplicitScope();if(explicitOrg)return explicitOrg;if(choices.length===1)return printAlignedLabel("Team",choices[0].value.slug),choices[0].value;let descriptionLine=description?`
8
+ ${import_chalk.default.dim(` ${description}`)}`:"";if(!searchable)return await client.input.select({message:`${question}${descriptionLine}`,choices,default:choices[defaultChoiceIndex].value});let defaultChoice=choices[defaultChoiceIndex],initialChoices=defaultChoice?[defaultChoice,...choices.filter(choice=>choice!==defaultChoice)]:choices,pageSize=15,countHint=choices.length>pageSize?` ${import_chalk.default.dim(`(${choices.length} teams)`)}`:"";return await client.input.search({message:`${question}${countHint}${descriptionLine}`,pageSize,source:term=>{let searchTerm=term?.trim().toLowerCase();return searchTerm?choices.filter(choice=>choice.name.toLowerCase().includes(searchTerm)||choice.value.slug.toLowerCase().includes(searchTerm)):initialChoices}})}export{selectOrg};
@@ -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{teamCache}from"./chunk-2VBFQZ72.js";import{APIError,InvalidToken}from"./chunk-T2FCF46I.js";import{URLSearchParams}from"url";async function getTeams(client,opts={}){let{apiVersion=1}=opts;if(apiVersion===1){if(client.teams)return client.teams;if(client.teamsPromise)return client.teamsPromise;client.teamsPromise=fetchTeams(client,opts).then(result=>{let teams=Array.isArray(result)?result:result.teams;return client.teams=teams,teams});try{return await client.teamsPromise}finally{client.teamsPromise=void 0}}return fetchTeams(client,opts)}async function fetchTeams(client,opts={}){let{apiVersion=1}=opts,query="";if(opts.apiVersion===2){let params=new URLSearchParams({limit:String(typeof opts.limit=="number"?opts.limit:20)});opts.next&&params.set("next",String(opts.next)),query=`?${params}`}try{let body=await client.fetch(`/v${apiVersion}/teams${query}`,{useCurrentTeam:!1});if(apiVersion===1){let teams=body.teams||[];for(let team of teams)teamCache.set(team.id,team);return teams}return body}catch(error){throw error instanceof APIError&&error.status===403?new InvalidToken(client.authConfig.tokenSource):error}}export{getTeams};
7
+ import{teamCache}from"./chunk-2VBFQZ72.js";import{APIError,InvalidToken}from"./chunk-4DMKP6AO.js";import{URLSearchParams}from"url";async function getTeams(client,opts={}){let{apiVersion=1}=opts;if(apiVersion===1){if(client.teams)return client.teams;if(client.teamsPromise)return client.teamsPromise;client.teamsPromise=fetchTeams(client,opts).then(result=>{let teams=Array.isArray(result)?result:result.teams;return client.teams=teams,teams});try{return await client.teamsPromise}finally{client.teamsPromise=void 0}}return fetchTeams(client,opts)}async function fetchTeams(client,opts={}){let{apiVersion=1}=opts,query="";if(opts.apiVersion===2){let params=new URLSearchParams({limit:String(typeof opts.limit=="number"?opts.limit:20)});opts.next&&params.set("next",String(opts.next)),query=`?${params}`}try{let body=await client.fetch(`/v${apiVersion}/teams${query}`,{useCurrentTeam:!1});if(apiVersion===1){let teams=body.teams||[];for(let team of teams)teamCache.set(team.id,team);return teams}return body}catch(error){throw error instanceof APIError&&error.status===403?new InvalidToken(client.authConfig.tokenSource):error}}export{getTeams};
@@ -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{performDeviceCodeFlow}from"./chunk-5MPZSRYG.js";import{isAPIError}from"./chunk-T2FCF46I.js";import{output_manager_default}from"./chunk-GZLYNPNU.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,dpop:tokens.dpop}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let lowerHeader=header.toLowerCase(),scheme=lowerHeader.includes("bearer")?"bearer":"dpop",schemeIndex=lowerHeader.indexOf(scheme);if(schemeIndex===-1)return;let match=header.slice(schemeIndex+scheme.length).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};export{getEnvRecords,pullEnvRecords,parseEnv};
7
+ import{performDeviceCodeFlow}from"./chunk-4T57TXQ3.js";import{isAPIError}from"./chunk-4DMKP6AO.js";import{output_manager_default}from"./chunk-GZLYNPNU.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,dpop:tokens.dpop}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let lowerHeader=header.toLowerCase(),scheme=lowerHeader.includes("bearer")?"bearer":"dpop",schemeIndex=lowerHeader.indexOf(scheme);if(schemeIndex===-1)return;let match=header.slice(schemeIndex+scheme.length).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};export{getEnvRecords,pullEnvRecords,parseEnv};