cf 1.0.0-beta.20 → 1.0.0-beta.21

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 (290) hide show
  1. package/README.md +1 -1
  2. package/dist/_meta/commands.json +911 -751
  3. package/dist/_meta/schemas.json +401 -382
  4. package/dist/{abuse-reports-mKv00yPh.mjs → abuse-reports-CbUAnJxd.mjs} +1 -1
  5. package/dist/{access-CyRjTbhh.mjs → access-C-78DlxL.mjs} +1 -1
  6. package/dist/{accounts-BmF_YKvG.mjs → accounts-DEqQPxCz.mjs} +8 -15
  7. package/dist/{acm-BcIFiAb8.mjs → acm-jmhCq3Yh.mjs} +2 -3
  8. package/dist/{addressing-D6xVD7MM.mjs → addressing-BeYFpQvC.mjs} +12 -23
  9. package/dist/{agent-memory-Blldunhv.mjs → agent-memory-Chlovb7j.mjs} +5 -9
  10. package/dist/{ai-CU8tdTfC.mjs → ai-BndH3HYN.mjs} +2 -3
  11. package/dist/{ai-audit-Id3hq5pV.mjs → ai-audit-BUJ-70O_.mjs} +1 -1
  12. package/dist/{ai-gateway-BKeZ28CQ.mjs → ai-gateway-CCk7VKhL.mjs} +9 -15
  13. package/dist/{ai-search-DOiZEmn7.mjs → ai-search-BexET_wp.mjs} +6 -11
  14. package/dist/{ai-security-CioADDZi.mjs → ai-security-D4MxRlxX.mjs} +3 -5
  15. package/dist/{alerting-BzN1N3Se.mjs → alerting-rw8Oi3x7.mjs} +5 -9
  16. package/dist/{analytics-engine-CugCQfDe.mjs → analytics-engine-Bk7dQLcm.mjs} +1 -1
  17. package/dist/{analytics-Cte-DrzH.mjs → analytics-q-guNEOK.mjs} +1 -1
  18. package/dist/{api-security-CCs0g510.mjs → api-security-BDc6gkf1.mjs} +9 -17
  19. package/dist/{argo-BHBFZnmO.mjs → argo-CnLIqm0i.mjs} +1 -1
  20. package/dist/args-BAOHroBC.mjs +2 -0
  21. package/dist/{artifacts-BzAwvrCD.mjs → artifacts-Cil33dzV.mjs} +4 -7
  22. package/dist/{audit-logs-jWivEKCy.mjs → audit-logs--E2Eclb7.mjs} +1 -1
  23. package/dist/auth-B0lEsD_1.mjs +2 -0
  24. package/dist/{auth-BUQscD5b.mjs → auth-BcNLQji1.mjs} +1 -1
  25. package/dist/auth-BtZmY6sE.mjs +2 -0
  26. package/dist/{auth-token-T0aqYgl9.mjs → auth-token-aF5AVLlH.mjs} +1 -1
  27. package/dist/{autoconfig-CBdcYYf4.mjs → autoconfig-Dbp6J25P.mjs} +88 -88
  28. package/dist/{basin-catalog-_8w_4599.mjs → basin-catalog-dnVyzopm.mjs} +3 -5
  29. package/dist/{billing-Ce0WN0yw.mjs → billing-Fqp3jB2V.mjs} +2 -3
  30. package/dist/{blocks-CFAm0Ma3.mjs → blocks-BOQH-Won.mjs} +1 -1
  31. package/dist/{bot-management-DskcSr4B.mjs → bot-management-SEDgo1Xg.mjs} +1 -1
  32. package/dist/{botnet-feed-CmBm13-D.mjs → botnet-feed-DPqR4M0Y.mjs} +2 -3
  33. package/dist/{brand-protection-DTuFrsN0.mjs → brand-protection-B8vwKfM9.mjs} +2 -3
  34. package/dist/{browser-run-CXdzSOHa.mjs → browser-run-BybYDq3I.mjs} +3 -5
  35. package/dist/build-BqGmiORA.mjs +2 -0
  36. package/dist/build-CWlpWVBf.mjs +2 -0
  37. package/dist/{builds-_1u5Nx6f.mjs → builds-CvtOG-Gk.mjs} +8 -15
  38. package/dist/cache-Bme_d2Wx.mjs +36 -0
  39. package/dist/cf-fIBhEAxU.mjs +18 -0
  40. package/dist/chunk-DSGVRFIS-DHC6NOIj.mjs +2 -0
  41. package/dist/{chunk-2K52M2W5-iYNzknM1.mjs → chunk-XVBBSNW2-DfMyGS-l.mjs} +8 -8
  42. package/dist/{cli-DyhOdzMo.mjs → cli-CIKDqm-u.mjs} +3 -3
  43. package/dist/{client-side-security-DnnYaRsd.mjs → client-side-security-ZQeRoo1t.mjs} +2 -3
  44. package/dist/{cloud-connector-Ct6b6pz8.mjs → cloud-connector-BeunZlNV.mjs} +1 -1
  45. package/dist/{cloudflared-CHLpWU35.mjs → cloudflared-DbzoIouQ.mjs} +1 -1
  46. package/dist/{cloudforce-one-Rl6nCCm0.mjs → cloudforce-one-D20t9ojD.mjs} +26 -51
  47. package/dist/{command-BwgvUpNx.mjs → command-B3uWlw57.mjs} +1 -1
  48. package/dist/{command-DuLxEkGq.mjs → command-BGRucANI.mjs} +1 -1
  49. package/dist/{command-BONLLcyz.mjs → command-C6kE7BU0.mjs} +1 -1
  50. package/dist/{command-DOpykk8X.mjs → command-C9CNvZi_.mjs} +1 -1
  51. package/dist/{command-BRpBIju7.mjs → command-CQ5qHE7n.mjs} +1 -1
  52. package/dist/{command-CHGc-KZ7.mjs → command-CkZkTjIj.mjs} +1 -1
  53. package/dist/{command-BRXOUAGD.mjs → command-CqKRlHGv.mjs} +1 -1
  54. package/dist/{command-BwlIi3Bv.mjs → command-CtlD6MEi.mjs} +1 -1
  55. package/dist/{command-CXzje7qc.mjs → command-CzWWQv8j.mjs} +1 -1
  56. package/dist/{command-BMYi_gS-.mjs → command-DWWuXQV8.mjs} +1 -1
  57. package/dist/{command-CPDQPdss.mjs → command-DkwmylF2.mjs} +1 -1
  58. package/dist/{command-CMa807gY.mjs → command-MxFFWqMg.mjs} +1 -1
  59. package/dist/{command-BVO9UOuU.mjs → command-orlUsdgf.mjs} +1 -1
  60. package/dist/{command-CVoDyQnL.mjs → command-prWMAJbg.mjs} +1 -1
  61. package/dist/{command-0WS5I_JW.mjs → command-rUCxlpQI.mjs} +1 -1
  62. package/dist/command-resolution-DAQ4PWUt.mjs +2 -0
  63. package/dist/{completions-DMwrvK_S.mjs → completions-2Otv0HMd.mjs} +1 -1
  64. package/dist/{connector-interrupts-DyWilINb.mjs → connector-interrupts-Dfhxupmg.mjs} +1 -1
  65. package/dist/{connector-telemetry-events-BUW9qTOs.mjs → connector-telemetry-events-CLVpDTIa.mjs} +1 -1
  66. package/dist/{connector-telemetry-snapshots-Djs5QssR.mjs → connector-telemetry-snapshots-E_1tmNmQ.mjs} +1 -1
  67. package/dist/{connectors-e_cpzDEm.mjs → connectors-ChJpQFSl.mjs} +2 -3
  68. package/dist/{containers-CEH15JUu.mjs → containers-Cj5-9nUg.mjs} +6 -9
  69. package/dist/containers-CzAZfmnj.mjs +380 -0
  70. package/dist/{content-scan-B6Ahw9JA.mjs → content-scan-CIA_9PV8.mjs} +3 -5
  71. package/dist/{context-Sgba0fZP.mjs → context-DVh8Wyfs.mjs} +2 -2
  72. package/dist/{cps-uDD0SSJ-.mjs → cps-hJkqdsHx.mjs} +1 -1
  73. package/dist/{csam-scanner-BSUl7jGn.mjs → csam-scanner-cCVO3lNF.mjs} +1 -1
  74. package/dist/{custom-csrs-BDcXggph.mjs → custom-csrs-BrTWUZ0c.mjs} +2 -3
  75. package/dist/{custom-hostnames-UmIlwkwt.mjs → custom-hostnames-C4ft77oC.mjs} +4 -7
  76. package/dist/{custom-nameservers-D7kU6d--.mjs → custom-nameservers-BWfrZhD1.mjs} +2 -3
  77. package/dist/{custom-pages-CkhIQCfM.mjs → custom-pages-DqTMKtRc.mjs} +2 -3
  78. package/dist/{d1-myRLEAGs.mjs → d1-B58AA9PA.mjs} +3 -6
  79. package/dist/delegate-D7yYckA4.mjs +2 -0
  80. package/dist/delegate.mjs +1 -1
  81. package/dist/{deploy-BJqCpycz.mjs → deploy-CEROLAdh.mjs} +1 -1
  82. package/dist/deploy-context-Do89WayB.mjs +56 -0
  83. package/dist/{deploy-input-v2DryyLP.mjs → deploy-input-DyMuMsi5.mjs} +1 -1
  84. package/dist/{dev-S1PJi83q.mjs → dev-BaFS7kOM.mjs} +2 -2
  85. package/dist/{diagnostics-q65rcNIk.mjs → diagnostics-4gfYj7Pf.mjs} +2 -3
  86. package/dist/dialog-D5lus4M4.mjs +2 -0
  87. package/dist/discover-6kAmVMPp.mjs +2 -0
  88. package/dist/discover-C06Syc2B.mjs +2 -0
  89. package/dist/dist-BtzWfAjU.mjs +453 -0
  90. package/dist/dls-ClWVxTBg.mjs +16 -0
  91. package/dist/{dns-DhARjFQs.mjs → dns-CML-wxIt.mjs} +68 -68
  92. package/dist/{dns-firewall-BP6r9QG6.mjs → dns-firewall-CL0b3dJ1.mjs} +2 -3
  93. package/dist/{docs-CReGWDrw.mjs → docs-BeYBHwUN.mjs} +1 -1
  94. package/dist/{dotenv-Ck-6V1hm.mjs → dotenv-CmPRiXmU.mjs} +1 -1
  95. package/dist/{dry-run-BBjUQUhR.mjs → dry-run-gy0Hl9xo.mjs} +1 -1
  96. package/dist/{durable-objects-tOJy-5te.mjs → durable-objects-uZECeq_f.mjs} +1 -1
  97. package/dist/{email-auth-Bq9sq_2j.mjs → email-auth-CCNW798I.mjs} +1 -1
  98. package/dist/email-domains-1rD1d84O.mjs +12 -0
  99. package/dist/{email-routing-CYo4dp50.mjs → email-routing-CYv-LrbV.mjs} +4 -7
  100. package/dist/{email-security-CNtWET2d.mjs → email-security-CWEUYPYo.mjs} +16 -31
  101. package/dist/{email-sending-BvagNLRr.mjs → email-sending-DHSzCfJx.mjs} +3 -5
  102. package/dist/{errors-DpbAQQv8.mjs → errors-ol9sMqSe.mjs} +8 -8
  103. package/dist/{field-extractors-C9R3Qivh.mjs → field-extractors-CuBM_uO4.mjs} +2 -3
  104. package/dist/{firewall-DsgUY-Qv.mjs → firewall-SMIUSypF.mjs} +4 -7
  105. package/dist/flagship-D3v6iDdw.mjs +24 -0
  106. package/dist/{fraud-24l8dKyk.mjs → fraud-B2f7O15X.mjs} +1 -1
  107. package/dist/{google-tag-gateway-CAkudP5W.mjs → google-tag-gateway-BwOc62Gy.mjs} +1 -1
  108. package/dist/{gt-D6YemCLh.mjs → gt-BQkaDQDq.mjs} +1 -1
  109. package/dist/{healthchecks-CEGMe3lO.mjs → healthchecks-BQXHnihB.mjs} +3 -5
  110. package/dist/{hyperdrive-DLDaOU2O.mjs → hyperdrive-Bd6Yfje3.mjs} +2 -3
  111. package/dist/{iam-ChldOMSL.mjs → iam-qJPI1_aZ.mjs} +5 -9
  112. package/dist/{images-Ba9tS5wT.mjs → images-goHZJOxy.mjs} +6 -11
  113. package/dist/index.mjs +1 -1
  114. package/dist/init-CVx0Ya1E.mjs +43 -0
  115. package/dist/{intel-DbLRah4Y.mjs → intel-CwiqwJI9.mjs} +18 -21
  116. package/dist/interactive-CHcvofEp.mjs +2 -0
  117. package/dist/{interactive-d_lFnSev.mjs → interactive-D4E8PdaW.mjs} +31 -31
  118. package/dist/interactive-wQM7Blhm.mjs +2 -0
  119. package/dist/internal-5cnlw9mH.mjs +4 -0
  120. package/dist/{ips-BGyzyQLL.mjs → ips-KBxmXhvO.mjs} +1 -1
  121. package/dist/{k2-BVQ3MqEl.mjs → k2-KhIP5NFT.mjs} +2 -3
  122. package/dist/kv-CCem2sEY.mjs +12 -0
  123. package/dist/{lazy-command-D0I6itZs.mjs → lazy-command-BMhD5ffF.mjs} +1 -1
  124. package/dist/{leaked-credential-checks-Dga83Qy3.mjs → leaked-credential-checks-BkPZiwE2.mjs} +3 -5
  125. package/dist/live-BhHzxFna.mjs +4 -0
  126. package/dist/{load-balancers-D9cB6of8.mjs → load-balancers-17GBXdju.mjs} +5 -9
  127. package/dist/local-CAs8RWYW.mjs +2 -0
  128. package/dist/{local-B7ZJ78al.mjs → local-CSH3UMpD.mjs} +1 -1
  129. package/dist/{local-runtime-DB545Gqq.mjs → local-runtime-KOFLRZeZ.mjs} +1 -1
  130. package/dist/log-BWdaOGOW.mjs +66 -0
  131. package/dist/log-DZfik9Jk.mjs +2 -0
  132. package/dist/login-BTiflOun.mjs +2 -0
  133. package/dist/login-Buhvx6Fi.mjs +5 -0
  134. package/dist/{logpush-Ccmr0Y_I.mjs → logpush-BCCUxa4J.mjs} +3 -5
  135. package/dist/{logs-CZBMuuBC.mjs → logs-4CwupKRG.mjs} +2 -3
  136. package/dist/{magic-cloud-networking-BwOxZVql.mjs → magic-cloud-networking-Xy6SC-V-.mjs} +4 -7
  137. package/dist/{magic-network-monitoring-Cx5kKdbk.mjs → magic-network-monitoring-B8pRZp2g.mjs} +3 -5
  138. package/dist/{magic-transit-BJwg3sVK.mjs → magic-transit-CwfO3OOX.mjs} +36 -67
  139. package/dist/managed-defense-CtFLuvuB.mjs +18 -0
  140. package/dist/{managed-transforms-C-HMtesC.mjs → managed-transforms-Hto8OCBS.mjs} +2 -3
  141. package/dist/{mcp-bGKgzz6F.mjs → mcp-SQ0MAVUJ.mjs} +3 -5
  142. package/dist/{mesh-DeQIll19.mjs → mesh-C8A6tVqA.mjs} +3 -5
  143. package/dist/{migrate-B6HsPeFh.mjs → migrate-Dufxsb_F.mjs} +1 -1
  144. package/dist/{monetization-B-TIrpA5.mjs → monetization-CYVaCAe9.mjs} +3 -5
  145. package/dist/{network-BrjykU-I.mjs → network-CJBTdEM3.mjs} +5 -9
  146. package/dist/{network-interconnects-I06kbxIl.mjs → network-interconnects-CKlNFj3i.mjs} +3 -5
  147. package/dist/{o11y-Ba0Fa98_.mjs → o11y-5x2Q8CWm.mjs} +8 -15
  148. package/dist/{oauth-BH-uQd3C.mjs → oauth-BN6_FpYp.mjs} +1 -1
  149. package/dist/oauth-D_A8AcIS.mjs +4 -0
  150. package/dist/{oauth-clients-Dd5gvDqf.mjs → oauth-clients-qKXg8ZH3.mjs} +3 -5
  151. package/dist/{oauth-scopes-CXpH3Syj.mjs → oauth-scopes-Ct1jDyC5.mjs} +1 -1
  152. package/dist/{organization-DKPqwe3j.mjs → organization-lBQSeqS1.mjs} +3 -5
  153. package/dist/{organizations-Cq4iy-Yr.mjs → organizations-DEX8Er3g.mjs} +1 -1
  154. package/dist/{origin-post-quantum-encryption-DSB1sbYV.mjs → origin-post-quantum-encryption-DUsxVGCs.mjs} +1 -1
  155. package/dist/output-BJEgbI0G.mjs +2 -0
  156. package/dist/package-BqSbnt6u.mjs +2 -0
  157. package/dist/{page-rules-CDWTYaf7.mjs → page-rules-BMt6nt03.mjs} +2 -3
  158. package/dist/{pages-Dgtm51Uj.mjs → pages-Jxa92ECz.mjs} +7 -13
  159. package/dist/{pay-per-crawl-CHenxdhv.mjs → pay-per-crawl-Cv0044CZ.mjs} +3 -5
  160. package/dist/{pay-per-use-Bd5l0hBi.mjs → pay-per-use-DGEeG-dC.mjs} +2 -3
  161. package/dist/{pipelines-GsyD6nUM.mjs → pipelines-CEC78A3w.mjs} +5 -9
  162. package/dist/{precursor-mO-Zua09.mjs → precursor-Ba0Ejhzt.mjs} +1 -1
  163. package/dist/previews-DnZbUTym.mjs +6 -0
  164. package/dist/progress-CtGsPOpV.mjs +2 -0
  165. package/dist/prompt-YrI7ltMa.mjs +4 -0
  166. package/dist/{queues-D8cAr2lB.mjs → queues-Chq997uj.mjs} +6 -11
  167. package/dist/{r2-CJiJbG6b.mjs → r2-BFgZDs-F.mjs} +17 -33
  168. package/dist/{radar-PUZ_PCZ8.mjs → radar-DJdDzLJw.mjs} +1 -1
  169. package/dist/{raw-fetch-DSdFjojI.mjs → raw-fetch-BE3QgdTE.mjs} +1 -1
  170. package/dist/ready-Cok0aqke.mjs +4 -0
  171. package/dist/{realtime-X6uQsldp.mjs → realtime-BHWWCiKp.mjs} +10 -19
  172. package/dist/{registrar-BqZdUTss.mjs → registrar-9Y-1IQ0n.mjs} +1 -1
  173. package/dist/{registrar-sandbox-CmM3e1QN.mjs → registrar-sandbox-DTS1kRnb.mjs} +1 -1
  174. package/dist/{registry-D0tMkLv6.mjs → registry-Bm-GgDC3.mjs} +1 -1
  175. package/dist/{reporting-DFVz98Xg.mjs → reporting-D5RbKQJf.mjs} +1 -1
  176. package/dist/request-headers-KhW_hy36.mjs +2 -0
  177. package/dist/{request-tracers-BC1u2WDU.mjs → request-tracers-wxWCjmHo.mjs} +1 -1
  178. package/dist/{resource-sharing-CdEn5Iex.mjs → resource-sharing-BGoaVvJa.mjs} +5 -9
  179. package/dist/rolldown-runtime-BNtqjh-B.mjs +2 -0
  180. package/dist/{rules-B663VetJ.mjs → rules-Cd3EjhdF.mjs} +3 -5
  181. package/dist/{rulesets-p4EijVr6.mjs → rulesets-Bnz3rSBT.mjs} +4 -7
  182. package/dist/{rum-CHHXe4KK.mjs → rum-CK9HEe3O.mjs} +3 -5
  183. package/dist/run-Be6Js7D6.mjs +2 -0
  184. package/dist/run-DnZGQbq_.mjs +2 -0
  185. package/dist/sanitization-DkVWMHkc.mjs +2 -0
  186. package/dist/{schema-B38ojvsS.mjs → schema-DuLIZRhA.mjs} +1 -1
  187. package/dist/{schema-flags-z7yn0JZ_.mjs → schema-flags-BrDlFwLv.mjs} +1 -1
  188. package/dist/{scim-BMnUa4Oz.mjs → scim-UdqaWnOu.mjs} +3 -5
  189. package/dist/{secrets-store-EYrhEzVG.mjs → secrets-store-Bf5v96LC.mjs} +3 -5
  190. package/dist/{security-insights-C-AwDwXb.mjs → security-insights-BAGySlGu.mjs} +1 -1
  191. package/dist/{security-txt-CQMe8TD3.mjs → security-txt-D0fMmjHs.mjs} +2 -3
  192. package/dist/session-6xqrJWXy.mjs +2 -0
  193. package/dist/shared-DYRRG9A-.mjs +2 -0
  194. package/dist/signed-url-Ce0muRem.mjs +4 -0
  195. package/dist/{smart-shield-CHSuitaH.mjs → smart-shield-CCy7_M3j.mjs} +3 -5
  196. package/dist/{snippets-DGSBz4lg.mjs → snippets-Bc8m3HSV.mjs} +3 -5
  197. package/dist/spawn-BAEdy9kS.mjs +5 -0
  198. package/dist/{spectrum-59LhYG1t.mjs → spectrum-DtNX8WBX.mjs} +2 -3
  199. package/dist/{speed-CMCfoG3s.mjs → speed-TbkeWV_x.mjs} +3 -5
  200. package/dist/{sql-MxWaTDdj.mjs → sql-DI319y25.mjs} +1 -1
  201. package/dist/src-COwxoocl.mjs +2 -0
  202. package/dist/{src-J3Yss3VM.mjs → src-Dc6ojwUW.mjs} +5 -5
  203. package/dist/{ssl-DTTFZR9x.mjs → ssl-D0MIzFl2.mjs} +9 -17
  204. package/dist/startup-profile-CZYtQziF.mjs +2 -0
  205. package/dist/{startup-profile-bp348qmf.mjs → startup-profile-DlWrt4Fm.mjs} +5 -5
  206. package/dist/state-B3Uy1jPX.mjs +2 -0
  207. package/dist/{state-CqAtTENS.mjs → state-DazGSbRx.mjs} +1 -1
  208. package/dist/{stream-gVG_7si-.mjs → stream-4Mrb8HEo.mjs} +14 -27
  209. package/dist/tags-BP25qydR.mjs +22 -0
  210. package/dist/telemetry-CvZean4s.mjs +2 -0
  211. package/dist/telemetry-DKSJSLtq.mjs +2 -0
  212. package/dist/{tenant-custom-nameservers-DBmmUcxn.mjs → tenant-custom-nameservers-BzVP85Tq.mjs} +2 -3
  213. package/dist/{tenant-Qv_PC8gW.mjs → tenant-jmfZqEZ4.mjs} +1 -1
  214. package/dist/{tools-B1ajcUAF.mjs → tools-C-vmgYSv.mjs} +1 -1
  215. package/dist/{tunnels-CHNKPYRV.mjs → tunnels-BNswR1Dj.mjs} +4 -6
  216. package/dist/{turnstile-C60RxPo2.mjs → turnstile-BgsTP2fz.mjs} +2 -3
  217. package/dist/ui-Bo6DCvbS.mjs +2 -0
  218. package/dist/{update-check-BHarE3V9.mjs → update-check-BOF1hn_I.mjs} +1 -1
  219. package/dist/update-check-C7mfEeQ7.mjs +2 -0
  220. package/dist/update-check-worker.mjs +1 -1
  221. package/dist/{url-normalization-3t6Xpafi.mjs → url-normalization-Bqrs4-2F.mjs} +2 -3
  222. package/dist/{url-scanner-DNG__DiK.mjs → url-scanner-Dm4Fps5T.mjs} +1 -1
  223. package/dist/{user-B4i7OIFK.mjs → user-u_LxzLM4.mjs} +8 -15
  224. package/dist/{vectorize-y3PCQDDf.mjs → vectorize-DLGiOyd4.mjs} +3 -5
  225. package/dist/version-DmTuWNZ5.mjs +2 -0
  226. package/dist/{waiting-rooms-xkZLvPkT.mjs → waiting-rooms-DmgJgJXb.mjs} +4 -7
  227. package/dist/{web-assets-BlqHZywy.mjs → web-assets-rNhZWP-6.mjs} +7 -13
  228. package/dist/{web3-DGAJMcLv.mjs → web3-BVBdFt8E.mjs} +3 -5
  229. package/dist/{workers-cCNBx0Bc.mjs → workers-CjUKJvH8.mjs} +18 -22
  230. package/dist/{workers-builds-COKp3NfU.mjs → workers-builds-D3Q97l7X.mjs} +1 -1
  231. package/dist/{workers-for-platforms-CAtiWI_G.mjs → workers-for-platforms-C_fcw30y.mjs} +5 -9
  232. package/dist/{workers-vpc-ChBfXwPy.mjs → workers-vpc-CnRO3Stc.mjs} +2 -3
  233. package/dist/{workflows-BYhgJvyR.mjs → workflows-cpHFe5v6.mjs} +5 -9
  234. package/dist/{wrangler-migration-B12OR2bu.mjs → wrangler-migration-DQehjmoh.mjs} +74 -74
  235. package/dist/{zaraz-BW0kvRCK.mjs → zaraz-BRj0J7vK.mjs} +1 -1
  236. package/dist/{zero-trust-DSeWXkNV.mjs → zero-trust-CVZKDLCB.mjs} +75 -149
  237. package/dist/{zone-B-YJG2UA.mjs → zone-N6ccK70C.mjs} +1 -1
  238. package/dist/{zones-B8pqPHu8.mjs → zones-C4S_kpGz.mjs} +49 -52
  239. package/package.json +12 -12
  240. package/dist/auth-CdEGiJ5Y.mjs +0 -2
  241. package/dist/auth-DF_ml7rE.mjs +0 -2
  242. package/dist/build-BJHRK6qE.mjs +0 -2
  243. package/dist/build-D7s3a8zW.mjs +0 -2
  244. package/dist/cache-CDPUUv_O.mjs +0 -45
  245. package/dist/cf-3vj8dGYz.mjs +0 -18
  246. package/dist/chunk-DSGVRFIS-RUG6Dtqz.mjs +0 -2
  247. package/dist/containers-CcZHRM9g.mjs +0 -376
  248. package/dist/delegate-Tgfxa-MZ.mjs +0 -2
  249. package/dist/deploy-context-DIAl408H.mjs +0 -56
  250. package/dist/dialog-BnIgdgWi.mjs +0 -2
  251. package/dist/discover-DEjUARkU.mjs +0 -2
  252. package/dist/discover-P20XeGBF.mjs +0 -2
  253. package/dist/dist-CX6dDtzj.mjs +0 -449
  254. package/dist/dist-DAeCUX-u.mjs +0 -60
  255. package/dist/dls-CMTrCDjZ.mjs +0 -17
  256. package/dist/flagship-geGDHp9H.mjs +0 -28
  257. package/dist/init-C08hBFYn.mjs +0 -43
  258. package/dist/interactive-pjVqirHx.mjs +0 -2
  259. package/dist/kv-Cd8vbPWK.mjs +0 -15
  260. package/dist/local-CFZtOOxg.mjs +0 -2
  261. package/dist/log-CRbgNbDp.mjs +0 -3
  262. package/dist/login-C3Bahro9.mjs +0 -5
  263. package/dist/login-DvsRxI3E.mjs +0 -2
  264. package/dist/logo-matches-jeNkUxAq.mjs +0 -6
  265. package/dist/logos-pxN5aumY.mjs +0 -7
  266. package/dist/managed-defense-C_KLy4oB.mjs +0 -18
  267. package/dist/matches-DnjBnG-Y.mjs +0 -6
  268. package/dist/oauth-Cf3-g-kk.mjs +0 -4
  269. package/dist/output-CpiIVa7Q.mjs +0 -2
  270. package/dist/previews-oHUiD54J.mjs +0 -7
  271. package/dist/progress-B1dpmxCT.mjs +0 -2
  272. package/dist/prompt-Y5OBwDVE.mjs +0 -4
  273. package/dist/queries-CS0sYfte.mjs +0 -9
  274. package/dist/request-headers-Bg8_Idw3.mjs +0 -2
  275. package/dist/run-0EozpORq.mjs +0 -2
  276. package/dist/run-DKg70Sqf.mjs +0 -2
  277. package/dist/session-3DgztoAI.mjs +0 -2
  278. package/dist/shared-o8saqcSK.mjs +0 -2
  279. package/dist/source-AlTrHNem.mjs +0 -6
  280. package/dist/spawn-BZd__5sj.mjs +0 -10
  281. package/dist/startup-profile-DJsOtbVN.mjs +0 -2
  282. package/dist/state-Dvzl3aSj.mjs +0 -2
  283. package/dist/submit-wJYcQB8d.mjs +0 -4
  284. package/dist/tags-BwFKjaOr.mjs +0 -23
  285. package/dist/telemetry-BczXOpQn.mjs +0 -2
  286. package/dist/telemetry-CE15pfOU.mjs +0 -2
  287. package/dist/ui-CBhKUPys.mjs +0 -2
  288. package/dist/update-check-C3RhhXja.mjs +0 -2
  289. package/dist/url-info-By6VD20A.mjs +0 -4
  290. package/dist/version-izjB0Yrl.mjs +0 -2
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- import{A as e}from"./interactive-d_lFnSev.mjs";import"node:fs";import"node:path";import t,{stdin as n,stdout as r}from"node:process";import{ReadStream as i}from"node:tty";import{styleText as a}from"node:util";import o,*as s from"node:readline";const c=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),l=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,u=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,d=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,f=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,p=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,m=/\t{1,1000}/y,h=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,g=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,_=/\p{M}+/gu,v={limit:1/0,ellipsis:``},y=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?y(i,v,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,b=n.emojiWidth??2,x=n.regularWidth??1,S=n.wideWidth??2,C=[[g,x],[d,0],[f,o],[m,s],[h,b],[p,S]],w=0,T=0,E=e.length,D=0,O=!1,k=E,A=Math.max(0,r-a),j=0,M=0,N=0,P=0;outer:for(;;){if(M>j||T>=E&&T>w){let t=e.slice(j,M)||e.slice(w,T);D=0;for(let e of t.replaceAll(_,``)){let t=e.codePointAt(0)||0;if(P=l(t)?2:u(t)?S:x,N+P>A&&(k=Math.min(k,Math.max(j,w)+D)),N+P>r){O=!0;break outer}D+=e.length,N+=P}j=M=0}if(T>=E)break outer;for(let t=0,n=C.length;t<n;t++){let[n,i]=C[t];if(n.lastIndex=T,n.test(e)){if(D=n===p?c(e.slice(T,n.lastIndex)):n===h?1:n.lastIndex-T,P=D*i,N+P>A&&(k=Math.min(k,T+Math.floor((A-N)/i))),N+P>r){O=!0;break outer}N+=P,j=w,M=T,T=w=n.lastIndex;continue outer}}T+=1}return{width:O?A:N,index:O?k:E,truncated:O,ellipsed:O&&r>=a}},b={limit:1/0,ellipsis:``,ellipsisWidth:0},x=(e,t={})=>y(e,b,t).width,S=`]8;;`,C=RegExp(`(?:\\[(?<code>\\d+)m|\\${S}(?<uri>.*))`,`y`),w=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},T=e=>`[${e}m`,E=e=>`${S}${e}`,D=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:x(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=x(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(S,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},O=e=>{let t=e.split(` `),n=t.length;for(;n&&!x(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},k=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=x(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=x(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),D(s,r,t),c=x(s.at(-1)??``)}else{if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){D(s,r,t),c=x(s.at(-1)??``);continue}s.push(``),c=0}c+i>t&&n.wordWrap===!1?(D(s,r,t),c=x(s.at(-1)??``)):(s[s.length-1]+=r,c+=i)}}n.trim!==!1&&(s=s.map(e=>O(e)));let l=s.join(`
3
- `),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===`›`){C.lastIndex=e+1;let t=C.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
4
- `){a&&(r+=E(``));let e=i?w(i):void 0;i&&e&&(r+=T(e))}else t===`
5
- `&&(i&&w(i)&&(r+=T(i)),a&&(r+=E(a)))}return r},A=/\r?\n/;function j(e,t,n){return String(e).normalize().split(A).map(e=>k(e,t,n)).join(`
6
- `)}var M=e();function N(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a]?.disabled?N(a,t<0?-1:1,n):a}const P={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]]),messages:{cancel:`Canceled`,error:`Something went wrong`},withGuide:!0,accessible:void 0,date:{monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],messages:{required:`Please enter a valid date`,invalidMonth:`There are only 12 months in a year`,invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function ee(e){if(e!==void 0)return e;if(P.accessible!==void 0)return P.accessible;let t=process.env.ACCESSIBLE;return t!==void 0&&t!==``&&t!==`0`&&t!==`false`}function F(e,t){if(typeof e==`string`)return P.aliases.get(e)===t;for(let n of e)if(n!==void 0&&F(n,t))return!0;return!1}function te(e,t){if(e===t)return;let n=e.split(`
7
- `),r=t.split(`
8
- `),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const ne=globalThis.process.platform.startsWith(`win`),I=Symbol(`clack:cancel`);function re(e){return e===I}function L(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function ie({input:e=n,output:t=r,overwrite:a=!0,hideCursor:o=!0}={}){let c=s.createInterface({input:e,output:t,prompt:``,tabSize:1});s.emitKeypressEvents(e,c),e instanceof i&&e.isTTY&&e.setRawMode(!0);let l=(n,{name:r,sequence:i})=>{if(F([String(n),r,i],`cancel`)){o&&t.write(M.cursor.show),process.exit(0);return}if(!a)return;let c=r===`return`?0:-1,u=r===`return`?-1:0;s.moveCursor(t,c,u,()=>{s.clearLine(t,1,()=>{e.once(`keypress`,l)})})};return o&&t.write(M.cursor.hide),e.once(`keypress`,l),()=>{e.off(`keypress`,l),o&&t.write(M.cursor.show),e instanceof i&&e.isTTY&&!ne&&e.setRawMode(!1),c.terminal=!1,c.close()}}const R=e=>`columns`in e&&typeof e.columns==`number`?e.columns:80,z=e=>`rows`in e&&typeof e.rows==`number`?e.rows:20;function B(e,t,n,i=n,a=n,o){return j(t,R(e??r)-n.length,{hard:!0,trim:!1}).split(`
9
- `).map((e,t,r)=>{let s=o?o(e,t):e;return t===0?`${i}${s}`:t===r.length-1?`${a}${s}`:`${n}${s}`}).join(`
10
- `)}function ae(e,t){if(`~standard`in e){let n=e[`~standard`].validate(t);return n instanceof Promise?n.then(e=>e.issues?.at(0)?.message):n.issues?.at(0)?.message}return e(t)}var V=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame=``;_subscribers=/* @__PURE__ */ new Map;_cursor=0;state=`initial`;error=``;value;userInput=``;get accessible(){return ee(this.opts.accessible)}constructor(e,t=!0){let{input:i=n,output:a=r,render:o,signal:s,...c}=e;this.opts=c,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=s,this.input=i,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(I);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}this.rl=o.createInterface({input:this.input,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on(`keypress`,this.onKeypress),L(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(M.cursor.show),this.output.off(`resize`,this.render),L(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(M.cursor.show),this.output.off(`resize`,this.render),L(this.input,!1),e(I)})})}_isActionKey(e,t){return e===` `}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit(`value`,this.value)}_setUserInput(e,t){this.userInput=e??``,this.emit(`userInput`,this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:`u`}),this._setUserInput(``)}async onKeypress(e,t){if(this.state!==`validating`){if(this._track&&t.name!==`return`&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:`h`}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&P.aliases.has(t.name)&&this.emit(`cursor`,P.aliases.get(t.name)),P.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),this.emit(`key`,e,t),t?.name===`return`&&this._shouldSubmit(e,t)){if(this.opts.validate){let e=ae(this.opts.validate,this.value),t;e instanceof Promise?(this.state=`validating`,this.render(),t=await e):t=e,t&&(this.error=t instanceof Error?t.message:t,this.state=`error`,this.rl?.write(this.userInput))}this.state!==`error`&&(this.state=`submit`)}F([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
11
- `),L(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=j(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
12
- `).length-1;this.output.write(M.cursor.move(-999,e*-1))}render(){let e=j(this._render(this)??``,process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(M.cursor.hide);else{let t=te(this._prevFrame,e),n=z(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-n),i=Math.max(0,t.numLinesBefore-n),a=t.lines.find(e=>e>=r);if(a===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(M.cursor.move(0,a-i)),this.output.write(M.erase.lines(1));let t=e.split(`
13
- `);this.output.write(t[a]),this._prevFrame=e,this.output.write(M.cursor.move(0,t.length-a-1));return}if(t.lines.length>1){if(r<i)a=r;else{let e=a-i;e>0&&this.output.write(M.cursor.move(0,e))}this.output.write(M.erase.down());let t=e.split(`
14
- `).slice(a);this.output.write(t.join(`
15
- `)),this._prevFrame=e;return}}this.output.write(M.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},oe=class extends V{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`userInput`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(M.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}};let se=class extends V{_mask=`•`;get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state===`submit`||this.state===`cancel`)return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${a([`inverse`,`hidden`],`_`)}`;let t=this.masked,n=t.slice(0,this.cursor),r=t.slice(this.cursor,this.cursor+1),i=t.slice(this.cursor+1);return`${n}${a(`inverse`,r)}${i}`}clear(){this._clearUserInput()}constructor({mask:e,...t}){super(t),this._mask=e??`•`,this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value===void 0&&(this.value=``)})}},ce=class extends V{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let e=this._selectedValue;this.value=e===void 0?void 0:e.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n]?.disabled?N(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=N(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=N(this.cursor,1,this.options)}this.changeValue()})}};var le=class extends V{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),n=e.slice(this.cursor,this.cursor+1),r=e.slice(this.cursor+1);return`${t}${a(`inverse`,n)}${r}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function ue(){return t.platform===`win32`?!!t.env.CI||!!t.env.WT_SESSION||!!t.env.TERMINUS_SUBLIME||t.env.ConEmuTask===`{cmd::Cmder}`||t.env.TERM_PROGRAM===`Terminus-Sublime`||t.env.TERM_PROGRAM===`vscode`||t.env.TERM===`xterm-256color`||t.env.TERM===`alacritty`||t.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t.env.TERM!==`linux`}const H=ue(),de=()=>process.env.CI===`true`,U=(e,t)=>H?e:t,W=U(`◆`,`*`),G=U(`■`,`x`),fe=U(`▲`,`x`),K=U(`◇`,`o`),q=U(`│`,`|`),J=U(`└`,`—`),Y=U(`●`,`>`),X=U(`○`,` `),pe=U(`▪`,`•`),me=U(`●`,`•`),he=U(`◆`,`*`),ge=U(`▲`,`!`),_e=U(`■`,`x`),Z=e=>{switch(e){case`initial`:case`active`:return a(`cyan`,W);case`cancel`:return a(`red`,G);case`error`:return a(`yellow`,fe);case`submit`:return a(`green`,K);case`validating`:return a(`dim`,W)}},ve=e=>{switch(e){case`initial`:case`active`:return a(`cyan`,q);case`cancel`:return a(`red`,q);case`error`:return a(`yellow`,q);case`submit`:return a(`green`,q)}};function ye(e,t){let n=[`${t?`${a(`cyan`,q)} `:``}${e.join(` • `)}`];return t&&n.push(a(`cyan`,J)),n}const be=(e,t,n,r,i,a=!1)=>{let o=t,s=0;if(a)for(let t=r-1;t>=n;t--){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}else for(let t=n;t<r;t++){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}return{lineCount:o,removals:s}},xe=({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=1/0,columnPadding:o=0,rowPadding:s=4})=>{let c=R(r)-o,l=z(r),u=a(`dim`,`...`),d=Math.max(l-s,0),f=Math.max(Math.min(i,d),5),p=0;e>=f-3&&(p=Math.max(Math.min(e-f+3,t.length-f),0));let m=f<t.length&&p>0,h=f<t.length&&p+f<t.length,g=Math.min(p+f,t.length),_=[],v=0;m&&v++,h&&v++;let y=p+ +!!m,b=g-+!!h;for(let r=y;r<b;r++){let i=t[r],a=j(i?n(i,r===e):``,c,{hard:!0,trim:!1}).split(`
16
- `);_.push(a),v+=a.length}if(v>d){let t=0,n=0,r=v,i=e-y,a=d,o=()=>be(_,r,0,i,a),s=()=>be(_,r,i+1,_.length,a,!0);m?({lineCount:r,removals:t}=o(),r>a&&(h||--a,{lineCount:r,removals:n}=s())):(h||--a,{lineCount:r,removals:n}=s(),r>a&&(--a,{lineCount:r,removals:t}=o())),t>0&&(m=!0,_.splice(0,t)),n>0&&(h=!0,_.splice(_.length-n,n))}let x=[];m&&x.push(u);for(let e of _)for(let t of e)x.push(t);return h&&x.push(u),x},Se=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new oe({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??P.withGuide,i=`${Z(this.state)} `,o=r?`${a(`gray`,q)} `:``,s=B(e.output,e.message,o,i),c=`${r?`${a(`gray`,q)}
17
- `:``}${s}
18
- `,l=this.value?t:n;switch(this.state){case`submit`:return`${c}${r?`${a(`gray`,q)} `:``}${a(`dim`,l)}`;case`cancel`:return`${c}${r?`${a(`gray`,q)} `:``}${a([`strikethrough`,`dim`],l)}${r?`
19
- ${a(`gray`,q)}`:``}`;default:{let i=r?`${a(`cyan`,q)} `:``,o=r?a(`cyan`,J):``;return`${c}${i}${this.value?`${a(`green`,Y)} ${t}`:`${a(`dim`,X)} ${a(`dim`,t)}`}${e.vertical?r?`
20
- ${a(`cyan`,q)} `:`
21
- `:` ${a(`dim`,`/`)} `}${this.value?`${a(`dim`,X)} ${a(`dim`,n)}`:`${a(`green`,Y)} ${n}`}
22
- ${o}
23
- `}}}}).prompt()};`${a(`dim`,`↑/↓`)}`,`${a(`dim`,`Space:`)}`,`${a(`dim`,`Enter:`)}`;const Q={message:(e=[],{symbol:t=a(`gray`,q),secondarySymbol:n=a(`gray`,q),output:r=process.stdout,spacing:i=1,withGuide:o}={})=>{let s=[],c=o??P.withGuide,l=c?n:``,u=c?`${t} `:``,d=c?`${n} `:``;for(let e=0;e<i;e++)s.push(l);let f=Array.isArray(e)?e:e.split(`
24
- `);if(f.length>0){let[e,...r]=f;e.length>0?s.push(`${u}${e}`):s.push(c?t:``);for(let e of r)e.length>0?s.push(`${d}${e}`):s.push(c?n:``)}r.write(`${s.join(`
25
- `)}
26
- `)},info:(e,t)=>{Q.message(e,{...t,symbol:a(`blue`,me)})},success:(e,t)=>{Q.message(e,{...t,symbol:a(`green`,he)})},step:(e,t)=>{Q.message(e,{...t,symbol:a(`green`,K)})},warn:(e,t)=>{Q.message(e,{...t,symbol:a(`yellow`,ge)})},warning:(e,t)=>{Q.warn(e,t)},error:(e,t)=>{Q.message(e,{...t,symbol:a(`red`,_e)})}},Ce=e=>new se({validate:e.validate,mask:e.mask??pe,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??P.withGuide,n=`${t?`${a(`gray`,q)}
27
- `:``}${Z(this.state)} ${e.message}
28
- `,r=this.userInputWithCursor,i=this.masked;switch(this.state){case`error`:{let r=t?`${a(`yellow`,q)} `:``,o=t?`${a(`yellow`,J)} `:``,s=i??``;return e.clearOnError&&this.clear(),`${n.trim()}
29
- ${r}${s}
30
- ${o}${a(`yellow`,this.error)}
31
- `}case`submit`:return`${n}${t?`${a(`gray`,q)} `:``}${i?a(`dim`,i):``}`;case`cancel`:return`${n}${t?`${a(`gray`,q)} `:``}${i?a([`strikethrough`,`dim`],i):``}${i&&t?`
32
- ${a(`gray`,q)}`:``}`;default:return`${n}${t?`${a(`cyan`,q)} `:``}${r}
33
- ${t?a(`cyan`,J):``}
34
- `}}}).prompt(),we=e=>a(`magenta`,e),Te=({indicator:e=`dots`,onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:o=H?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],delay:s=H?80:120,signal:c,...l}={})=>{let u=de(),d,f,p=!1,m=!1,h=``,g,_=performance.now(),v=R(n),y=l?.styleFrame??we,b=e=>{let n=e>1?i??P.messages.error:r??P.messages.cancel;m=e===1,p&&(A(n,e),m&&typeof t==`function`&&t())},x=()=>b(2),S=()=>b(1),C=()=>{process.on(`uncaughtExceptionMonitor`,x),process.on(`unhandledRejection`,x),process.on(`SIGINT`,S),process.on(`SIGTERM`,S),process.on(`exit`,b),c&&c.addEventListener(`abort`,S)},w=()=>{process.removeListener(`uncaughtExceptionMonitor`,x),process.removeListener(`unhandledRejection`,x),process.removeListener(`SIGINT`,S),process.removeListener(`SIGTERM`,S),process.removeListener(`exit`,b),c&&c.removeEventListener(`abort`,S)},T=()=>{if(g===void 0)return;u&&n.write(`
35
- `);let e=j(g,v,{hard:!0,trim:!1}).split(`
36
- `);e.length>1&&n.write(M.cursor.up(e.length-1)),n.write(M.cursor.to(0)),n.write(M.erase.down())},E=e=>e.replace(/\.+$/,``),D=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},O=l.withGuide??P.withGuide,k=(t=``)=>{p=!0,d=ie({output:n}),h=E(t),_=performance.now(),O&&n.write(`${a(`gray`,q)}
37
- `);let r=0,i=0;C(),f=setInterval(()=>{if(u&&h===g)return;T(),g=h;let t=y(o[r]),a;if(u)a=`${t} ${h}...`;else if(e===`timer`)a=`${t} ${h} ${D(_)}`;else{let e=`.`.repeat(Math.floor(i)).slice(0,3);a=`${t} ${h}${e}`}let s=j(a,v,{hard:!0,trim:!1});n.write(s),r=r+1<o.length?r+1:0,i=i<4?i+.125:0},s)},A=(t=``,r=0,i=!1)=>{if(!p)return;p=!1,clearInterval(f),T();let o=r===0?a(`green`,K):r===1?a(`red`,G):a(`red`,fe);h=t??h,i||(e===`timer`?n.write(`${o} ${h} ${D(_)}
38
- `):n.write(`${o} ${h}
39
- `)),w(),d()};return{start:k,stop:(e=``)=>A(e,0),message:(e=``)=>{h=E(e??h)},cancel:(e=``)=>A(e,1),error:(e=``)=>A(e,2),clear:()=>A(``,0,!0),get isCancelled(){return m}}},Ee=[`${a(`dim`,`↑/↓`)} to navigate`,`${a(`dim`,`Enter:`)} confirm`],$=(e,t)=>e.includes(`
40
- `)?e.split(`
41
- `).map(e=>t(e)).join(`
42
- `):t(e),De=e=>{let t=(e,t)=>{if(e===void 0)return``;let n=e.label??String(e.value);switch(t){case`disabled`:return`${a(`gray`,X)} ${$(n,e=>a(`gray`,e))}${e.hint?` ${a(`dim`,`(${e.hint??`disabled`})`)}`:``}`;case`selected`:return`${$(n,e=>a(`dim`,e))}`;case`active`:return`${a(`green`,Y)} ${n}${e.hint?` ${a(`dim`,`(${e.hint})`)}`:``}`;case`cancelled`:return`${$(n,e=>a([`strikethrough`,`dim`],e))}`;default:return`${a(`dim`,X)} ${$(n,e=>a(`dim`,e))}`}},n=e.showInstructions??!0;return new ce({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??P.withGuide,i=`${Z(this.state)} `,o=`${ve(this.state)} `,s=B(e.output,e.message,o,i),c=`${r?`${a(`gray`,q)}
43
- `:``}${s}
44
- `;switch(this.state){case`submit`:{let n=r?`${a(`gray`,q)} `:``;return`${c}${B(e.output,t(this.options[this.cursor],`selected`),n)}`}case`cancel`:{let n=r?`${a(`gray`,q)} `:``;return`${c}${B(e.output,t(this.options[this.cursor],`cancelled`),n)}${r?`
45
- ${a(`gray`,q)}`:``}`}default:{let i=r?`${a(`cyan`,q)} `:``,o=c.split(`
46
- `).length,s=n?ye(Ee,r):r?[a(`cyan`,J)]:[],l=s.join(`
47
- `),u=s.length+1;return`${c}${i}${xe({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:i.length,rowPadding:o+u,style:(e,n)=>t(e,e.disabled?`disabled`:n?`active`:`inactive`)}).join(`
48
- ${i}`)}
49
- ${l}
50
- `}}}}).prompt()};`${a(`gray`,q)}`;const Oe=e=>new le({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??P.withGuide,n=`${`${t?`${a(`gray`,q)}
51
- `:``}${Z(this.state)} `}${e.message}
52
- `,r=e.placeholder&&e.placeholder.length>0?a(`inverse`,e.placeholder[0])+a(`dim`,e.placeholder.slice(1)):a([`inverse`,`hidden`],`_`),i=this.userInput?this.userInputWithCursor:r,o=this.value??``;switch(this.state){case`validating`:{let e=t?`${a(`cyan`,q)} `:``,r=t?a(`cyan`,J):``;return`${n}${e}${a(`dim`,i)}
53
- ${r} ${a(`dim`,`Validating...`)}
54
- `}case`error`:{let e=this.error?` ${a(`yellow`,this.error)}`:``,r=t?`${a(`yellow`,q)} `:``,o=t?a(`yellow`,J):``;return`${n.trim()}
55
- ${r}${i}
56
- ${o}${e}
57
- `}case`submit`:{let e=o?`${t?` `:``}${a(`dim`,o)}`:``;return`${n}${t?a(`gray`,q):``}${e}`}case`cancel`:{let e=o?` ${a([`strikethrough`,`dim`],o)}`:``,r=t?a(`gray`,q):``;return`${n}${r}${e}${o.trim()?`
58
- ${r}`:``}`}default:return`${n}${t?`${a(`cyan`,q)} `:``}${i}
59
- ${t?a(`cyan`,J):``}
60
- `}}}).prompt();export{Te as a,De as i,Q as n,Oe as o,Ce as r,re as s,Se as t};
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{n}from"./auth-BUQscD5b.mjs";import{a as r,t as i}from"./context-Sgba0fZP.mjs";import{t as a}from"./output-CpiIVa7Q.mjs";import{t as o}from"./dry-run-BBjUQUhR.mjs";import{t as s}from"./progress-B1dpmxCT.mjs";import{t as c}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as l,t as u}from"./body-parser-ChnyBsfm.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-Y5OBwDVE.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,409:`ConflictError`,500:`InternalServerError`}};function h(e){return e.usage(`$0 dls regional-services prefix-bindings create
3
-
4
- Create a DLS prefix binding`).option(`cidr`,{type:`string`,description:`IP prefix in CIDR notation to bind.`}).option(`prefix-id`,{type:`string`,description:`The ID of the parent IP prefix that contains the CIDR.`}).option(`region-key`,{type:`string`,description:`Region key from managed regions (e.g., "us", "eu").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a DLS prefix binding`,builder:h,handler:async e=>c({command:`dls regional-services prefix-bindings create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regional-services prefix-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({cidr:d(e.cidr,`cidr`,`text`),prefix_id:d(e[`prefix-id`],`prefix-id`,`text`),region_key:d(e[`region-key`],`region-key`,`text`)}):l(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:p}));a(n,{successLabel:`Created`});return}e.cidr===void 0&&(e.cidr=await f(`cidr`,`IP prefix in CIDR notation to bind.`)),e[`prefix-id`]===void 0&&(e[`prefix-id`]=await f(`prefix-id`,`The ID of the parent IP prefix that contains the CIDR.`)),e[`region-key`]===void 0&&(e[`region-key`]=await f(`region-key`,`Region key from managed regions (e.g., "us", "eu").`));let h=u({cidr:d(e.cidr,`cidr`,`text`),prefix_id:d(e[`prefix-id`],`prefix-id`,`text`),region_key:d(e[`region-key`],`region-key`,`text`)}),g=await s(`Creating`,async()=>c.send(m,{body:h,account_id:p}));a(g,{successLabel:`Created`})})};var _={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings/${t.binding_id}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 dls regional-services prefix-bindings delete <binding-id>
5
-
6
- Delete a DLS prefix binding`).positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <binding-id>`,describe:`Delete a DLS prefix binding`,builder:v,handler:async e=>c({command:`dls regional-services prefix-bindings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regional-services prefix-bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regional_services/prefix_bindings/${e[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(e[`binding-id`]))}`,pathParams:{"binding-id":String(e[`binding-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force})){process.stderr.write(`Aborted.
7
- `);return}let u=await s(`Deleting`,async()=>c.send(_,{account_id:l,binding_id:e[`binding-id`]}));a(u,{successLabel:`Deleted`})})};var b={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings/${t.binding_id}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function x(e){return e.usage(`$0 dls regional-services prefix-bindings edit <binding-id>
8
-
9
- Update a DLS prefix binding`).positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`region-key`,{type:`string`,description:`New region key to assign (e.g., "us", "eu", "cfcanary").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit <binding-id>`,describe:`Update a DLS prefix binding`,builder:x,handler:async e=>c({command:`dls regional-services prefix-bindings edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regional-services prefix-bindings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regional_services/prefix_bindings/${e[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(e[`binding-id`]))}`,pathParams:{"binding-id":String(e[`binding-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({region_key:d(e[`region-key`],`region-key`,`text`)}):l(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(b,{body:t,account_id:p,binding_id:e[`binding-id`]}));a(n,{successLabel:`Updated`});return}e[`region-key`]===void 0&&(e[`region-key`]=await f(`region-key`,`New region key to assign (e.g., "us", "eu", "cfcanary").`));let m=u({region_key:d(e[`region-key`],`region-key`,`text`)}),h=await s(`Updating`,async()=>c.send(b,{body:m,account_id:p,binding_id:e[`binding-id`]}));a(h,{successLabel:`Updated`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings/${t.binding_id}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function w(e){return e.usage(`$0 dls regional-services prefix-bindings get <binding-id>
10
-
11
- Get a DLS prefix binding`).positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <binding-id>`,describe:`Get a DLS prefix binding`,builder:w,handler:async e=>c({command:`dls regional-services prefix-bindings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regional-services prefix-bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regional_services/prefix_bindings/${e[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(e[`binding-id`]))}`,pathParams:{"binding-id":String(e[`binding-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(C,{account_id:l,binding_id:e[`binding-id`]}));a(u,{successLabel:`Loaded`})})};var E={method:`GET`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings`,query:[`cursor`,`per_page`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function D(e){return e.usage(`$0 dls regional-services prefix-bindings list
12
-
13
- List DLS prefix bindings for an account`).option(`cursor`,{type:`string`,description:`Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List DLS prefix bindings for an account`,builder:D,handler:async e=>c({command:`dls regional-services prefix-bindings list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf dls regional-services prefix-bindings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(E,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},k={command:`prefix-bindings`,describe:`Operations for regional-services.prefix-bindings`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`regional-services`,describe:`Operations for regional-services`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var j={method:`GET`,path:t=>e`/accounts/${t.account_id}/dls/regions/${t.region_id}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function M(e){return e.usage(`$0 dls regions get <region-id>
14
-
15
- Get a DLS region`).positional(`region-id`,{type:`string`,description:`UUID of the region (custom or managed) or region_key of a managed region.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <region-id>`,describe:`Get a DLS region`,builder:M,handler:async e=>c({command:`dls regions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regions/${e[`region-id`]==null?`<region-id>`:encodeURIComponent(String(e[`region-id`]))}`,pathParams:{"region-id":String(e[`region-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(j,{account_id:l,region_id:e[`region-id`]}));a(u,{successLabel:`Loaded`})})};var P={method:`GET`,path:t=>e`/accounts/${t.account_id}/dls/regions`,query:[`cursor`,`per_page`,`type`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function F(e){return e.usage(`$0 dls regions list
16
-
17
- List DLS regions for an account`).option(`cursor`,{type:`string`,description:`Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`type`,{type:`string`,description:`Filter regions by type. Omit to return all regions.`,choices:[`managed`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List DLS regions for an account`,builder:F,handler:async e=>c({command:`dls regions list`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`],type:e.type};if(e.dryRun){let e=await r();o({command:`cf dls regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dls/regions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(P,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},L={command:`regions`,describe:`Operations for regions`,builder:e=>e.command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`dls`,describe:`dls`,builder:e=>e.command(A).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{i as n,n as r}from"./auth-BUQscD5b.mjs";import{a as i,t as a}from"./context-Sgba0fZP.mjs";import{t as o}from"./output-CpiIVa7Q.mjs";import{t as s}from"./dry-run-BBjUQUhR.mjs";import{t as c}from"./progress-B1dpmxCT.mjs";import{t as l}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{a as u,n as d,r as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,n as g}from"./prompt-Y5OBwDVE.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/flagship/apps`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 flagship apps create
3
-
4
- Creates an app. The returned \`id\` is used in all subsequent flag, changelog, and evaluation requests.`).option(`name`,{type:`string`,description:`Name of the Flagship app (1–64 letters, numbers, hyphens, or underscores).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create app`,builder:v,handler:async e=>l({command:`flagship apps create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(_,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Name of the Flagship app (1–64 letters, numbers, hyphens, or underscores).`));let u=p({name:m(e.name,`name`,`text`)}),f=await c(`Creating`,async()=>n.send(_,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};function b(e){return e.usage("$0 flagship apps definitions get <app-id>\n\nReturns an app's evaluation-only flag definitions for SDKs that evaluate locally. Send the returned `ETag` in `If-None-Match` to avoid downloading unchanged definitions.").positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`if-none-match`,{type:`string`,description:"Previously returned ETag, or `*`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <app-id>`,describe:`Get flag definitions`,builder:b,handler:async e=>l({command:`flagship apps definitions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`if-none-match`]!==void 0&&(l[`If-None-Match`]=String(e[`if-none-match`])),e.dryRun){let t=await i();s({command:`cf flagship apps definitions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/definitions`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/flagship/apps/${encodeURIComponent(String(e[`app-id`]))}/definitions`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})},te={command:`definitions`,describe:`Operations for apps.definitions`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function S(e){return e.usage(`$0 flagship apps delete <app-id>
5
-
6
- Deletes an app and all its flags and changelog history. Returns 409 if any Worker still references this app via a Flagship binding.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <app-id>`,describe:`Delete app`,builder:S,handler:async e=>l({command:`flagship apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Delete this Flagship app, all of its flags, and all changelog history? This action cannot be undone.`})){process.stderr.write(`Aborted.
7
- `);return}let u=await c(`Deleting`,async()=>n.send(x,{account_id:l,app_id:e[`app-id`]}));o(u,{successLabel:`Deleted`})})};var w={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/evaluate`,query:[`flagKey`,`targetingKey`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function T(e){return e.usage(`$0 flagship apps evaluate get <app-id>
8
-
9
- Evaluates a flag against the provided context. Pass context attributes as query parameters; values are coerced to numbers or booleans where unambiguous. For low-latency in-Worker evaluation, prefer the Flagship binding over this endpoint.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`The flag key to evaluate.`,demandOption:!0}).option(`targeting-key`,{type:`string`,description:`Context targeting key (per OpenFeature spec); used for percentage rollout bucketing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <app-id>`,describe:`Evaluate flag from query context`,builder:T,handler:async e=>l({command:`flagship apps evaluate get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={flagKey:e[`flag-key`],targetingKey:e[`targeting-key`]};if(e.dryRun){let t=await i();s({command:`cf flagship apps evaluate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/evaluate`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(w,{account_id:u,app_id:e[`app-id`],...n}));o(d,{successLabel:`Loaded`})})},D={command:`evaluate`,describe:`Operations for apps.evaluate`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags/${t.flag_key}/changelog`,query:[`limit`,`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function k(e){return e.usage(`$0 flagship apps flags changelog list
10
-
11
- Returns the audit history for a flag, newest first. Each entry includes the event type and full flag state after the change; \`update\` entries include a field-level diff. Capped at 200 entries per flag.`).option(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`Case-sensitive key identifying the flag within the app.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List flag changelog entries`,builder:k,handler:async e=>l({command:`flagship apps flags changelog list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,cursor:e.cursor};if(e.dryRun){let t=await i();s({command:`cf flagship apps flags changelog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags/${e[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(e[`flag-key`]))}/changelog`,pathParams:{"app-id":String(e[`app-id`]??``),"flag-key":String(e[`flag-key`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(O,{account_id:u,app_id:e[`app-id`],flag_key:e[`flag-key`],...n}));o(d,{successLabel:`Loaded`})})},j={command:`changelog`,describe:`Operations for apps.flags.changelog`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var M={method:`POST`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function N(e){return e.usage(`$0 flagship apps flags create <app-id>
12
-
13
- Creates a flag. Returns 409 if the key already exists. \`type\` is always inferred from variation values; legacy request-side values are ignored.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`Optional operator-facing description. It does not affect flag evaluation.`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`json`]}).coerce(`type`,e=>m(e,`type`,`text`)).option(`variations`,{type:`string`,description:`Map of variation name to value. All values share the same type (boolean, string, number, or JSON object/array), and each serialized value stays within 10KB. Provide as a JSON object or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <app-id>`,describe:`Create flag`,builder:N,handler:async e=>l({command:`flagship apps flags create`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps flags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({default_variation:m(e[`default-variation`],`default-variation`,`text`),description:m(e.description,`description`,`text`),enabled:e.enabled,key:m(e.key,`key`,`text`),rules:u(e.rules,`rules`),type:e.type,variations:f(e.variations,`variations`,!0)},[[`variations`]]):d(e.body,[{path:[`variations`],flag:`variations`}])});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body,[{path:[`variations`],flag:`variations`}]),r=await c(`Creating`,async()=>n.send(M,{body:t,account_id:l,app_id:e[`app-id`]}));o(r,{successLabel:`Created`});return}if(e[`default-variation`]===void 0&&(e[`default-variation`]=await h(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(e.key===void 0&&(e.key=await h(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);if(e.variations===void 0)throw Error(`--variations is required (or pass --body with this field set).`);let g=p({default_variation:m(e[`default-variation`],`default-variation`,`text`),description:m(e.description,`description`,`text`),enabled:e.enabled,key:m(e.key,`key`,`text`),rules:u(e.rules,`rules`),type:e.type,variations:f(e.variations,`variations`,!0)},[[`variations`]]),_=await c(`Creating`,async()=>n.send(M,{body:g,account_id:l,app_id:e[`app-id`]}));o(_,{successLabel:`Created`})})};var F={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags/${t.flag_key}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function I(e){return e.usage(`$0 flagship apps flags delete <flag-key>
14
-
15
- Deletes a flag permanently. After deletion propagates, direct evaluations return not found; typed binding accessors may return the caller-supplied default. Cannot be undone.`).positional(`flag-key`,{type:`string`,description:`Case-sensitive key identifying the flag within the app.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <flag-key>`,describe:`Delete flag`,builder:I,handler:async e=>l({command:`flagship apps flags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps flags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags/${e[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(e[`flag-key`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"flag-key":String(e[`flag-key`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Delete this feature flag? After the deletion propagates, evaluation requests can no longer resolve it. This action cannot be undone.`})){process.stderr.write(`Aborted.
16
- `);return}let u=await c(`Deleting`,async()=>n.send(F,{account_id:l,app_id:e[`app-id`],flag_key:e[`flag-key`]}));o(u,{successLabel:`Deleted`})})};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/evaluate`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function z(e){return e.usage(`$0 flagship apps flags evaluate <app-id>
17
-
18
- Evaluates a flag against the provided context, passed as a JSON request body (OFREP-shaped) rather than query parameters. Returns the same response shape as the GET variant.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`context`,{type:`string`,description:`Evaluation attributes keyed by name. Values may be any JSON value; the context supports up to 100 entries and 32 KB. Provide as a JSON object or @path/to/file.json.`}).option(`flag-key`,{type:`string`,description:`Key of the flag to evaluate within the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`evaluate <app-id>`,describe:`Evaluate flag with JSON context`,builder:z,handler:async e=>l({command:`flagship apps flags evaluate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps flags evaluate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/evaluate`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({context:f(e.context,`context`),flagKey:m(e[`flag-key`],`flag-key`,`text`)},[[`context`]]):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(R,{body:t,account_id:l,app_id:e[`app-id`]}));o(r,{successLabel:`Created`});return}e[`flag-key`]===void 0&&(e[`flag-key`]=await h(`flag-key`,`Key of the flag to evaluate within the app.`));let u=p({context:f(e.context,`context`),flagKey:m(e[`flag-key`],`flag-key`,`text`)},[[`context`]]),g=await c(`Creating`,async()=>n.send(R,{body:u,account_id:l,app_id:e[`app-id`]}));o(g,{successLabel:`Created`})})};var ne={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags/${t.flag_key}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function V(e){return e.usage(`$0 flagship apps flags get <flag-key>
19
-
20
- Returns the full flag definition including rules, variations, and audit fields.`).positional(`flag-key`,{type:`string`,description:`Case-sensitive key identifying the flag within the app.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <flag-key>`,describe:`Get flag`,builder:V,handler:async e=>l({command:`flagship apps flags get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps flags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags/${e[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(e[`flag-key`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"flag-key":String(e[`flag-key`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ne,{account_id:l,app_id:e[`app-id`],flag_key:e[`flag-key`]}));o(u,{successLabel:`Loaded`})})};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags`,query:[`limit`,`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function W(e){return e.usage("$0 flagship apps flags list\n\nLists an app's flags ordered by key. Pass `cursor` from `result_info` to page forward; a null cursor indicates the last page.").option(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List flags`,builder:W,handler:async e=>l({command:`flagship apps flags list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,cursor:e.cursor};if(e.dryRun){let t=await i();s({command:`cf flagship apps flags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(U,{account_id:u,app_id:e[`app-id`],...n}));o(d,{successLabel:`Loaded`})})};var K={method:`PUT`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}/flags/${t.flag_key}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function q(e){return e.usage(`$0 flagship apps flags update <flag-key>
21
-
22
- Replaces the entire flag definition. Omitted fields are dropped, not preserved — read before writing. The path key identifies the flag and cannot be renamed by changing the body \`key\`. Each update appends a changelog entry.`).positional(`flag-key`,{type:`string`,description:`Case-sensitive key identifying the flag within the app.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`Optional operator-facing description. It does not affect flag evaluation.`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`json`]}).coerce(`type`,e=>m(e,`type`,`text`)).option(`variations`,{type:`string`,description:`Map of variation name to value. All values share the same type (boolean, string, number, or JSON object/array), and each serialized value stays within 10KB. Provide as a JSON object or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`update <flag-key>`,describe:`Update flag`,builder:q,handler:async e=>l({command:`flagship apps flags update`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps flags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/flags/${e[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(e[`flag-key`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"flag-key":String(e[`flag-key`]??``)},bodyKind:`json`,body:e.body===void 0?p({default_variation:m(e[`default-variation`],`default-variation`,`text`),description:m(e.description,`description`,`text`),enabled:e.enabled,key:m(e.key,`key`,`text`),rules:u(e.rules,`rules`),type:e.type,variations:f(e.variations,`variations`,!0)},[[`variations`]]):d(e.body,[{path:[`variations`],flag:`variations`}])});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body,[{path:[`variations`],flag:`variations`}]),r=await c(`Updating`,async()=>n.send(K,{body:t,account_id:l,app_id:e[`app-id`],flag_key:e[`flag-key`]}));o(r,{successLabel:`Updated`});return}if(e[`default-variation`]===void 0&&(e[`default-variation`]=await h(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(e.key===void 0&&(e.key=await h(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);if(e.variations===void 0)throw Error(`--variations is required (or pass --body with this field set).`);let g=p({default_variation:m(e[`default-variation`],`default-variation`,`text`),description:m(e.description,`description`,`text`),enabled:e.enabled,key:m(e.key,`key`,`text`),rules:u(e.rules,`rules`),type:e.type,variations:f(e.variations,`variations`,!0)},[[`variations`]]),_=await c(`Updating`,async()=>n.send(K,{body:g,account_id:l,app_id:e[`app-id`],flag_key:e[`flag-key`]}));o(_,{successLabel:`Updated`})})},Y={command:`flags`,describe:`Operations for apps.flags`,builder:e=>e.command(P).command(L).command(B).command(H).command(G).command(J).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function Z(e){return e.usage(`$0 flagship apps get <app-id>
23
-
24
- Returns an app's name and audit fields. Flag definitions are not included.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <app-id>`,describe:`Get app`,builder:Z,handler:async e=>l({command:`flagship apps get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(X,{account_id:l,app_id:e[`app-id`]}));o(u,{successLabel:`Loaded`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/flagship/apps`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function ae(e){return e.usage(`$0 flagship apps list
25
-
26
- Lists all Flagship apps in the account. Returns identity and audit fields only; flag definitions are not included.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List apps`,builder:ae,handler:async e=>l({command:`flagship apps list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf flagship apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ie,{account_id:l}));o(u,{successLabel:`Loaded`})})};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/flagship/apps/${t.app_id}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function $(e){return e.usage(`$0 flagship apps update <app-id>
27
-
28
- Updates an app. Only \`name\` is mutable.`).positional(`app-id`,{type:`string`,description:`Flagship app ID returned when the app was created.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the Flagship app (1–64 letters, numbers, hyphens, or underscores).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`update <app-id>`,describe:`Update app`,builder:$,handler:async e=>l({command:`flagship apps update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf flagship apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/flagship/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Q,{body:t,account_id:l,app_id:e[`app-id`]}));o(r,{successLabel:`Updated`});return}let u=p({name:m(e.name,`name`,`text`)}),f=await c(`Updating`,async()=>n.send(Q,{body:u,account_id:l,app_id:e[`app-id`]}));o(f,{successLabel:`Updated`})})},ce={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(y).command(C).command(re).command(oe).command(se).command(te).command(D).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`flagship`,describe:`flagship`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./src-J3Yss3VM.mjs";import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{R as n,n as r}from"./dist-CX6dDtzj.mjs";import{i,n as a,t as o}from"./autoconfig-CBdcYYf4.mjs";import{n as s}from"./version-izjB0Yrl.mjs";import{n as c}from"./delegate-Tgfxa-MZ.mjs";import{t as l}from"./project-settings-nBMEx1f-.mjs";import"./ui-CBhKUPys.mjs";import{n as u}from"./dist-DAeCUX-u.mjs";import{t as d}from"./progress-B1dpmxCT.mjs";import{n as f}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as p,r as m}from"./dialog-BnIgdgWi.mjs";import{basename as h,dirname as g,isAbsolute as _,join as v,relative as y,resolve as b}from"node:path";import{mkdir as x,readdir as S,stat as C,writeFile as w}from"node:fs/promises";const T={"@cloudflare/vite-plugin":`beta`,typescript:`^7.0.2`,vite:`^8.3.0`};function ee(e){return{".gitignore":M(),"cloudflare.config.ts":D(e),"package.json":A(e),...e.packageManager===`pnpm`?{"pnpm-workspace.yaml":te()}:{},"src/index.ts":k(),"tsconfig.json":j(),"vite.config.ts":O()}}function te(){return`# Approve build scripts needed by the generated Worker's dependencies.
3
- allowBuilds:
4
- esbuild: true
5
- workerd: true
6
- `}function E(e){return/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(e)?`^${e}`:`latest`}function D(e){return`import { bindings, defineConfig } from "cf/config";
7
- import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };
8
-
9
- export default defineConfig({
10
- worker: {
11
- name: ${JSON.stringify(e.name)},
12
- compatibilityDate: ${JSON.stringify(e.compatibilityDate)},
13
- entrypoint,
14
- env: {
15
- WORLD: bindings.text("World"),
16
- },
17
- },
18
- });
19
- `}function O(){return`import { cloudflare } from "@cloudflare/vite-plugin";
20
- import { defineConfig } from "vite";
21
-
22
- export default defineConfig({
23
- plugins: [cloudflare()],
24
- });
25
- `}function k(){return`import { env } from "cloudflare:workers";
26
-
27
- export default {
28
- fetch() {
29
- return new Response(\`Hello \${env.WORLD}!\`);
30
- },
31
- } satisfies ExportedHandler;
32
- `}function A(e){let t={name:e.name,private:!0,type:`module`,scripts:{dev:`cf dev`,build:`cf build`,deploy:`cf deploy`,typecheck:`cf workers types && tsc`},devDependencies:{"@cloudflare/vite-plugin":T[`@cloudflare/vite-plugin`],cf:E(e.cfVersion),typescript:T.typescript,vite:T.vite}};return`${JSON.stringify(t,null,` `)}\n`}function j(){return`${JSON.stringify({compilerOptions:{target:`es2024`,lib:[`es2024`],module:`preserve`,moduleResolution:`bundler`,types:[],strict:!0,noEmit:!0,allowImportingTsExtensions:!0,isolatedModules:!0,verbatimModuleSyntax:!0,skipLibCheck:!0},include:[`src`,`cloudflare.config.ts`,`.cloudflare/types`]},null,` `)}\n`}function M(){return`node_modules/
33
- dist/
34
- .cloudflare/
35
- .wrangler/
36
- .dev.vars*
37
- !.dev.vars.example
38
- .env*
39
- !.env.example
40
- *.log
41
- .DS_Store
42
- `}const N=[`npm`,`pnpm`,`yarn`,`bun`],P=[`install`,`package-manager`],F=/* @__PURE__ */ new Set([`.git`]);function I(e){return e.positional(`directory`,{type:`string`,describe:`Directory to initialize; created when missing (prompts when omitted; use . for the current directory)`}).option(`install`,{type:`boolean`,default:!0,describe:`Install dependencies after creating a new project (use --no-install to skip)`}).option(`package-manager`,{type:`string`,choices:N,describe:`Package manager for a new project (prompts when interactive)`})}async function L(e){let t=b(e.directory??await R());await H(t)===`not-empty`?await K(t,e):await U(t,e)}async function R(){return(await p(`Which directory do you want to initialize?`,{defaultValue:`.`,placeholder:`. (the current directory)`,fallbackError:`Pass the directory to initialize, for example ${e.code(`cf init my-worker`)}, or ${e.code(`cf init .`)} for the current directory.`})).trim()||`.`}function z(e){return{directory:e.directory,install:e.install??!0,packageManager:V(e.packageManager),mode:e.mode}}function B(e=process.env.npm_config_user_agent){return V(e?.split(`/`,1)[0])}function V(e){return N.find(t=>t===e)}async function H(e){let t;try{t=(await C(e)).isDirectory()}catch(e){if(ne(e)&&e.code===`ENOENT`)return`missing`;throw e}if(!t)throw Error(`Cannot initialize ${Z(e)} because it is not a directory.`);return(await S(e)).every(e=>F.has(e))?`empty`:`not-empty`}async function U(a,o){u.info(`Creating a new Worker in ${e.bold(a)}`,{spacing:0});let c=await G(o),l=n(h(a).toLowerCase().replace(/\s+/g,`-`)).replace(/-+$/,``),d=ee({name:l,compatibilityDate:r,cfVersion:s,packageManager:c});for(let[e,t]of Object.entries(d)){let n=v(a,e);await x(g(n),{recursive:!0}),await w(n,t,{flag:`wx`})}if(u.success(`Created the ${e.bold(l)} Worker in ${Z(a)}`,{spacing:0}),o.install){let n=`${c} install`,r=await i(n,a);if(r.exitCode!==0||r.signal)throw u.error(`Dependency installation failed. Run ${e.code(n)} in ${Z(a)} to try again.`,{spacing:0}),new t(r.exitCode,{signal:r.signal});await W(a,o.mode)}Y(a,[...o.install?[]:[{command:`${c} install`,description:`Install dependencies`}],...J()])}async function W(t,n){try{let{generateWorkerTypes:e}=await import(`./generate-D6V4Q58z.mjs`),r=await d(`Generating types`,()=>e({configPath:v(t,l),mode:n,includeRuntime:!0}));u.success(`Generated types in ${Z(r)}`,{spacing:0})}catch(n){let r=n instanceof Error?n.message:String(n);u.warn(`Could not generate types: ${r}\nRun ${e.code(`${q()} workers types`)} in ${Z(t)} to try again.`,{spacing:0})}}async function G(e){if(e.packageManager)return e.packageManager;let t=B()??`npm`;return e.install?m(`Which package manager do you want to use?`,{choices:N.map(e=>({title:e,value:e})),defaultOption:N.indexOf(t)}):t}async function K(t,n){let r=Z(t);u.info(`Setting up the existing project in ${e.bold(t)}`,{spacing:0}),(!n.install||n.packageManager)&&u.warn(`${e.code(`--no-install`)} and ${e.code(`--package-manager`)} only apply when creating a new project. Setting up an existing project uses its own package manager.`,{spacing:0});let i=process.cwd();process.chdir(t);let s=!1;try{let n=await o(t);if(!n)throw Error(`cf could not detect a project to set up in ${r}, and the directory is not empty.\nRun ${e.code(`cf init`)} in an empty directory, or pass a new directory name (for example, ${e.code(`cf init my-worker`)}).`);s=n.configured,s||await a(n)}finally{process.chdir(i)}s?u.info(`Found an existing Cloudflare configuration in ${r}.`,{spacing:0}):u.success(`Set up ${r} for Cloudflare.`,{spacing:0}),Y(t,J())}function q(){return c()?`npx cf`:`cf`}function J(){let e=q();return[{command:`${e} dev`,description:`Start a local development server`},{command:`${e} deploy`,description:`Deploy to Cloudflare`}]}function Y(t,n){let r=[...X(t).map(e=>({command:e})),...n],i=Math.max(...r.filter(e=>e.description).map(e=>e.command.length)),a=r.map(({command:t,description:n})=>n?` ${e.code(t)}${` `.repeat(i-t.length+2)}${e.muted(n)}`:` ${e.code(t)}`);u.message([e.bold(`Next steps`),...a].join(`
43
- `),{symbol:e.muted(`├`)})}function X(e){let t=y(process.cwd(),e);if(t===``)return[];let n=Q(t)?e:t;return[`cd ${/\s/.test(n)?JSON.stringify(n):n}`]}function Z(e){let t=y(process.cwd(),e);return t===``?`the current directory`:Q(t)?e:t}function Q(e){return e.startsWith(`..`)||_(e)}function ne(e){return e instanceof Error&&`code`in e}const $={command:`workers [directory]`,describe:`Create a new Workers project or set up an existing one`,builder:I,handler:async e=>{await L(z(e))}},re={command:`init [directory]`,describe:`Create a new Cloudflare project or set up an existing one`,builder:e=>I(e).command(f({...$,describe:`${$.describe} [default]`},{command:`init workers`,classification:{safeFlags:P}})).epilogue(`Running cf init without a subcommand runs cf init workers. An empty directory, or one containing only .git, receives a new hello-world Worker. A directory with other files is set up with autoconfig instead. When no directory is given, cf asks for one; non-interactive runs must pass it. Use ./workers to initialize a directory named workers.`),handler:async e=>{await L(z(e))}};export{re as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{t as isCI}from"./interactive-d_lFnSev.mjs";
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{i as n,n as r}from"./auth-BUQscD5b.mjs";import{a as i,t as a}from"./context-Sgba0fZP.mjs";import{t as o}from"./output-CpiIVa7Q.mjs";import{t as s}from"./dry-run-BBjUQUhR.mjs";import{t as c}from"./progress-B1dpmxCT.mjs";import{t as l}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as u,t as d}from"./body-parser-ChnyBsfm.mjs";import{n as f,t as p}from"./input-validation-D7z60HJH.mjs";import{a as m,n as h}from"./prompt-Y5OBwDVE.mjs";import{n as g,t as _}from"./raw-fetch-DSdFjojI.mjs";function v(e){return e.usage(`$0 kv bulk delete <namespace-id>
3
-
4
- Deletes up to 10,000 key-value pairs from the specified Workers KV namespace. Send a JSON array of the key names to delete. The result reports the number of successful deletions and any keys that failed and should be retried.`).positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`delete <namespace-id>`,describe:`Delete multiple key-value pairs`,builder:v,handler:async e=>l({command:`kv bulk delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let l=await r(e),d=e.local?t:await a();if(e.accountId=d,!await h({force:!!e.force,message:`This operation deletes the specified keys and their values from the Workers KV namespace.`}))process.stderr.write(`Aborted.
5
- `);else if(e.body){let t=u(e.body);if(Array.isArray(t)&&t.length>1e4){let r=Math.ceil(t.length/1e4),i=null;for(let a=0;a<t.length;a+=1e4){let o=t.slice(a,a+1e4),s=Math.floor(a/1e4)+1;i=await c(`Deleting: batch ${s}/${r}`,async()=>n(l,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/bulk/delete`,{body:o}))}o(i,{successLabel:`Deleted`});return}let r=await c(`Deleting`,async()=>n(l,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/bulk/delete`,{body:t}));o(r,{successLabel:`Deleted`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}/bulk/get`,body:`json`};function x(e){return e.usage("$0 kv bulk get <namespace-id>\n\nRetrieves the text-based values of up to 100 keys from the specified Workers KV namespace. The result maps each requested key to its value. Set `type` to `json` to parse JSON values instead of returning strings, and set `withMetadata` to `true` to include metadata with each value. Binary values are not supported by this operation.").positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`keys`,{type:`string`,array:!0,description:`Array of keys to retrieve (maximum of 100).`}).option(`type`,{type:`string`,description:"Return values as strings with `text`, or parse stored JSON values with `json`.",choices:[`text`,`json`],default:`text`}).coerce(`type`,e=>f(e,`type`,`text`)).option(`with-metadata`,{type:`boolean`,description:`Whether to include metadata in the response.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`get <namespace-id>`,describe:`Get multiple key-value pairs`,builder:x,handler:async e=>l({command:`kv bulk get`,classification:{safeFlags:[`type`,`with-metadata`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv bulk get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/bulk/get`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({keys:e.keys,type:e.type,withMetadata:e[`with-metadata`]}):u(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n.send(b,{body:t,account_id:l,namespace_id:e[`namespace-id`]}));o(r,{successLabel:`Created`});return}if(e.keys===void 0)throw Error(`--keys is required (or pass --body with this field set).`);let f=d({keys:e.keys,type:e.type,withMetadata:e[`with-metadata`]}),p=await c(`Creating`,async()=>n.send(b,{body:f,account_id:l,namespace_id:e[`namespace-id`]}));o(p,{successLabel:`Created`})})};function C(e){return e.usage("$0 kv bulk put <namespace-id>\n\nWrites up to 10,000 key-value pairs to the specified Workers KV namespace from a JSON array, with optional metadata and expiration settings for each pair. Existing values and expirations are overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will not expire. If both are set, `expiration_ttl` takes precedence. The entire request must be 100 megabytes or less. The result reports the number of successful writes and any keys that failed and should be retried.").positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`put <namespace-id>`,describe:`Write multiple key-value pairs`,builder:C,handler:async e=>l({command:`kv bulk put`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv bulk put`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/bulk`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let l=await r(e),d=e.local?t:await a();if(e.accountId=d,e.body){let t=u(e.body);if(Array.isArray(t)&&t.length>1e4){let r=Math.ceil(t.length/1e4),i=null;for(let a=0;a<t.length;a+=1e4){let o=t.slice(a,a+1e4),s=Math.floor(a/1e4)+1;i=await c(`Updating: batch ${s}/${r}`,async()=>n(l,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/bulk`,{body:o}))}o(i,{successLabel:`Updated`});return}let r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/bulk`,{body:t}));o(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},T={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(y).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var E={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}/values/${t.key_name}`};function D(e){return e.usage("$0 kv keys delete <key-name>\n\nDeletes the specified key and its value from the Workers KV namespace. Use URL-encoding for special characters (for example, `:`, `!`, `%`) in the key name when constructing the request URL.").positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <key-name>`,describe:`Delete a key-value pair`,builder:D,handler:async e=>l({command:`kv keys delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/values/${e[`key-name`]==null?`<key-name>`:encodeURIComponent(String(e[`key-name`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``),"key-name":String(e[`key-name`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the selected key-value pair from the Workers KV namespace.`})){process.stderr.write(`Aborted.
6
- `);return}let u=await c(`Deleting`,async()=>n.send(E,{account_id:l,namespace_id:e[`namespace-id`],key_name:e[`key-name`]}));o(u,{successLabel:`Deleted`})})};function k(e){return e.usage("$0 kv keys get <key-name>\n\nReturns the value stored under the specified key in the Workers KV namespace as raw bytes. Use URL-encoding for special characters (for example, `:`, `!`, `%`) in the key name when constructing the request URL. If the key-value pair expires, the `expiration` response header contains its expiration time in seconds since the UNIX epoch.").positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const A={command:`get <key-name>`,describe:`Get a key's value`,builder:k,handler:async e=>l({command:`kv keys get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/values/${e[`key-name`]==null?`<key-name>`:encodeURIComponent(String(e[`key-name`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``),"key-name":String(e[`key-name`]??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await a();e.accountId=n;let o=await c(`Loading`,async()=>_(`/accounts/${n}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/values/${encodeURIComponent(String(e[`key-name`]))}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));g(e.text===!0?o.toString(`utf-8`):o)})};var j={method:`GET`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}/keys`,query:[`limit`,`prefix`,`cursor`]};function M(e){return e.usage("$0 kv keys list\n\nLists key names in the specified Workers KV namespace, with expiration times and metadata when present. Use `prefix` to filter names and `cursor` to request the next page. Values are not included.").option(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:"Maximum number of keys to return in one response. Pass `result_info.cursor` from the response as `cursor` to request the next page."}).option(`prefix`,{type:`string`,description:`Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.`}).option(`cursor`,{type:`string`,description:"Opaque pagination token from `result_info.cursor` in the previous response. Pass it unchanged to request the next page of keys."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List keys in a namespace`,builder:M,handler:async e=>l({command:`kv keys list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,prefix:e.prefix,cursor:e.cursor};if(e.dryRun){let t=await i();s({command:`cf kv keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/keys`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(j,{account_id:u,namespace_id:e[`namespace-id`],...n}));o(d,{successLabel:`Loaded`})})};function P(e){return e.usage("$0 kv keys put <key-name>\n\nWrites a value under the specified key in the Workers KV namespace, creating the key-value pair or replacing its existing value, expiration, and metadata. Send the value as an `application/octet-stream` request body, or use `multipart/form-data` with a `value` part and an optional JSON `metadata` part. Use URL-encoding for special characters (for example, `:`, `!`, `%`) in the key name when constructing the request URL. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will not expire. If both are set, `expiration_ttl` takes precedence.").positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`expiration`,{type:`number`,description:`Expires the key at a certain time, measured in number of seconds since the UNIX epoch.`}).option(`expiration-ttl`,{type:`number`,description:"Number of seconds until the key expires. Must be at least 60. Takes precedence over `expiration` when both are specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A byte sequence to be stored, up to 25 MiB in length.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`Associates arbitrary JSON data with a key/value pair.`})}const F={command:`put <key-name>`,describe:`Write a key-value pair with optional metadata`,builder:P,handler:async e=>l({command:`kv keys put`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={expiration:e.expiration,expiration_ttl:e[`expiration-ttl`]};if(e.dryRun){let t=await i();s({command:`cf kv keys put`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/values/${e[`key-name`]==null?`<key-name>`:encodeURIComponent(String(e[`key-name`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``),"key-name":String(e[`key-name`]??``)},query:l,bodyKind:e.metadata===void 0?`octet-stream`:`multipart`,body:e.metadata===void 0?e.body:{body:e.body,file:e.file,metadata:e.metadata}});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.metadata!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`value`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`value`,e.body);e.metadata!==void 0&&t.append(`metadata`,String(f(e.metadata,`metadata`,`text`)??``));let r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/values/${encodeURIComponent(String(e[`key-name`]))}`,{body:t}));o(r,{successLabel:`Updated`})}else if(e.file){let t=p(e.file),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/values/${encodeURIComponent(String(e[`key-name`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}}));o(r,{successLabel:`Updated`})}else if(e.body){let t=f(e.body,`body`,`binary`),r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(e[`namespace-id`]))}/values/${encodeURIComponent(String(e[`key-name`]))}${r?`?`+r:``}`,{body:t,headers:{"Content-Type":`application/octet-stream`}}));o(i,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},ee={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(O).command(A).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}/metadata/${t.key_name}`};function L(e){return e.usage("$0 kv metadata get <key-name>\n\nReturns the JSON metadata associated with the specified key in the Workers KV namespace, without retrieving its value. Use URL-encoding for special characters (for example, `:`, `!`, `%`) in the key name when constructing the request URL.").positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <key-name>`,describe:`Get a key's metadata`,builder:L,handler:async e=>l({command:`kv metadata get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}/metadata/${e[`key-name`]==null?`<key-name>`:encodeURIComponent(String(e[`key-name`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``),"key-name":String(e[`key-name`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(I,{account_id:l,namespace_id:e[`namespace-id`],key_name:e[`key-name`]}));o(u,{successLabel:`Loaded`})})},z={command:`metadata`,describe:`Operations for metadata`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces`,body:`json`};function V(e){return e.usage(`$0 kv namespaces create
7
-
8
- Creates a Workers KV namespace in the specified account with the given title. Returns \`400\` if the account already owns a namespace with that title; an existing namespace must be explicitly deleted before it can be replaced. An optional jurisdiction restricts where data is durably stored and can only be set at creation time.`).option(`jurisdiction`,{type:`string`,description:`Specify the jurisdiction to restrict the KV namespace to durably store data within. Can only be set at namespace creation time.`,choices:[`eu`,`fedramp`,`us`]}).coerce(`jurisdiction`,e=>f(e,`jurisdiction`,`text`)).option(`namespace-mode`,{type:`string`,description:"The mode of the Workers KV namespace. Specify `instant` when creating a namespace to create a KV Instant namespace. Omit this field when creating a namespace to create a classic namespace. Currently, `instant` is the only supported explicit value.",choices:[`instant`]}).coerce(`namespace-mode`,e=>f(e,`namespace-mode`,`text`)).option(`title`,{type:`string`,description:`Human-readable string name for a Workers KV namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`create`,describe:`Create a namespace`,builder:V,handler:async e=>l({command:`kv namespaces create`,classification:{safeFlags:[`jurisdiction`,`namespace-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({jurisdiction:e.jurisdiction,mode:e[`namespace-mode`],title:f(e.title,`title`,`text`)}):u(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n.send(B,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.title===void 0&&(e.title=await m(`title`,`Human-readable string name for a Workers KV namespace.`));let p=d({jurisdiction:e.jurisdiction,mode:e[`namespace-mode`],title:f(e.title,`title`,`text`)}),h=await c(`Creating`,async()=>n.send(B,{body:p,account_id:l}));o(h,{successLabel:`Created`})})};var U={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}`};function W(e){return e.usage(`$0 kv namespaces delete <namespace-id>
9
-
10
- Deletes the specified Workers KV namespace and its stored key-value pairs from the account.`).positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const G={command:`delete <namespace-id>`,describe:`Delete a namespace`,builder:W,handler:async e=>l({command:`kv namespaces delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the selected Workers KV namespace and all of its key-value pairs.`})){process.stderr.write(`Aborted.
11
- `);return}let u=await c(`Deleting`,async()=>n.send(U,{account_id:l,namespace_id:e[`namespace-id`]}));o(u,{successLabel:`Deleted`})})};var K={method:`GET`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}`};function q(e){return e.usage(`$0 kv namespaces get <namespace-id>
12
-
13
- Returns the Workers KV namespace for the specified account and namespace ID.`).positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <namespace-id>`,describe:`Get a namespace`,builder:q,handler:async e=>l({command:`kv namespaces get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(K,{account_id:l,namespace_id:e[`namespace-id`]}));o(u,{successLabel:`Loaded`})})};var Y={method:`GET`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces`,query:[`page`,`per_page`,`order`,`direction`]};function X(e){return e.usage("$0 kv namespaces list\n\nLists Workers KV namespaces owned by the specified account. Use `page` and `per_page` to select a page of results, and `order` and `direction` to control sorting.").option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`order`,{type:`string`,description:"Namespace field to sort by (`id` or `title`).",choices:[`id`,`title`]}).option(`direction`,{type:`string`,description:"Sort namespaces in ascending (`asc`) or descending (`desc`) order.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List namespaces`,builder:X,handler:async e=>l({command:`kv namespaces list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf kv namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/storage/kv/namespaces`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Y,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/storage/kv/namespaces/${t.namespace_id}`,body:`json`};function $(e){return e.usage(`$0 kv namespaces update <namespace-id>
14
-
15
- Changes the title of the specified Workers KV namespace and returns the updated namespace. The namespace ID and stored key-value pairs are unchanged.`).positional(`namespace-id`,{type:`string`,description:`ID of the Workers KV namespace.`,demandOption:!0}).option(`title`,{type:`string`,description:`Human-readable string name for a Workers KV namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`update <namespace-id>`,describe:`Rename a namespace`,builder:$,handler:async e=>l({command:`kv namespaces update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf kv namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/storage/kv/namespaces/${e[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(e[`namespace-id`]))}`,pathParams:{"namespace-id":String(e[`namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({title:f(e.title,`title`,`text`)}):u(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Updating`,async()=>n.send(Q,{body:t,account_id:l,namespace_id:e[`namespace-id`]}));o(r,{successLabel:`Updated`});return}e.title===void 0&&(e.title=await m(`title`,`Human-readable string name for a Workers KV namespace.`));let p=d({title:f(e.title,`title`,`text`)}),h=await c(`Updating`,async()=>n.send(Q,{body:p,account_id:l,namespace_id:e[`namespace-id`]}));o(h,{successLabel:`Updated`})})},ne={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(H).command(G).command(J).command(Z).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},re={command:`kv`,describe:`kv`,builder:e=>e.command(T).command(ee).command(z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{re as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{r as createLocalFetch}from"./local-B7ZJ78al.mjs";
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{n as t}from"./dist-DAeCUX-u.mjs";function n(e){return{output:process.stderr,spacing:0,...e}}const r={info:(e,r)=>t.info(e,n(r)),warn:(e,r)=>t.warn(e,n(r))};function i(...t){let n=` `.repeat(3);process.stderr.write(`\n${t.map(t=>n+e.code(t)).join(`
3
- `)}\n\n`)}export{i as n,r as t};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{m as t,o as n}from"./chunk-2K52M2W5-iYNzknM1.mjs";import"./ui-CBhKUPys.mjs";import{n as r,t as i}from"./log-CRbgNbDp.mjs";import{c as a,d as o,f as s,g as c,h as l,i as u,o as d,r as f,s as p,u as m}from"./oauth-Cf3-g-kk.mjs";import{n as h,t as g}from"./output-CpiIVa7Q.mjs";import _ from"node:path";function v(e,t,n){if(!e.profile)return;let r=n?` ${n}`:``;throw Error(`The --profile flag cannot be used with \`cf auth ${t}\`.${r}`)}function y(){if(n({allowGlobalAuthKey:!1})!==void 0)throw Error(`Cannot manage auth profiles while CLOUDFLARE_API_TOKEN is set. Unset CLOUDFLARE_API_TOKEN and try again.`)}const b={command:`create <name>`,describe:`Create or re-authenticate a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name for the auth profile`,demandOption:!0}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async e=>{v(e,`create`,"Pass the profile name as the command argument: `cf auth create <name>`."),y(),t(e.name);let n=d().configs.exists(e.name);await m({browser:e.browser,device:e.device,scopes:e.scopes,profile:e.name}),h(n?`Profile "${e.name}" re-authenticated.`:`Profile "${e.name}" created.`),i.info(`To use this profile in a directory, run:`),r(`cf auth activate ${e.name}`)}},x={command:`delete <name>`,describe:`Delete a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to delete`,demandOption:!0}),handler:async n=>{v(n,`delete`),y(),t(n.name);let r=d();if(!r.configs.exists(n.name))throw Error(`Profile "${n.name}" does not exist.`);let a=r.bindings.removeAllBindingsForProfile(n.name);a.length>0&&i.info([`Removed directory bindings:`,...a.map(e=>` ${e}`)].join(`
3
- `)),await o(n.name),r.configs.delete(n.name),h(`Profile "${n.name}" deleted.`);let s=r.bindings.getProfileForDirectory(process.cwd());s?i.info(`Active profile for this directory: ${s}.`):r.configs.exists(`default`)?i.info(`This directory now uses the default profile.`):i.info(`No active profile for this directory. Run ${e.code(`cf auth login`)} to set up the default profile, or ${e.code(`cf auth create <name>`)} to create a named profile.`)}},S={command:`activate <name> [dir]`,describe:`Bind a named auth profile to a directory`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to activate`,demandOption:!0}).positional(`dir`,{type:`string`,description:`Directory to bind the profile to (defaults to current directory)`}),handler:e=>{v(e,`activate`,"Pass the profile name as the command argument: `cf auth activate <name>`."),y(),t(e.name);let n=d();if(!n.configs.exists(e.name))throw Error(`Profile "${e.name}" does not exist. Run \`cf auth create ${e.name}\` first.`);let r=e.dir??process.cwd();n.bindings.activate(e.name,r),h(`Profile "${e.name}" activated for "${_.resolve(r)}".`)}},C={command:`deactivate [dir]`,describe:`Remove the auth profile binding from a directory`,builder:e=>e.positional(`dir`,{type:`string`,description:`Directory to unbind (defaults to current directory). Must be the exact directory the profile was bound to.`}),handler:t=>{v(t,`deactivate`),y();let n=d(),r=t.dir??process.cwd(),{removedProfile:a,newResolution:o}=n.bindings.deactivate(r);h(`Profile "${a}" deactivated from "${_.resolve(r)}".`),o.profile===void 0?i.info(`Run ${e.code(`cf auth login`)} to set up the default profile, or ${e.code(`cf auth create <name>`)} to create a named profile.`):o.profile==="default"?i.info(`This directory now uses the default profile.`):i.info(`Now using: ${o.profile} (${o.source}).`)}},w={command:`list`,describe:`List all auth profiles`,handler:e=>{v(e,`list`);let t=d(),n=t.bindings.read(),r={};for(let[e,t]of Object.entries(n))(r[t]??=[]).push(e);g(t.configs.list().map(e=>({name:e,boundDirectories:r[e]??[]})))}},T={safeFlags:[`force`,`browser`,`device`,`use-keyring`,`useKeyring`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}},E={command:`login`,describe:`Authenticate with Cloudflare`,builder:e=>e.option(`force`,{type:`boolean`,alias:`f`,description:`Force re-authentication even if already logged in`,default:!1}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}).option(`use-keyring`,{type:`boolean`,description:`Encrypt OAuth credentials using the OS keychain (persisted across invocations; use --no-use-keyring to disable)`}),handler:async t=>{v(t,`login`,"Run `cf auth create <name>` to authenticate a named profile.");let o=f();if(o!=="default"&&(i.warn(`This directory has profile "${o}" active. ${e.code(`cf auth login`)} updates the default profile, not "${o}". To re-authenticate "${o}", run:`),r(`cf auth create ${o}`)),c(`default`),t.useKeyring!==void 0&&l(t.useKeyring),n({allowGlobalAuthKey:!1})!==void 0){i.warn(`${e.code(`CLOUDFLARE_API_TOKEN`)} is set and takes precedence. Unset it to log in via OAuth.`);return}if(!t.force&&a()){if(await p()){let t=s(),n=[`You are already logged in.`,`${e.info(`Config file:`)} ${e.muted(u())}`];t?.expiration_time&&n.push(`${e.info(`Token expires:`)} ${new Date(t.expiration_time).toLocaleString()}`),n.push(`Run ${e.code(`cf auth login --force`)} to re-authenticate, or ${e.code(`cf auth logout`)} to log out.`),i.info(n.join(`
4
- `));return}i.warn(`Existing tokens are invalid or expired. Starting fresh login...`)}else t.force&&a()&&i.info(`Re-authenticating...`);if(i.info(`Starting OAuth login flow...`),!await m({browser:t.browser,device:t.device,scopes:t.scopes,profile:`default`}))return;let d=s(),h=[`${e.info(`Config file:`)} ${e.muted(u())}`];d?.scopes&&h.push(d.scopes.length>5?`${e.info(`Scopes:`)} ${d.scopes.length} selected. Run ${e.code(`cf auth whoami`)} to see the full list.`:`${e.info(`Scopes:`)} ${d.scopes.join(`, `)}`),d?.expiration_time&&h.push(`${e.info(`Token expires:`)} ${new Date(d.expiration_time).toLocaleString()}`),i.info(h.join(`
5
- `))}};export{b as a,w as c,v as i,T as n,C as o,S as r,x as s,E as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import"./ui-CBhKUPys.mjs";import{t}from"./log-CRbgNbDp.mjs";import{n}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as r,t as i}from"./login-C3Bahro9.mjs";const a={...i,describe:!1,handler:async n=>{n.quiet||t.info(`${e.code(`cf login`)} is an alias for ${e.code(`cf auth login`)}. Authentication commands are under ${e.code(`cf auth`)}.`),await i.handler(n)}};var o=n(a,{command:`login`,classification:r});export{o as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{n}from"./auth-BUQscD5b.mjs";import{a as r,t as i}from"./context-Sgba0fZP.mjs";import{t as a}from"./output-CpiIVa7Q.mjs";import{t as o}from"./dry-run-BBjUQUhR.mjs";import{t as s}from"./progress-B1dpmxCT.mjs";import{t as c}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/brand-protection/logo-matches/download`,query:[`logo_id`,`offset`,`limit`],errors:{422:`UnprocessableEntityError`}};function u(e){return e.usage(`$0 logo-matches download get
3
-
4
- Return matches as CSV for logo queries based on ID`).option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Download matches for logo queries by ID`,builder:u,handler:async e=>c({command:`logo-matches download get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={logo_id:e[`logo-id`],offset:e.offset,limit:e.limit};if(e.dryRun){let e=await r();o({command:`cf logo-matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/brand-protection/logo-matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})},f={command:`download`,describe:`Operations for download`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var p={method:`GET`,path:t=>e`/accounts/${t.account_id}/brand-protection/logo-matches`,query:[`logo_id`,`offset`,`limit`],errors:{422:`UnprocessableEntityError`}};function m(e){return e.usage(`$0 logo-matches get
5
-
6
- Return matches for logo queries based on ID`).option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Read matches for logo queries by ID`,builder:m,handler:async e=>c({command:`logo-matches get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={logo_id:e[`logo-id`],offset:e.offset,limit:e.limit};if(e.dryRun){let e=await r();o({command:`cf logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/brand-protection/logo-matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(p,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},g={command:`logo-matches`,describe:`logo-matches`,builder:e=>e.command(h).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{i as n,n as r}from"./auth-BUQscD5b.mjs";import{a as i,t as a}from"./context-Sgba0fZP.mjs";import{t as o}from"./output-CpiIVa7Q.mjs";import{t as s}from"./dry-run-BBjUQUhR.mjs";import{t as c}from"./progress-B1dpmxCT.mjs";import{t as l}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-Y5OBwDVE.mjs";function p(e){return e.usage(`$0 logos create
3
-
4
- Return new saved logo queries created from image files`).option(`tag`,{type:`string`,description:`Tag`}).option(`match-type`,{type:`string`,description:`Match type`}).option(`threshold`,{type:`number`,description:`Threshold`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const m={command:`create`,describe:`Create new saved logo queries from image files`,builder:p,handler:async e=>l({command:`logos create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={tag:e.tag,match_type:e[`match-type`],threshold:e.threshold};if(e.dryRun){let t=await i();s({command:`cf logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/brand-protection/logos`,pathParams:{},query:l,bodyKind:`octet-stream`,body:e.body});return}let f=await r(e),p=e.local?t:await a();if(e.accountId=p,e.file){let t=d(e.file),r=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/brand-protection/logos`,{body:t,headers:{"Content-Type":`application/x-www-form-urlencoded`}}));o(r,{successLabel:`Created`})}else if(e.body){let t=u(e.body,`body`,`binary`),r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/brand-protection/logos${r?`?`+r:``}`,{body:t,headers:{"Content-Type":`application/x-www-form-urlencoded`}}));o(i,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var h={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/brand-protection/logos/${t.logo_id}`,response:!1};function g(e){return e.usage(`$0 logos delete <logo-id>
5
-
6
- Return a success message after deleting saved logo queries by ID`).positional(`logo-id`,{type:`string`,description:`Logo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <logo-id>`,describe:`Delete saved logo queries by ID`,builder:g,handler:async e=>l({command:`logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/brand-protection/logos/${e[`logo-id`]==null?`<logo-id>`:encodeURIComponent(String(e[`logo-id`]))}`,pathParams:{"logo-id":String(e[`logo-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await f({force:!!e.force})){process.stderr.write(`Aborted.
7
- `);return}let u=await c(`Deleting`,async()=>n.send(h,{account_id:l,logo_id:e[`logo-id`]}));o(u,{successLabel:`Deleted`})})},v={command:`logos`,describe:`logos`,builder:e=>e.command(m).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{i as n,n as r}from"./auth-BUQscD5b.mjs";import{a as i,t as a}from"./context-Sgba0fZP.mjs";import{t as o}from"./output-CpiIVa7Q.mjs";import{t as s}from"./dry-run-BBjUQUhR.mjs";import{t as c}from"./progress-B1dpmxCT.mjs";import{t as l}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as u,r as d,s as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h}from"./prompt-Y5OBwDVE.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/repos/${t.repo_id}/scans/${t.scan_id}/report`,errors:{404:`NotFoundError`}};function _(e){return e.usage(`$0 managed-defense vulnerability-discovery reports get <scan-id>
3
-
4
- Gets the repository projection of the active operator-reviewed scan report. \`scan_id\` is the customer scan's stable request ID.`).positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <scan-id>`,describe:`Get reviewed vulnerability report`,builder:_,handler:async e=>l({command:`managed-defense vulnerability-discovery reports get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${e[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(e[`repo-id`]))}/scans/${e[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(e[`scan-id`]))}/report`,pathParams:{"repo-id":String(e[`repo-id`]??``),"scan-id":String(e[`scan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(g,{account_id:l,repo_id:e[`repo-id`],scan_id:e[`scan-id`]}));o(u,{successLabel:`Loaded`})})},y={command:`reports`,describe:`Operations for vulnerability-discovery.reports`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 managed-defense vulnerability-discovery repositories create
5
-
6
- Creates an upload repository or reserves an asynchronous deployed Worker import by name. Worker imports require Idempotency-Key.`).option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`name`,{type:`string`,description:`The name field`}).option(`worker-script-name`,{type:`string`,description:`The worker_script_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Create repository`,builder:b,handler:async e=>l({command:`managed-defense vulnerability-discovery repositories create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`idempotency-key`]!==void 0&&(l[`Idempotency-Key`]=String(e[`idempotency-key`])),e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery repositories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`),worker_script_name:m(e[`worker-script-name`],`worker-script-name`,`text`)}):u(e.body)});return}let d=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`The name field`));let _={};e.name!==void 0&&f(_,[`name`],m(e.name,`name`,`text`)),e[`worker-script-name`]!==void 0&&f(_,[`worker_script_name`],m(e[`worker-script-name`],`worker-script-name`,`text`));let v=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};var S={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/repos/${t.repo_id}`,query:[`scan_limit`,`scan_cursor`],errors:{404:`NotFoundError`}};function C(e){return e.usage(`$0 managed-defense vulnerability-discovery repositories get <repo-id>
7
-
8
- Gets repository metadata, source readiness, and customer scan history.`).positional(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`scan-limit`,{type:`number`,description:`Scan limit`}).option(`scan-cursor`,{type:`string`,description:`Scan cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <repo-id>`,describe:`Get repository`,builder:C,handler:async e=>l({command:`managed-defense vulnerability-discovery repositories get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={scan_limit:e[`scan-limit`],scan_cursor:e[`scan-cursor`]};if(e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery repositories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${e[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(e[`repo-id`]))}`,pathParams:{"repo-id":String(e[`repo-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(S,{account_id:u,repo_id:e[`repo-id`],...n}));o(d,{successLabel:`Loaded`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/repos`,query:[`limit`,`cursor`],errors:{404:`NotFoundError`}};function E(e){return e.usage(`$0 managed-defense vulnerability-discovery repositories list
9
-
10
- Lists repositories available for vulnerability discovery in an account.`).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List repositories`,builder:E,handler:async e=>l({command:`managed-defense vulnerability-discovery repositories list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,cursor:e.cursor};if(e.dryRun){let e=await i();s({command:`cf managed-defense vulnerability-discovery repositories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(T,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})},O={command:`repositories`,describe:`Operations for vulnerability-discovery.repositories`,builder:e=>e.command(x).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.usage(`$0 managed-defense vulnerability-discovery scans create
11
-
12
- Submits repository intent for operator review. This endpoint does not immediately start execution. Worker-imported repositories must be ready; explicit \`repo_hosts\` must be authorized before the request is persisted.`).option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`repo-hosts`,{type:`string`,description:`Explicit hostname scopes. Every hostname must be authorized for its repository before review admission; rejected scopes return 422 and do not persist a scan request. Provide as a JSON object or @path/to/file.json.`}).option(`repos`,{type:`string`,array:!0,description:`The repos field`}).option(`telemetry-window-end`,{type:`string`,description:`The telemetry_window.end field`}).option(`telemetry-window-start`,{type:`string`,description:`The telemetry_window.start field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`telemetry-window-end`,`telemetry-window-start`].some(t=>e[t]!==void 0)){let t=[`telemetry-window-end`,`telemetry-window-start`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --telemetry_window-* flag is set`)}return!0})}const A={command:`create`,describe:`Create scan`,builder:k,handler:async e=>l({command:`managed-defense vulnerability-discovery scans create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`idempotency-key`]!==void 0&&(l[`Idempotency-Key`]=String(e[`idempotency-key`])),e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({repo_hosts:d(e[`repo-hosts`],`repo-hosts`),repos:e.repos,telemetry_window:{end:m(e[`telemetry-window-end`],`telemetry-window-end`,`text`),start:m(e[`telemetry-window-start`],`telemetry-window-start`,`text`)}},[[`repo_hosts`]]):u(e.body)});return}let h=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/scans`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}if(e.repos===void 0)throw Error(`--repos is required (or pass --body with this field set).`);let _={};e[`repo-hosts`]!==void 0&&f(_,[`repo_hosts`],d(e[`repo-hosts`],`repo-hosts`)),e.repos!==void 0&&f(_,[`repos`],e.repos),e[`telemetry-window-end`]!==void 0&&f(_,[`telemetry_window`,`end`],m(e[`telemetry-window-end`],`telemetry-window-end`,`text`)),e[`telemetry-window-start`]!==void 0&&f(_,[`telemetry_window`,`start`],m(e[`telemetry-window-start`],`telemetry-window-start`,`text`));let v=await c(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/scans`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};var j={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/scans/${t.scan_id}/report`,errors:{404:`NotFoundError`}};function M(e){return e.usage(`$0 managed-defense vulnerability-discovery scans get-report <scan-id>
13
-
14
- Gets the active operator-reviewed scan report. Repository metadata records report readiness even when no publication is available.`).positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get-report <scan-id>`,describe:`Get reviewed vulnerability report`,builder:M,handler:async e=>l({command:`managed-defense vulnerability-discovery scans get-report`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery scans get-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${e[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(e[`scan-id`]))}/report`,pathParams:{"scan-id":String(e[`scan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(j,{account_id:l,scan_id:e[`scan-id`]}));o(u,{successLabel:`Loaded`})})};var P={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/scans/${t.scan_id}`,errors:{404:`NotFoundError`}};function F(e){return e.usage(`$0 managed-defense vulnerability-discovery scans get <scan-id>
15
-
16
- Gets one customer-requested scan across its review and execution lifecycle.`).positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <scan-id>`,describe:`Get scan`,builder:F,handler:async e=>l({command:`managed-defense vulnerability-discovery scans get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf managed-defense vulnerability-discovery scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${e[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(e[`scan-id`]))}`,pathParams:{"scan-id":String(e[`scan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(P,{account_id:l,scan_id:e[`scan-id`]}));o(u,{successLabel:`Loaded`})})};var L={method:`GET`,path:t=>e`/accounts/${t.account_id}/managed-defense/vulnerability-discovery/scans`,query:[`limit`,`cursor`,`status`,`repo`],errors:{404:`NotFoundError`}};function R(e){return e.usage(`$0 managed-defense vulnerability-discovery scans list
17
-
18
- Lists customer-requested scans across review and execution lifecycle states.`).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`status`,{type:`string`,description:`Repeat parameter or provide comma-separated values.`}).option(`repo`,{type:`string`,description:`Repo`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List scans`,builder:R,handler:async e=>l({command:`managed-defense vulnerability-discovery scans list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,cursor:e.cursor,status:e.status,repo:e.repo};if(e.dryRun){let e=await i();s({command:`cf managed-defense vulnerability-discovery scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(L,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})},B={command:`scans`,describe:`Operations for vulnerability-discovery.scans`,builder:e=>e.command(A).command(I).command(N).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`vulnerability-discovery`,describe:`Operations for vulnerability-discovery`,builder:e=>e.command(y).command(O).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`managed-defense`,describe:`managed-defense`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B7ZJ78al.mjs";import{n}from"./auth-BUQscD5b.mjs";import{a as r,t as i}from"./context-Sgba0fZP.mjs";import{t as a}from"./output-CpiIVa7Q.mjs";import{t as o}from"./dry-run-BBjUQUhR.mjs";import{t as s}from"./progress-B1dpmxCT.mjs";import{t as c}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/brand-protection/matches/download`,query:[`id`,`offset`,`limit`,`include_domain_id`,`include_dismissed`],errors:{422:`UnprocessableEntityError`}};function u(e){return e.usage(`$0 matches download get
3
-
4
- Return matches as CSV for string queries based on ID`).option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Download matches for string queries by ID`,builder:u,handler:async e=>c({command:`matches download get`,classification:{safeFlags:[`include-domain-id`,`include-dismissed`,`dry-run`]}},e,async()=>{let c={id:e.id,offset:e.offset,limit:e.limit,include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`]};if(e.dryRun){let e=await r();o({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/brand-protection/matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})},f={command:`download`,describe:`Operations for download`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var p={method:`GET`,path:t=>e`/accounts/${t.account_id}/brand-protection/matches`,query:[`id`,`offset`,`limit`,`include_domain_id`,`include_dismissed`],errors:{422:`UnprocessableEntityError`}};function m(e){return e.usage(`$0 matches get
5
-
6
- Return matches for string queries based on ID`).option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Read matches for string queries by ID`,builder:m,handler:async e=>c({command:`matches get`,classification:{safeFlags:[`include-domain-id`,`include-dismissed`,`dry-run`]}},e,async()=>{let c={id:e.id,offset:e.offset,limit:e.limit,include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`]};if(e.dryRun){let e=await r();o({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/brand-protection/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(p,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},g={command:`matches`,describe:`matches`,builder:e=>e.command(h).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{r as t,t as n}from"./session-3DgztoAI.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";import{n as i,t as a}from"./version-izjB0Yrl.mjs";import{n as o}from"./blocks-CFAm0Ma3.mjs";import{t as s}from"./errors-DpbAQQv8.mjs";import{n as c,t as l}from"./project-settings-nBMEx1f-.mjs";import{a as u,n as d,o as f,t as p}from"./cf-3vj8dGYz.mjs";import{i as m,n as h,o as g,s as _}from"./dist-DAeCUX-u.mjs";import{n as v}from"./interactive-d_lFnSev.mjs";import{n as y}from"./context-Sgba0fZP.mjs";import"./log-CRbgNbDp.mjs";import{relative as b}from"node:path";function x(t,n={}){let{cwd:r=process.cwd(),output:i=process.stderr}=n,a=n.columns??(i.columns||80),s=c(r),u=s?b(r,s):l,d=s?`To make this the project's default account, add accountId to ${u}:`:`To make this the project's default account, create ${u}:`,f=/* @__PURE__ */ new Set([`accountId`,u]),p=o(d,Math.max(20,a-3)).map(t=>t.split(` `).map(t=>{let n=t.replace(/:$/,``);return f.has(n)?`${e.code(n)}${t.slice(n.length)}`:t}).join(` `));h.info(p.join(`
3
- `),{output:i});let m=`accountId: ${e.jsonString(JSON.stringify(t))},`,g=s?[m]:[`import { defineConfig } from "cf/config";`,``,`export default defineConfig({`,` ${m}`,`});`],_=` `.repeat(3);i.write(`\n${g.map(e=>e&&_+e).join(`
4
- `)}\n\n`)}const S={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var C=class extends Error{};async function w(e){if(v())throw new C;n(i);let t=await g({message:e});if(_(t)||typeof t!=`string`)throw new r(130,{cancelled:!0});return t}async function T(e,a){if(v())throw new C;n(i);let o=await m({message:e,options:a.choices.map(({title:e,value:t})=>({label:e,value:t}))});if(_(o)||typeof o!=`string`)throw new r(130,{cancelled:!0});return t()||x(o),o}const E=p({logger:S,userAgent:a,prompt:w,select:T,isNoDefaultValueProvidedError:e=>e instanceof C});let D=!1;function O(e,t){D=e,E.setTemporaryAllowed(e,t)}function k(){return D}async function A(e){if(!k())throw Error(`Temporary accounts require --temporary-account.`);try{let t=await E.requireAuth({compliance_region:e?.complianceRegion??await y(e)}),{apiToken:n}=E.requireApiToken();return{accountId:t,apiToken:n}}catch(e){throw e instanceof Error&&(e.message=e.message.replaceAll(/--temporary(?!-account)/g,`--temporary-account`)),e}}async function j(e,t){try{return await E.getOrSelectAccountId({account_id:e,compliance_region:t?.complianceRegion??await y(t)})}catch(e){throw e instanceof Error&&!(`reason`in e)&&`telemetryMessage`in e&&e.telemetryMessage===`cfetch auth login required`&&v()&&E.getAPIToken()===void 0?new s(e.message,{cause:e}):e}}function M(){return E.getActiveAccountId({})}async function N(){return E.fetchAllAccounts({compliance_region:await y()},{throwOnEmpty:!1})}async function P(e){if(e?.scopes&&!f(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return E.login({compliance_region:await y()},{browser:e?.browser??!0,device:e?.device??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function F(e){return E.logout(e)}function I(e){E.setProfile(e)}function L(e){u(e,{logger:S,getCredentialStore:()=>E.getCredentialStore()})}function R(){return E.getActiveProfile()}function z(){return d({logger:S})}function B(e,t=process.cwd()){let n=z().resolve({profile:e,cwd:t});return I(n),n}function V(){return E.getOAuthTokenFromLocalState()}function H(){return E.readAuthCredentials()?.oauth_token!==void 0}function U(){return E.readAuthCredentials()}function W(){return E.getCredentialStore().path()}export{O as _,j as a,H as c,F as d,U as f,I as g,L as h,W as i,k as l,B as m,M as n,z as o,A as p,R as r,V as s,N as t,P as u};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e,t}from"./theme-BGHWSKCw.mjs";import{n}from"./interactive-d_lFnSev.mjs";function r(e){return typeof e==`object`&&e&&`result`in e&&Array.isArray(e.result)&&`result_info`in e?e.result:e}function i(t){process.stderr.isTTY&&process.stderr.write(`${e.success(`✓`)} ${t}\n`)}function a(e,t={}){t.quiet||(e=r(e),e==null?t.successLabel&&i(t.successLabel):console.log(o(e)))}function o(r){let i=JSON.stringify(r,null,2);return n()||!t()||i.length>5e4?i:i.replace(/"((?:[^"\\]|\\.)*)":/g,(t,n)=>`${e.jsonKey(`"${n}"`)}:`).replace(/: "((?:[^"\\]|\\.)*)"/g,(t,n)=>`: ${e.jsonString(`"${n}"`)}`).replace(/: (-?\d+\.?\d*)/g,(t,n)=>`: ${e.jsonNumber(n)}`).replace(/: (true|false)/g,(t,n)=>`: ${e.jsonBoolean(n)}`).replace(/: (null)/g,(t,n)=>`: ${e.muted(n)}`)}export{i as n,a as t};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./dotenv-Ck-6V1hm.mjs";import{G as t,nt as n,q as r,z as i}from"./dist-CX6dDtzj.mjs";import{t as a}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as o}from"./local-B7ZJ78al.mjs";import{i as s,n as c}from"./auth-BUQscD5b.mjs";import{l,p as u}from"./interactive-d_lFnSev.mjs";import{a as d,t as f}from"./context-Sgba0fZP.mjs";import{C as p,_ as m,d as h,f as g,l as _,r as v,t as y,x as b,y as x}from"./deploy-context-DIAl408H.mjs";import{t as S}from"./output-CpiIVa7Q.mjs";import{t as C}from"./dry-run-BBjUQUhR.mjs";import{t as w}from"./progress-B1dpmxCT.mjs";import{n as T,t as E}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as D}from"./prompt-Y5OBwDVE.mjs";import{i as O,n as k,o as A,r as j,s as M,t as N,u as P}from"./containers-CcZHRM9g.mjs";import{a as F,c as I,i as ee,n as L,o as R,r as z,s as B}from"./build-BJHRK6qE.mjs";import{t as V}from"./deploy-input-v2DryyLP.mjs";import{readBuildOutput as H}from"@cloudflare/build-output-utils";function U(e){return e.usage(`$0 previews delete <name>
3
-
4
- Delete a Preview.`).positional(`name`,{type:`string`,description:`Identifier for the Preview, which can be ID, slug, or URL-encoded name.`,demandOption:!0}).option(`worker`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`delete-with-references`,{type:`boolean`,description:`If true, delete the Preview even when other Workers still reference it. Service bindings in those Workers may be left broken. Durable Object namespaces implemented by the deleted Preview are deleted even if other Workers reference them.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const W={command:`delete <name>`,describe:`Delete Preview`,builder:U,handler:async e=>E({command:`previews delete`,classification:{safeFlags:[`delete-with-references`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={force:e[`delete-with-references`]};if(e.dryRun){let n=await d();C({command:`cf previews delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/workers/${e.worker==null?`<worker>`:encodeURIComponent(String(e.worker))}/previews/${e.name==null?`<name>`:encodeURIComponent(String(e.name))}`,pathParams:{worker:String(e.worker??``),name:String(e.name??``)},query:t,bodyKind:`none`});return}let n=await c(e),r=e.local?o:await f();if(e.accountId=r,!await D({force:!!e.force,message:`This operation permanently deletes the Preview.`})){process.stderr.write(`Aborted.
5
- `);return}let i=await w(`Deleting`,async()=>s(n,`DELETE`,`/accounts/${r}/workers/workers/${encodeURIComponent(String(e.worker))}/previews/${encodeURIComponent(String(e.name))}`,{query:t}));S(i,{successLabel:`Deleted`})})};function G(e){return{getNormalizedContainerOptions:async t=>e.standard.normalized.map(e=>({...e,name:t.containers?.find(({class_name:t})=>t===e.class_name)?.name??e.name})),deployPreviewContainers:async(t,r,i,a,o)=>K(o.quiet,async()=>{let s=/* @__PURE__ */ new Map;for(let e of Object.values(i.env??{}))e.type===`durable_object_namespace`&&e.class_name&&e.namespace_id&&e.script_name===void 0&&s.set(e.class_name,e.namespace_id);let c;for(let n of r){let r=s.get(n.class_name);if(r||=(c??=await x(t,a),c.find(e=>e.class===n.class_name&&e.preview?.id===i.preview_id)?.id),!r)throw Error(`Could not find a Preview Durable Object namespace for Container class "${n.class_name}".`);let l=await q(n,e,i.id,a,t,o.localImageReferences?.get(n.class_name));await _({imageRef:l,durable_object_namespace_id:r,configFileName:`cloudflare.config.ts`,observabilityTargetPercentageField:`targetInstancePercentage`,observabilityTargetCountField:`targetInstanceCount`},n,t,a)}await h(e.standard.builtImages.filter(({container:e})=>!o.localImageReferences?.has(e.class_name)),n())})}}async function K(e,t){if(!e)return t();let n=l();u(`error`);try{return await t()}finally{u(n)}}async function q(e,t,r,i,a,o){if(o!==void 0)return p({pathToDocker:n(),sourceTag:o,targetTag:o,accountId:i,complianceConfig:a,containerConfig:`dockerfile`in e?e:void 0,cleanupSourceTag:!1});let s=t.standard.builtImages.find(({container:t})=>t.class_name===e.class_name);if(s)return b(s,r,n(),i,a);if(`image_uri`in e)return{newTag:e.image_uri};throw Error(`Container "${e.name}" has no Build Output image to deploy.`)}function J(e){return e.positional(`preview-name`,{type:`string`,description:`Preview name. Defaults to the current CI or Git branch; required if no branch is available.`}).option(`prebuilt`,{type:`boolean`,description:`Use existing Preview Build Output Specification files without building`,default:!1}).option(`worker`,z)}function Y(e){return{type:`preview`,version:1,preview_id:e.preview.id,preview_name:e.preview.name,preview_slug:e.preview.slug,preview_urls:e.preview.urls,deployment_id:e.deployment.id,deployment_urls:e.deployment.urls}}async function X(t){let n=t[`preview-name`],r=n??A();if(!r||!n&&r===`HEAD`)throw Error(`We couldn't determine a Preview name from CI or Git. The name is optional when a branch is available. Otherwise, run:
6
-
7
- cf previews deploy PREVIEW_NAME`);return t.prebuilt||await L(t.mode,{output:t.quiet?`silent`:`stderr`,worker:t.worker},{isPreview:!0}),e(t,()=>Z(t,r))}async function Z(e,n){let a=await H(process.cwd());O(a.rootConfig),B(e.mode,a.rootConfig.buildContext.mode),R(a.rootConfig.accountId,e[`temporary-account`]);let o=F(a.workers,e.worker),{wranglerConfig:s,builtConfig:c}=ee(o,a.rootConfig),l=r(s),{authToken:u,accountId:d}=await j({accountId:a.rootConfig.accountId,complianceRegion:l,isPreview:!0}),f=y(u);P({...f,logger:{...f.logger,log:()=>{},info:()=>{}}}),m({logger:{...f.logger,debug:()=>{},debugWithSanitization:()=>{},log:()=>{},info:()=>{}},fetchResult:f.fetchResult,fetchPagedListResult:f.fetchPagedListResult});let p=new Set(Object.values(c.exports??{}).filter(k).map(({container:e})=>e)),h=a.containers?.filter(({config:e})=>p.has(e.name))??[],_=N(h,s,{accountId:d}),b=_.source;if(b?.some(e=>e.scheduling_policy===`durable_object`))throw new I(`Preview deployments do not support Durable Object-managed Containers (schedulingPolicy: "durable-object").`);b&&b.length>0&&g(d,u,t(s));let x=await M(d,{name:n,json:!0},{workerConfig:c,rootConfig:a.rootConfig,containers:h.filter(({config:e})=>b?.some(({name:t})=>t===e.name)).map(({config:e})=>e),buildResult:o.bundleDir?V(o,c):void 0,assets:o.assetsDir?{directory:o.assetsDir}:void 0},{deployCommand:`cf deploy`,previewCommand:`cf previews deploy`,...G(_),verifyContainersScope:async()=>{await v.listApplications()}});return i({...Y(x),worker_name:c.name??null}),x}var Q=T({command:`deploy [preview-name]`,describe:`Deploy a Worker Preview`,builder:J,handler:async e=>{if(e.local)throw Error(`--local is not supported by cf previews deploy.`);let t=await X(e);S(Y(t),{quiet:e.quiet})}},{command:`previews deploy`,classification:{safeFlags:[`prebuilt`]}});const $={command:`previews`,describe:`Manage Worker Previews`,builder:e=>e.command(W).command(a(Q,`preview`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./theme-BGHWSKCw.mjs";import{r as t,t as n}from"./session-3DgztoAI.mjs";import{n as r}from"./version-izjB0Yrl.mjs";import{a as i}from"./dist-DAeCUX-u.mjs";const a={Hidden:0,Normal:1,Error:2,Indeterminate:3,Warning:4},o=new class{cleanupRegistered=!1;get isDisabled(){return process.env.CF_NO_OSC_PROGRESS===`1`||process.env.CF_QUIET===`1`||t()}get isSupported(){if(this.isDisabled||!process.stderr.isTTY)return!1;if(process.env.CF_FORCE_OSC_PROGRESS===`1`)return!0;let e=process.env.TERM_PROGRAM?.toLowerCase()??``;return!!(e.includes(`ghostty`)||e.includes(`iterm`)||e.includes(`wezterm`)||process.env.WT_SESSION||process.env.ConEmuANSI===`ON`)}setIndeterminate(){this.isSupported&&(this.ensureCleanup(),this.write(a.Indeterminate))}clear(){this.isSupported&&process.stderr.write(`\x1b]9;4;${a.Hidden};0\x07`)}ensureCleanup(){this.cleanupRegistered||(this.cleanupRegistered=!0,process.on(`exit`,()=>{this.clear()}))}write(e){this.isSupported&&process.stderr.write(`\x1b]9;4;${e};0\x07`)}},s=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function c(){return!(!e()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function l(e,t){if(!c())return t();n(r);let a=i({frames:[...s],indicator:`timer`,delay:80});o.setIndeterminate(),a.start(e);try{let n=await t();return o.clear(),a.stop(e),n}catch(t){throw o.clear(),a.error(e),t}}export{l as t};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./session-3DgztoAI.mjs";import{t as n}from"./cli-exit-CstFZ1eJ.mjs";import{n as r}from"./version-izjB0Yrl.mjs";import{i,o as a,r as o,s,t as c}from"./dist-DAeCUX-u.mjs";import{n as l}from"./interactive-d_lFnSev.mjs";function u(e){return e.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,` `)}function d(){t(r)}async function f(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
3
- `)?t.slice(0,-1):t}async function p(e,t,r){let i=r?.kind??`text`;if(l()){if(i===`secret`){let t=await f();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let c=`Enter value for --${e}`,u=t||r?.question||c,p=e=>e&&e.length>0?r?.validate?.(e):`Value cannot be empty`;d();let m=i===`secret`?await o({message:u,mask:`•`,validate:p}):await a({message:u,validate:p});if(s(m)||typeof m!=`string`)throw new n(130,{cancelled:!0});return m}async function m(e,t,r,a={}){let o=u(e),c=r.map(u);if(l())throw Error(`--${o} is required (one of: ${c.join(`, `)}). Pass --${o} <value> or run interactively.`);let f=`Select value for --${o}`,p=u(t||f);d();let m=await i({message:p,options:r.map(e=>({value:e,label:u((Object.hasOwn(a,e)?a[e]:void 0)??e)}))});if(s(m)||typeof m!=`string`)throw new n(130,{cancelled:!0});return m}async function h(e,t){if(l())throw Error(`--${e} is required and must be true. Pass --${e} or run interactively.`);d();let r=await c({message:t||`Confirm --${e}`,initialValue:!1});if(s(r))throw new n(130,{cancelled:!0});return r===!0}async function g(e,{defaultValue:t=!0,fallbackValue:r=!0}={}){if(l())return process.stderr.write(`? ${e}\n Using fallback value in non-interactive context: ${r?`yes`:`no`}\n`),r;d();let i=await c({message:e,initialValue:t});if(s(i))throw new n(130,{cancelled:!0});return i===!0}async function _(t={}){if(t.force===!0)return!0;let r=t.message?`${t.message} Continue?`:`This permanently deletes the resource. Continue?`;if(l())throw process.stderr.write(`${e.warning(`?`)} ${r}\n ${e.muted(`(non-interactive; pass --force to confirm)`)}\nAborted.
4
- `),new n(1);d();let i=await c({message:r,initialValue:!1});if(s(i))throw new n(130,{cancelled:!0});return i===!0}export{p as a,m as i,_ as n,u as o,h as r,g as t};