cf 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +5 -0
  2. package/dist/_meta/agent-context.json +34 -35
  3. package/dist/_meta/commands.json +6834 -10044
  4. package/dist/_meta/schemas.json +11228 -12752
  5. package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CGF4zcKf.mjs} +2 -2
  6. package/dist/{access-RbqBFrSC.mjs → access-lhLJo1v2.mjs} +1 -1
  7. package/dist/{account-D7xvYqDx.mjs → account-CYRm3yoN.mjs} +1 -1
  8. package/dist/account-tags-B88TotoH.mjs +9 -0
  9. package/dist/accounts-BSIAT_iP.mjs +28 -0
  10. package/dist/{acm-Szq4CoQN.mjs → acm-VULm1djv.mjs} +1 -1
  11. package/dist/{addressing-CgTTbuCF.mjs → addressing-BHPBIkRY.mjs} +1 -1
  12. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-KBy48G1b.mjs} +1 -1
  13. package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-DDv_Gxr7.mjs} +2 -2
  14. package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-BWZGvbca.mjs} +1 -1
  15. package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-jeB-sAgP.mjs} +1 -1
  16. package/dist/ai-search-BmdskMjR.mjs +7 -0
  17. package/dist/{ai-security-AUfzagSE.mjs → ai-security-CsmfcaUx.mjs} +1 -1
  18. package/dist/{ai-Cn0BniR4.mjs → ai-viHB1tgI.mjs} +1 -1
  19. package/dist/{alerting-DbXVpGv3.mjs → alerting-Bl8OqViR.mjs} +4 -4
  20. package/dist/analytics-vOxw8Hy0.mjs +3 -0
  21. package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-DO4-C0wD.mjs} +1 -1
  22. package/dist/{api-security-pSJdgmtK.mjs → api-security-4FVrD4n8.mjs} +1 -1
  23. package/dist/argo-CQfCgazW.mjs +2 -0
  24. package/dist/args-DlUhyGU0.mjs +2 -0
  25. package/dist/artifacts-CVDGnr2V.mjs +4 -0
  26. package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-CzpwvQ6A.mjs} +1 -1
  27. package/dist/{auth-MeSu8lFz.mjs → auth-D0xZxAEa.mjs} +1 -1
  28. package/dist/{auth-C6MhC9EZ.mjs → auth-MQEamPN9.mjs} +2 -2
  29. package/dist/{billing-0RNCYBJM.mjs → billing-aJgapeRm.mjs} +2 -2
  30. package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Y2q5d-pi.mjs} +1 -1
  31. package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-DANJqfmE.mjs} +1 -1
  32. package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CjpZWBjp.mjs} +1 -1
  33. package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-BtpCbh-2.mjs} +1 -1
  34. package/dist/browser-run-BFn9h2Tz.mjs +4 -0
  35. package/dist/{build-Nivzj54_.mjs → build-DcflwvqN.mjs} +1 -1
  36. package/dist/{cache-BgRIDcFJ.mjs → cache-VyWK1SjY.mjs} +1 -1
  37. package/dist/{calls-JrRne0U0.mjs → calls-BxoRYxs4.mjs} +1 -1
  38. package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-D7OAFxF_.mjs} +1 -1
  39. package/dist/{cf-BUKsENG5.mjs → cf-C7DU4819.mjs} +2 -2
  40. package/dist/{chunk-LQW53VED-Xakf_rUn.mjs → chunk-LQW53VED-DLrXV-hE.mjs} +2 -2
  41. package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-DDUv8K0a.mjs} +1 -1
  42. package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-D4ysjwWT.mjs} +1 -1
  43. package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-Bhec6z2P.mjs} +1 -1
  44. package/dist/cloudforce-one-J_hn9ss9.mjs +36 -0
  45. package/dist/config.mjs +1 -1
  46. package/dist/connector-interrupts-Dycx8zFx.mjs +2 -0
  47. package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-BmxOSNtN.mjs} +1 -1
  48. package/dist/connector-telemetry-events-latest-BY2556uL.mjs +2 -0
  49. package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CdcqfKnH.mjs} +1 -1
  50. package/dist/connector-telemetry-snapshots-latest-BHYdxUEF.mjs +2 -0
  51. package/dist/{connectors-BRCQSsos.mjs → connectors-BqxYMMtQ.mjs} +1 -1
  52. package/dist/{containers-CfKOM_f5.mjs → containers-CKW081JA.mjs} +8 -8
  53. package/dist/{content-scan-CB4xHGv1.mjs → content-scan-Dgd7A8KF.mjs} +1 -1
  54. package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DYL37wLc.mjs} +1 -1
  55. package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-CkhSbfAs.mjs} +1 -1
  56. package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-BzAOnEoT.mjs} +1 -1
  57. package/dist/custom-csrs-CgzG3pd3.mjs +3 -0
  58. package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-q_nsnlye.mjs} +4 -4
  59. package/dist/custom-nameservers-BUBmfhUe.mjs +3 -0
  60. package/dist/custom-pages-M7jA2Hit.mjs +3 -0
  61. package/dist/{d1-FmAh7T7l.mjs → d1-BFvMd6-S.mjs} +1 -1
  62. package/dist/{data-security-2fmzF_Me.mjs → data-security-Bji4Or_j.mjs} +2 -2
  63. package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-BuoRQ1Yh.mjs} +1 -1
  64. package/dist/{deploy-BzFbjH6a.mjs → deploy-CZ7bgNDu.mjs} +1 -1
  65. package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-CrvuoDGJ.mjs} +1 -1
  66. package/dist/{dev-CWaf-qW4.mjs → dev-V10MG-Bg.mjs} +1 -1
  67. package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-BTH-8nJH.mjs} +2 -2
  68. package/dist/{directory-CGNWfVQc.mjs → directory-BlH6N6Qy.mjs} +1 -1
  69. package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-BCjH1JzB.mjs} +1 -1
  70. package/dist/{dist-COfwjT96.mjs → dist-CgrMkXFx.mjs} +1 -1
  71. package/dist/{dls-CobKlH4N.mjs → dls-BF5iN78p.mjs} +1 -1
  72. package/dist/{dns-OfJXNYkK.mjs → dns-CeCTNqRk.mjs} +11 -11
  73. package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-B54MaLGm.mjs} +1 -1
  74. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
  75. package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-D8FQORrL.mjs} +1 -1
  76. package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DJK0Eb30.mjs} +1 -1
  77. package/dist/email-routing-NpmiKIrl.mjs +6 -0
  78. package/dist/{email-security-D-P8ln2L.mjs → email-security-BLZ7WZ9Z.mjs} +2 -2
  79. package/dist/email-sending-dn-353Nx.mjs +7 -0
  80. package/dist/fieldExtractors-ahysj57J.mjs +3 -0
  81. package/dist/firewall-CBPGJ43p.mjs +11 -0
  82. package/dist/{flagship-CPkQMist.mjs → flagship-BusjRNIb.mjs} +3 -3
  83. package/dist/{fraud-BhX0QNUl.mjs → fraud-BIhS8pLf.mjs} +1 -1
  84. package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-TZZ3F1tV.mjs} +1 -1
  85. package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-FiXIk-KP.mjs} +2 -2
  86. package/dist/{hostnames-CGAFkYT1.mjs → hostnames-Bx0mykMR.mjs} +1 -1
  87. package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-C8qCabBF.mjs} +1 -1
  88. package/dist/{iam-Su_hpatD.mjs → iam-Cj63Kjc6.mjs} +1 -1
  89. package/dist/{images-D2ZflvBi.mjs → images-CBWXCDhy.mjs} +1 -1
  90. package/dist/index.mjs +1 -1
  91. package/dist/{intel-DPGzVovJ.mjs → intel-B-9Z_sJs.mjs} +2 -2
  92. package/dist/{interactive-CM2G03lr.mjs → interactive-DtsCYfrK.mjs} +1 -1
  93. package/dist/{ips-C5-NH1b0.mjs → ips-qs9eGJnI.mjs} +1 -1
  94. package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-THHvoXX3.mjs} +1 -1
  95. package/dist/{keys-B0FBtlOD.mjs → keys-D7N0j4-x.mjs} +1 -1
  96. package/dist/{kv-BbZ9st5o.mjs → kv-BFDUCnft.mjs} +1 -1
  97. package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DUlUCOoJ.mjs} +1 -1
  98. package/dist/load-balancers-D2zbQ8fT.mjs +6 -0
  99. package/dist/{local-eEF0NF51.mjs → local-D-aVNu6A.mjs} +1 -1
  100. package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-Dh3keC5v.mjs} +1 -1
  101. package/dist/logexplorer-CUsfZ_bS.mjs +13 -0
  102. package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-CJcthPHf.mjs} +1 -1
  103. package/dist/{logos-DS0krPAz.mjs → logos-BS65zN8q.mjs} +1 -1
  104. package/dist/logpush-BK34mMQs.mjs +4 -0
  105. package/dist/{logs-C07M9zn-.mjs → logs-CLAqX9h2.mjs} +1 -1
  106. package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-h_ozrC5S.mjs} +1 -1
  107. package/dist/magic-network-monitoring-C7tAPNKP.mjs +4 -0
  108. package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-BtsFePMx.mjs} +5 -5
  109. package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-Cm_KVCMB.mjs} +1 -1
  110. package/dist/{matches-CIaCrdrs.mjs → matches-InA1hwII.mjs} +1 -1
  111. package/dist/{mcp-D2afM8MD.mjs → mcp-mJ7bekNJ.mjs} +1 -1
  112. package/dist/mesh-BK4S1Ezy.mjs +4 -0
  113. package/dist/{moq-BBQVNGo1.mjs → moq-qmuVPAO0.mjs} +1 -1
  114. package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-CU4OAAXY.mjs} +1 -1
  115. package/dist/{network-CmuJqtFJ.mjs → network-D74cSy3t.mjs} +1 -1
  116. package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-BJ0Nc48J.mjs} +1 -1
  117. package/dist/{oauth-BjHjJtnn.mjs → oauth-B0ETkNcX.mjs} +2 -2
  118. package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-Br-smLxQ.mjs} +1 -1
  119. package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-D5bF11ju.mjs} +1 -1
  120. package/dist/observability-BWE0Gg3V.mjs +4 -0
  121. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-R-qesf18.mjs} +1 -1
  122. package/dist/{organization-DQIfNVCT.mjs → organization-NX7yCZrq.mjs} +1 -1
  123. package/dist/{organizations-L_ycAy6r.mjs → organizations-DLhiRt8g.mjs} +1 -1
  124. package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-Ff4McZRQ.mjs} +1 -1
  125. package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-UuTr4_SW.mjs} +1 -1
  126. package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DOJ1zlH3.mjs} +1 -1
  127. package/dist/{output-DgW1hQGX.mjs → output-DrpYYfnB.mjs} +1 -1
  128. package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-BSz1gO-_.mjs} +1 -1
  129. package/dist/{pages-CskAn5mR.mjs → pages-DVDogxPs.mjs} +4 -4
  130. package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-BrLXK7gT.mjs} +1 -1
  131. package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-BszRk4sM.mjs} +2 -2
  132. package/dist/{precursor-DgRWBN9_.mjs → precursor-BPNjQr76.mjs} +1 -1
  133. package/dist/progress-CsHIt3Tp.mjs +2 -0
  134. package/dist/{prompt-DM4z101s.mjs → prompt-DdegNPpg.mjs} +1 -1
  135. package/dist/{queries-DrqcK0ZX.mjs → queries-JL1H1Biz.mjs} +1 -1
  136. package/dist/{queues-CutvMZcc.mjs → queues-DpkYdRUE.mjs} +1 -1
  137. package/dist/{r2-sFI62vhq.mjs → r2-CKozthw_.mjs} +4 -4
  138. package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-Du7hN9jA.mjs} +1 -1
  139. package/dist/radar-C-92vggG.mjs +2 -0
  140. package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-yBF3qoYD.mjs} +1 -1
  141. package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-CteyTOM2.mjs} +1 -1
  142. package/dist/realtimekit-CIP7lP-a.mjs +7 -0
  143. package/dist/{registrar-C0EsXf83.mjs → registrar-DKKN0M29.mjs} +3 -3
  144. package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-DiXg8p_1.mjs} +3 -3
  145. package/dist/{registry-CJvn75Bq.mjs → registry-Bck_zFkz.mjs} +1 -1
  146. package/dist/{reporting-BB6sqe6r.mjs → reporting-fg_GKXe1.mjs} +1 -1
  147. package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-CkMya96z.mjs} +1 -1
  148. package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-D1pSDvtf.mjs} +1 -1
  149. package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-z48JGHCq.mjs} +1 -1
  150. package/dist/{rules-C2BxykEe.mjs → rules-BTmNjDN-.mjs} +1 -1
  151. package/dist/rulesets-CsoSM-17.mjs +5 -0
  152. package/dist/{rum-Dyno5zj3.mjs → rum-DB4iO2q5.mjs} +1 -1
  153. package/dist/{schema-BeXPWeK9.mjs → schema-B34Q9tLF.mjs} +1 -1
  154. package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-iGoOriJt.mjs} +1 -1
  155. package/dist/{scim-Bb2xHpIz.mjs → scim-CcSyfKCH.mjs} +1 -1
  156. package/dist/sdk-ZctLa5jW.mjs +3 -0
  157. package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-DFmvtphu.mjs} +1 -1
  158. package/dist/security-center-DFKeHq5c.mjs +2 -0
  159. package/dist/{security-txt-Bh_2gymk.mjs → security-txt-DqnFpjMI.mjs} +1 -1
  160. package/dist/{session-Br-q_UIW.mjs → session-D6KHthHf.mjs} +1 -1
  161. package/dist/{share-DfTpOxhk.mjs → share-BuwYUzOL.mjs} +1 -1
  162. package/dist/{shared-BNjZc02w.mjs → shared-VppSAQf4.mjs} +1 -1
  163. package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-D6X8L7p8.mjs} +2 -2
  164. package/dist/{snippets-nSLwH8uJ.mjs → snippets-DIpc9pb_.mjs} +1 -1
  165. package/dist/{spawn-Bj8QRFJ5.mjs → spawn-O1RS01vr.mjs} +2 -2
  166. package/dist/{spectrum-DuhSUTZI.mjs → spectrum-b7N1ZRAm.mjs} +1 -1
  167. package/dist/{speed-Dgby_e1J.mjs → speed-cw31yFva.mjs} +1 -1
  168. package/dist/src-D_HETJNy.mjs +108 -0
  169. package/dist/{ssl-BsxTHasY.mjs → ssl-CsEhRVTO.mjs} +1 -1
  170. package/dist/{state-C1m9nwUm.mjs → state-Bb5Cbc_L.mjs} +1 -1
  171. package/dist/{stream-CkEOX5Ko.mjs → stream-DFOao6Gu.mjs} +3 -3
  172. package/dist/{submit-BjdywxTq.mjs → submit--xTzyNPy.mjs} +1 -1
  173. package/dist/{tags-CFAw_Sce.mjs → tags-efICDkah.mjs} +1 -1
  174. package/dist/{tenant-C66iOy5O.mjs → tenant-CerHuToJ.mjs} +1 -1
  175. package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-C4otMBm2.mjs} +1 -1
  176. package/dist/{tools-D2Xxfkrc.mjs → tools-BHfBOZOU.mjs} +1 -1
  177. package/dist/{triggers-Dv22ZXM4.mjs → triggers-BEsiiKAf.mjs} +1 -1
  178. package/dist/{tunnel-BatkLdds.mjs → tunnel-DkMiNtVY.mjs} +1 -1
  179. package/dist/{tunnels-CstoXOoq.mjs → tunnels-D0J8lJoI.mjs} +1 -1
  180. package/dist/{turnstile-IoRtama4.mjs → turnstile-CFmtY5bn.mjs} +2 -2
  181. package/dist/{ui-DjQ4AQww.mjs → ui-DE8CNn6c.mjs} +1 -1
  182. package/dist/{url-info-Hjhwr2la.mjs → url-info-DBCeRWwb.mjs} +1 -1
  183. package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-ClfFiruK.mjs} +1 -1
  184. package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-CNyvg65L.mjs} +1 -1
  185. package/dist/{user-CVHm-cnB.mjs → user-bifVEQq5.mjs} +2 -2
  186. package/dist/{values-Cmlw5wGZ.mjs → values-OxkdP1tV.mjs} +1 -1
  187. package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CVKu7lEt.mjs} +1 -1
  188. package/dist/{versions-CU6Av1vh.mjs → versions-BVL-Ludh.mjs} +1 -1
  189. package/dist/waiting-rooms-CmRAl51T.mjs +11 -0
  190. package/dist/{web-assets-DmSKaxzf.mjs → web-assets-C2s9kzWf.mjs} +1 -1
  191. package/dist/{web3-DVv4jNul.mjs → web3-y_cY91V_.mjs} +1 -1
  192. package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B55-oXOa.mjs} +4 -4
  193. package/dist/{workers-D8czeT64.mjs → workers-jDcq14GH.mjs} +6 -6
  194. package/dist/{workflows-BOi5MTEN.mjs → workflows-B-kGHxFu.mjs} +2 -2
  195. package/dist/{zaraz-CGSSFJng.mjs → zaraz-27zwjLvv.mjs} +1 -1
  196. package/dist/zero-trust-DV3sIOvu.mjs +92 -0
  197. package/dist/{zone-Bx5ElO9U.mjs → zone-BJix2KQ9.mjs} +1 -1
  198. package/dist/{zones-_SnlZMiM.mjs → zones-Bkj5i92c.mjs} +1 -1
  199. package/package.json +2 -2
  200. package/dist/account-tags-CKRh1jra.mjs +0 -9
  201. package/dist/accounts-2pGhN4s8.mjs +0 -28
  202. package/dist/ai-search-2xP8FP_W.mjs +0 -7
  203. package/dist/analytics-UQrIx99t.mjs +0 -3
  204. package/dist/argo-Br60zF3y.mjs +0 -2
  205. package/dist/artifacts-D8HMRQmb.mjs +0 -4
  206. package/dist/browser-run-C5pYOwtf.mjs +0 -4
  207. package/dist/cloudforce-one-Cp4bQmrG.mjs +0 -30
  208. package/dist/connector-interrupts-BR47snkh.mjs +0 -2
  209. package/dist/custom-csrs-D0zBkQT5.mjs +0 -4
  210. package/dist/custom-nameservers-G2MWpRwY.mjs +0 -3
  211. package/dist/custom-pages-BINNZTds.mjs +0 -4
  212. package/dist/email-CGOC_evd.mjs +0 -2
  213. package/dist/email-routing-CRvIUSFm.mjs +0 -6
  214. package/dist/email-sending-BwRN8PMW.mjs +0 -7
  215. package/dist/filters-DczM8qpH.mjs +0 -4
  216. package/dist/firewall-BMiETRmM.mjs +0 -11
  217. package/dist/load-balancers-Ct5cyyF9.mjs +0 -7
  218. package/dist/logexplorer-BhsAWxCr.mjs +0 -24
  219. package/dist/logpush-CFQBi88z.mjs +0 -5
  220. package/dist/magic-network-monitoring-CY3CHSpX.mjs +0 -4
  221. package/dist/media-CnxgOViL.mjs +0 -2
  222. package/dist/mesh-DLNLi3UT.mjs +0 -4
  223. package/dist/observability-B5p3iwrq.mjs +0 -4
  224. package/dist/progress-C-oFUtvC.mjs +0 -2
  225. package/dist/radar-Cu9rsTw_.mjs +0 -2
  226. package/dist/realtimekit-msnGHBbf.mjs +0 -7
  227. package/dist/rulesets-BHvhAeG_.mjs +0 -8
  228. package/dist/sdk-m4xeaua4.mjs +0 -3
  229. package/dist/security-center-DRC4Mf3R.mjs +0 -2
  230. package/dist/src-CgAVPA4I.mjs +0 -108
  231. package/dist/waiting-rooms-ku9UsAr9.mjs +0 -11
  232. package/dist/zero-trust-BmA0VkgF.mjs +0 -102
  233. package/dist/zone-tags-izd3WWmy.mjs +0 -9
  234. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  235. /package/dist/{alerts-B85uj2Vx.mjs → alerts-CRmjqOZi.mjs} +0 -0
  236. /package/dist/{autorag-Do9l_LyY.mjs → autorag-BD7cu5NU.mjs} +0 -0
  237. /package/dist/{body-parser-CYD7PKFC.mjs → body-parser-C-c9gfH1.mjs} +0 -0
  238. /package/dist/{brands-DateHCdd.mjs → brands-BhALBkX2.mjs} +0 -0
  239. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
  240. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  241. /package/dist/{clear-CB2kgcEB.mjs → clear-BgF8No7D.mjs} +0 -0
  242. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-BsTty22w.mjs} +0 -0
  243. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C50W5GhA.mjs} +0 -0
  244. /package/dist/{health-buY5f5pp.mjs → health-BFNZqiAm.mjs} +0 -0
  245. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-Bav2M9F-.mjs} +0 -0
  246. /package/dist/{internal-CwyoJUHh.mjs → internal-BTeSewwB.mjs} +0 -0
  247. /package/dist/{live-wEpA5V_n.mjs → live-Dkiyu30_.mjs} +0 -0
  248. /package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BwQqexwo-CNW_dPly.mjs} +0 -0
  249. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-Dz-Wv1T0.mjs} +0 -0
  250. /package/dist/{ready-CBSCPiHE.mjs → ready-TKOkKeRg.mjs} +0 -0
  251. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-3Asm6eIi.mjs} +0 -0
  252. /package/dist/{refute-u7ZPQJZy.mjs → refute-BVz9nMyd.mjs} +0 -0
  253. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-CeBbH6Pq.mjs} +0 -0
  254. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-ZteA-PUV.mjs} +0 -0
  255. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-DWDSyzQ7.mjs} +0 -0
  256. /package/dist/{search-D9WDwnV4.mjs → search-DGNc37HK.mjs} +0 -0
  257. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-B5Qpn2mn.mjs} +0 -0
  258. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-FjUolE6A.mjs} +0 -0
  259. /package/dist/{theme-BePJemMn.mjs → theme-CeVf-5qG.mjs} +0 -0
  260. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-NHJj1HGq.mjs} +0 -0
  261. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CniKVHIp.mjs} +0 -0
  262. /package/dist/{verify-2yi0H93r.mjs → verify-DS1PWAJe.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-DM4z101s.mjs";import{t as f}from"./cli-types-BWdZbsFE.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.secretsStore.quota.get({account_id:l})),{successLabel:`Loaded`})}},h={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`store-id`,{type:`string`,description:`Store identifier.`,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 _={command:`create <store-id>`,describe:`Creates a secret in the account.`,builder:g,handler:async c=>{if(c.dryRun){a({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}/secrets`,pathParams:{"store-id":String(c[`store-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.secretsStore.secrets.bulk.create({body:e,account_id:u,store_id:c[`store-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(e){return e.positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).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:`Request body for bulk deleting secrets.`})}const y={command:`delete <store-id>`,describe:`Deletes one or more secrets.`,builder:v,handler:async l=>{if(l.dryRun){a({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${l[`store-id`]==null?`<store-id>`:encodeURIComponent(String(l[`store-id`]))}/secrets`,pathParams:{"store-id":String(l[`store-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({ids:l.ids}):s(l.body)});return}let u=await r(l),f=l.local?e:await t();if(l.accountId=f,!await d({force:!!l.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.secretsStore.quota.get({account_id:l})),{successLabel:`Loaded`})}},h={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`store-id`,{type:`string`,description:`Store identifier.`,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 _={command:`create <store-id>`,describe:`Creates a secret in the account.`,builder:g,handler:async c=>{if(c.dryRun){a({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}/secrets`,pathParams:{"store-id":String(c[`store-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.secretsStore.secrets.bulk.create({body:e,account_id:u,store_id:c[`store-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(e){return e.positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).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:`Request body for bulk deleting secrets.`})}const y={command:`delete <store-id>`,describe:`Deletes one or more secrets.`,builder:v,handler:async l=>{if(l.dryRun){a({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${l[`store-id`]==null?`<store-id>`:encodeURIComponent(String(l[`store-id`]))}/secrets`,pathParams:{"store-id":String(l[`store-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({ids:l.ids}):s(l.body)});return}let u=await r(l),f=l.local?e:await t();if(l.accountId=f,!await d({force:!!l.force})){process.stderr.write(`Aborted.
3
3
  `);return}if(l.body){let e=s(l.body);i(await o(`Deleting`,async()=>u.secretsStore.secrets.bulk.delete({...e,account_id:f,store_id:l[`store-id`]})),{successLabel:`Deleted`});return}if(l.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let p=c({ids:l.ids});i(await o(`Deleting`,async()=>u.secretsStore.secrets.bulk.delete({...p,account_id:f,store_id:l[`store-id`]})),{successLabel:`Deleted`})}},b={command:`bulk`,describe:`Operations for secrets.bulk`,builder:e=>e.command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,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 S={command:`delete <secret-id>`,describe:`Deletes a single secret.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${s[`store-id`]==null?`<store-id>`:encodeURIComponent(String(s[`store-id`]))}/secrets/${s[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(s[`secret-id`]))}`,pathParams:{"store-id":String(s[`store-id`]??``),"secret-id":String(s[`secret-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.secretsStore.secrets.delete({account_id:l,store_id:s[`store-id`],secret_id:s[`secret-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).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:`duplicate <secret-id>`,describe:`Creates a duplicate of the secret, keeping the value.`,builder:C,handler:async d=>{if(d.dryRun){a({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${d[`store-id`]==null?`<store-id>`:encodeURIComponent(String(d[`store-id`]))}/secrets/${d[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(d[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(d[`store-id`]??``),"secret-id":String(d[`secret-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({comment:l(d.comment,`comment`,`text`),name:l(d.name,`name`,`text`),scopes:d.scopes}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.secretsStore.secrets.duplicate({...e,account_id:p,store_id:d[`store-id`],secret_id:d[`secret-id`]})),{successLabel:`Created`});return}if(d.name===void 0&&(d.name=await u(`name`,`The name of the secret.`)),d.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let m=c({comment:l(d.comment,`comment`,`text`),name:l(d.name,`name`,`text`),scopes:d.scopes});i(await o(`Creating`,async()=>f.secretsStore.secrets.duplicate({...m,account_id:p,store_id:d[`store-id`],secret_id:d[`secret-id`]})),{successLabel:`Created`})}};function T(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).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 E={command:`edit <secret-id>`,describe:`Updates a single secret.`,builder:T,handler:async u=>{if(u.dryRun){a({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${u[`store-id`]==null?`<store-id>`:encodeURIComponent(String(u[`store-id`]))}/secrets/${u[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(u[`secret-id`]))}`,pathParams:{"store-id":String(u[`store-id`]??``),"secret-id":String(u[`secret-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),scopes:u.scopes,value:l(u.value,`value`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.secretsStore.secrets.edit({...e,account_id:f,store_id:u[`store-id`],secret_id:u[`secret-id`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),scopes:u.scopes,value:l(u.value,`value`,`text`)});i(await o(`Updating`,async()=>d.secretsStore.secrets.edit({...p,account_id:f,store_id:u[`store-id`],secret_id:u[`secret-id`]})),{successLabel:`Updated`})}};function D(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <secret-id>`,describe:`Returns details of a single secret.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${s[`store-id`]==null?`<store-id>`:encodeURIComponent(String(s[`store-id`]))}/secrets/${s[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(s[`secret-id`]))}`,pathParams:{"store-id":String(s[`store-id`]??``),"secret-id":String(s[`secret-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.secretsStore.secrets.get({account_id:l,store_id:s[`store-id`],secret_id:s[`secret-id`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment.`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field.`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all store secrets.`,builder:f(k),handler:async s=>{let c={direction:s.direction,page:s.page,per_page:s[`per-page`],search:s.search,order:s.order,scopes:s.scopes};if(s.dryRun){a({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores/${s[`store-id`]==null?`<store-id>`:encodeURIComponent(String(s[`store-id`]))}/secrets`,pathParams:{"store-id":String(s[`store-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.secretsStore.secrets.list({account_id:u,store_id:s[`store-id`],...c})),{successLabel:`Loaded`})}},j={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(S).command(w).command(E).command(O).command(A).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`name`,{type:`string`,description:`The name of the store.`}).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 N={command:`create`,describe:`Creates a store in the account.`,builder:M,handler:async d=>{if(d.dryRun){a({command:`cf secrets-store stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secrets_store/stores`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.secretsStore.stores.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the store.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.secretsStore.stores.create({...m,account_id:p})),{successLabel:`Created`})}};function P(e){return e.positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`When true, cascade-deletes all secrets in the store before deleting the store itself.
5
5
  Required when deleting a non-empty store. Without this parameter, attempting to
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{t as d}from"./cli-types-BsTty22w.mjs";function f(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque cursor for pagination. Use the cursor value from result_info of the previous response.`}).option(`field-changed`,{type:`string`,description:`Filter by the field that was changed.`,choices:[`status`,`user_classification`]}).option(`changed-by`,{type:`string`,description:`Filter by the actor that made the change.`}).option(`since`,{type:`string`,description:`Filter entries changed at or after this timestamp (RFC 3339).`}).option(`before`,{type:`string`,description:`Filter entries changed before this timestamp (RFC 3339).`}).option(`order`,{type:`string`,description:`Sort order for results. Use 'asc' for oldest first or 'desc' for newest first.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <issue-id>`,describe:`Lists audit log entries for a specific Security Center insight, showing changes to its status and classification over time.`,builder:d(f),handler:async c=>{let l={per_page:c[`per-page`],cursor:c.cursor,field_changed:c[`field-changed`],changed_by:c[`changed-by`],since:c.since,before:c.before,order:c.order};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center audit-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${c[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(c[`issue-id`]))}/audit-log`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(c[`issue-id`]??``)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.auditLogs.get({account_or_zone:d,account_or_zone_id:f,issue_id:c[`issue-id`],...l})),{successLabel:`Loaded`})}};function m(e){return e.option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque cursor for pagination. Use the cursor value from result_info of the previous response.`}).option(`field-changed`,{type:`string`,description:`Filter by the field that was changed.`,choices:[`status`,`user_classification`]}).option(`changed-by`,{type:`string`,description:`Filter by the actor that made the change.`}).option(`since`,{type:`string`,description:`Filter entries changed at or after this timestamp (RFC 3339).`}).option(`before`,{type:`string`,description:`Filter entries changed before this timestamp (RFC 3339).`}).option(`order`,{type:`string`,description:`Sort order for results. Use 'asc' for oldest first or 'desc' for newest first.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`Lists audit log entries for all Security Center insights in the account or zone, showing changes to insight status and classification.`,builder:d(m),handler:async c=>{let l={per_page:c[`per-page`],cursor:c.cursor,field_changed:c[`field-changed`],changed_by:c[`changed-by`],since:c.since,before:c.before,order:c.order};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/audit-log`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.auditLogs.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},g={command:`audit-logs`,describe:`Operations for audit-logs`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Retrieves Security Center insight counts aggregated by classification class.`,builder:d(_),handler:async c=>{let l={dismissed:c.dismissed,issue_class:c[`issue-class`],issue_type:c[`issue-type`],product:c.product,severity:c.severity,subject:c.subject};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/class`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.insights.class.get({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},y={command:`class`,describe:`Operations for insights.class`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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:`dismiss <issue-id>`,describe:`Archives a Security Center insight for an account or zone, removing it from the active insights list while preserving historical data.`,builder:b,handler:async u=>{if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf security-center insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${u[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(u[`issue-id`]))}/dismiss`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(u[`issue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({dismiss:u.dismiss}):c(u.body)});return}let d=await i(u),f=u.zone===void 0?`accounts`:`zones`,p=f===`zones`?await r({zone:u.zone},d,{quiet:u.quiet}):u.local?e:await t();if(f===`zones`?u.zoneId=p:u.accountId=p,u.body){let e=c(u.body);a(await s(`Updating`,async()=>d.securityCenter.insights.dismiss({...e,account_or_zone:f,account_or_zone_id:p,issue_id:u[`issue-id`]})),{successLabel:`Updated`});return}let m=l({dismiss:u.dismiss});a(await s(`Updating`,async()=>d.securityCenter.insights.dismiss({...m,account_or_zone:f,account_or_zone_id:p,issue_id:u[`issue-id`]})),{successLabel:`Updated`})}};function S(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all Security Center insights for the account or zone, showing security findings and recommendations.`,builder:d(S),handler:async c=>{let l={dismissed:c.dismissed,issue_class:c[`issue-class`],issue_type:c[`issue-type`],product:c.product,severity:c.severity,subject:c.subject,page:c.page,per_page:c[`per-page`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.insights.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function w(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`,builder:d(w),handler:async c=>{let l={dismissed:c.dismissed,issue_class:c[`issue-class`],issue_type:c[`issue-type`],product:c.product,severity:c.severity,subject:c.subject};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/severity`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.insights.severity.get({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},E={command:`severity`,describe:`Operations for insights.severity`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Retrieves Security Center insight counts aggregated by insight type.`,builder:d(D),handler:async c=>{let l={dismissed:c.dismissed,issue_class:c[`issue-class`],issue_type:c[`issue-type`],product:c.product,severity:c.severity,subject:c.subject};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/type`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.securityCenter.insights.type.get({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},k={command:`type`,describe:`Operations for insights.type`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`classification`,{type:`string`,description:`User-defined classification for the insight. Can be 'false_positive', 'accept_risk', 'other', or null.`,choices:[`false_positive`,`accept_risk`,`other`]}).option(`rationale`,{type:`string`,description:`Rationale for the classification change. Required when classification is 'accept_risk' or 'other'.`}).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-classification <issue-id>`,describe:`Updates the user classification for a Security Center insight. Valid values are 'false_positive' or 'accept_risk'. To reset, set classification to null. Cannot change directly between classification values - must reset to null first.`,builder:A,handler:async d=>{if(d.dryRun){let e=d.zone===void 0?await n():void 0,t=d.zone===void 0?`accounts`:`zones`,r=d.zone??e??`<account-id>`;o({command:`cf security-center insights update-classification`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${d[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(d[`issue-id`]))}/classification`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(d[`issue-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({classification:u(d.classification,`classification`,`text`),rationale:u(d.rationale,`rationale`,`text`)}):c(d.body)});return}let f=await i(d),p=d.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:d.zone},f,{quiet:d.quiet}):d.local?e:await t();if(p===`zones`?d.zoneId=m:d.accountId=m,d.body){let e=c(d.body);a(await s(`Updating`,async()=>f.securityCenter.insights.updateClassification({...e,account_or_zone:p,account_or_zone_id:m,issue_id:d[`issue-id`]})),{successLabel:`Updated`});return}let h=l({classification:u(d.classification,`classification`,`text`),rationale:u(d.rationale,`rationale`,`text`)});a(await s(`Updating`,async()=>f.securityCenter.insights.updateClassification({...h,account_or_zone:p,account_or_zone_id:m,issue_id:d[`issue-id`]})),{successLabel:`Updated`})}},M={command:`insights`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(x).command(C).command(j).command(y).command(E).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the most recent on-demand scans for the account or zone, up to a maximum of 5. Each scan includes its ID, start time, and current status. This includes both account or zone-wide and zone-scoped scans. Also returns quota information showing how many scans have been used and how many remain in the current 24-hour window.`,builder:N,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf security-center scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/scans`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.securityCenter.scans.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function F(e){return e.option(`issue-type`,{type:`string`,description:`The issue_type field`,choices:[`compliance_violation`,`email_security`,`exposed_infrastructure`,`insecure_configuration`,`weak_authentication`,`configuration_suggestion`]}).option(`issue-class`,{type:`string`,description:`The issue_class field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for starting an on-demand scan. Specify issue_type or issue_class to scope the scan, or provide an empty object to scan all issue types.`}).conflicts(`issue-type`,[`issue-class`]).conflicts(`issue-class`,[`issue-type`])}const I={command:`start`,describe:`Initiates an on-demand security scan for the entire account or zone, scanning all zones associated with the account or zone. Rate limited to 5 scans per account or zone per 24-hour window.`,builder:F,handler:async d=>{if(d.dryRun){let e=d.zone===void 0?await n():void 0,t=d.zone===void 0?`accounts`:`zones`,r=d.zone??e??`<account-id>`;o({command:`cf security-center scans start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/scans`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:d.body===void 0?l({issue_type:u(d[`issue-type`],`issue-type`,`text`),issue_class:u(d[`issue-class`],`issue-class`,`text`)}):c(d.body)});return}let f=await i(d),p=d.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:d.zone},f,{quiet:d.quiet}):d.local?e:await t();if(p===`zones`?d.zoneId=m:d.accountId=m,d.body){let e=c(d.body);a(await s(`Creating`,async()=>f.securityCenter.scans.start({body:e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`});return}let h=l({issue_type:u(d[`issue-type`],`issue-type`,`text`),issue_class:u(d[`issue-class`],`issue-class`,`text`)});a(await s(`Creating`,async()=>f.securityCenter.scans.start({body:h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`})}},L={command:`scans`,describe:`Operations for scans`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Returns account-level Security Center state: whether scans are enabled for the account and whether the account was recently reactivated from a dormant state.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf security-center state get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.securityCenter.state.get({account_id:l})),{successLabel:`Loaded`})}};function B(e){return e.option(`scans-enabled`,{type:`boolean`,description:`Enable or disable scans for the account.`}).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 V={command:`update`,describe:`Updates account-level Security Center state. Currently supports enabling or disabling scans for the account. Returns the account's state after the update.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf security-center state update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({scans_enabled:r[`scans-enabled`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>u.securityCenter.state.update({...e,account_id:d})),{successLabel:`Updated`});return}if(r[`scans-enabled`]===void 0)throw Error(`--scans-enabled is required (or pass --body with this field set).`);let f=l({scans_enabled:r[`scans-enabled`]});a(await s(`Updating`,async()=>u.securityCenter.state.update({...f,account_id:d})),{successLabel:`Updated`})}},H={command:`state`,describe:`Operations for state`,builder:e=>e.command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <issue-id>`,describe:`Returns the full context payload for an insight. This endpoint is used for insights with large payloads that are not included inline in the list response.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf security-center zone-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/security-center/insights/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/context`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.securityCenter.zoneInsights.context.get({account_id:l,issue_id:r[`issue-id`]})),{successLabel:`Loaded`})}},G={command:`context`,describe:`Operations for zone-insights.context`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`zone-insights`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`security-center`,describe:`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,builder:e=>e.command(g).command(M).command(L).command(H).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-BjHjJtnn.mjs";import{r as t}from"./auth-C6MhC9EZ.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-C-oFUtvC.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{n as c}from"./prompt-DM4z101s.mjs";function l(e){return e.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 u={command:`delete`,describe:`Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";import{n as c}from"./prompt-DdegNPpg.mjs";function l(e){return e.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 u={command:`delete`,describe:`Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.securityTxt.delete({zone_id:s})),{successLabel:`Deleted`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf security-txt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.securityTxt.get({zone_id:s})),{successLabel:`Loaded`})}};function p(e){return e.option(`acknowledgments`,{type:`string`,array:!0,description:`The acknowledgments field`}).option(`canonical`,{type:`string`,array:!0,description:`The canonical field`}).option(`contact`,{type:`string`,array:!0,description:`The contact field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`encryption`,{type:`string`,array:!0,description:`The encryption field`}).option(`expires`,{type:`string`,description:`The expires field`}).option(`hiring`,{type:`string`,array:!0,description:`The hiring field`}).option(`policy`,{type:`string`,array:!0,description:`The policy field`}).option(`preferred-languages`,{type:`string`,description:`The preferred_languages 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 m={command:`update`,describe:`Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information.`,builder:p,handler:async c=>{if(c.dryRun){r({command:`cf security-txt update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({acknowledgments:c.acknowledgments,canonical:c.canonical,contact:c.contact,enabled:c.enabled,encryption:c.encryption,expires:s(c.expires,`expires`,`text`),hiring:c.hiring,policy:c.policy,preferred_languages:s(c[`preferred-languages`],`preferred-languages`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.securityTxt.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=o({acknowledgments:c.acknowledgments,canonical:c.canonical,contact:c.contact,enabled:c.enabled,encryption:c.encryption,expires:s(c.expires,`expires`,`text`),hiring:c.hiring,policy:c.policy,preferred_languages:s(c[`preferred-languages`],`preferred-languages`,`text`)});n(await i(`Updating`,async()=>l.securityTxt.update({body:d,zone_id:u})),{successLabel:`Updated`})}},h={command:`security-txt`,describe:`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{o as e}from"./chunk-LQW53VED-Xakf_rUn.mjs";import"./delegate.mjs";import{a as t,n,t as r}from"./theme-BePJemMn.mjs";import{stripVTControlCharacters as i}from"node:util";function a({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const o=a();function s(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(o,``)}const c=(e=0)=>t=>`\u001B[${t+e}m`,l=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,u=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(d.modifier);const f=Object.keys(d.color),p=Object.keys(d.bgColor);[...f,...p];function m(){let e=new Map;for(let[t,n]of Object.entries(d)){for(let[t,r]of Object.entries(n))d[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=d[t],e.set(r[0],r[1]);Object.defineProperty(d,t,{value:n,enumerable:!1})}return Object.defineProperty(d,`codes`,{value:e,enumerable:!1}),d.color.close=`\x1B[39m`,d.bgColor.close=`\x1B[49m`,d.color.ansi=c(),d.color.ansi256=l(),d.color.ansi16m=u(),d.bgColor.ansi=c(10),d.bgColor.ansi256=l(10),d.bgColor.ansi16m=u(10),Object.defineProperties(d,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>d.rgbToAnsi256(...d.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>d.ansi256ToAnsi(d.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>d.ansi256ToAnsi(d.hexToAnsi256(e)),enumerable:!1}}),d}const h=m(),g=process.env.CLI_VERSION??`0.9.0`,_=`cf-cli/${g}`;function v(e){let t=n(),a=process.env.CF_DELEGATION?` ${t.dim(`·`)} ${t.dim(`delegated`)}`:``,o=`🍊☁️ ${t.bold.hex(r.orange)(`cf`)} ${t.dim(`·`)} ${t.dim(`v${e}`)}${a}`,s=i(o).length,c=`─`.repeat(s);return`${o}\n${t.hex(r.orange)(c)}`}let y=!1,b=!1,x=!1;function S(e,t={}){if(!(y||b)){if(t.quiet||!process.stderr.isTTY){b=!0;return}process.stderr.write(`${v(e)}\n`),y=!0}}function C(n){!y||b||x||n===`default`||e({allowGlobalAuthKey:!1})!==void 0||(process.stderr.write(`${t.muted(`Active profile:`)} ${t.info(n)}\n`),x=!0)}export{g as a,_ as i,C as n,h as o,v as r,s,S as t};
2
+ import{o as e}from"./chunk-LQW53VED-DLrXV-hE.mjs";import"./delegate.mjs";import{a as t,n,t as r}from"./theme-CeVf-5qG.mjs";import{stripVTControlCharacters as i}from"node:util";function a({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const o=a();function s(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(o,``)}const c=(e=0)=>t=>`\u001B[${t+e}m`,l=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,u=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(d.modifier);const f=Object.keys(d.color),p=Object.keys(d.bgColor);[...f,...p];function m(){let e=new Map;for(let[t,n]of Object.entries(d)){for(let[t,r]of Object.entries(n))d[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=d[t],e.set(r[0],r[1]);Object.defineProperty(d,t,{value:n,enumerable:!1})}return Object.defineProperty(d,`codes`,{value:e,enumerable:!1}),d.color.close=`\x1B[39m`,d.bgColor.close=`\x1B[49m`,d.color.ansi=c(),d.color.ansi256=l(),d.color.ansi16m=u(),d.bgColor.ansi=c(10),d.bgColor.ansi256=l(10),d.bgColor.ansi16m=u(10),Object.defineProperties(d,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>d.rgbToAnsi256(...d.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>d.ansi256ToAnsi(d.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>d.ansi256ToAnsi(d.hexToAnsi256(e)),enumerable:!1}}),d}const h=m(),g=process.env.CLI_VERSION??`0.10.0`,_=`cf-cli/${g}`;function v(e){let t=n(),a=process.env.CF_DELEGATION?` ${t.dim(`·`)} ${t.dim(`delegated`)}`:``,o=`🍊☁️ ${t.bold.hex(r.orange)(`cf`)} ${t.dim(`·`)} ${t.dim(`v${e}`)}${a}`,s=i(o).length,c=`─`.repeat(s);return`${o}\n${t.hex(r.orange)(c)}`}let y=!1,b=!1,x=!1;function S(e,t={}){if(!(y||b)){if(t.quiet||!process.stderr.isTTY){b=!0;return}process.stderr.write(`${v(e)}\n`),y=!0}}function C(n){!y||b||x||n===`default`||e({allowGlobalAuthKey:!1})!==void 0||(process.stderr.write(`${t.muted(`Active profile:`)} ${t.info(n)}\n`),x=!0)}export{g as a,_ as i,C as n,h as o,v as r,s,S as t};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-DM4z101s.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`name`,{type:`string`,description:`The name of the share.`}).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:`Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`,builder:m,handler:async d=>{if(d.dryRun){a({command:`cf share create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.share.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the share.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.share.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,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 <share-id>`,describe:`Deletion is not immediate, an updated share object with a new status will be returned.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf share delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.option(`name`,{type:`string`,description:`The name of the share.`}).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:`Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`,builder:m,handler:async d=>{if(d.dryRun){a({command:`cf share create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.share.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the share.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.share.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,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 <share-id>`,describe:`Deletion is not immediate, an updated share object with a new status will be returned.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf share delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.share.delete({account_id:l,share_id:s[`share-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <share-id>`,describe:`Fetches share by ID.`,builder:v,handler:async s=>{let c={include_resources:s[`include-resources`],include_recipient_counts:s[`include-recipient-counts`]};if(s.dryRun){a({command:`cf share get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.share.get({account_id:u,share_id:s[`share-id`],...c})),{successLabel:`Loaded`})}};function b(e){return e.option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists all account shares.`,builder:p(b),handler:async s=>{let c={status:s.status,kind:s.kind,target_type:s[`target-type`],resource_types:s[`resource-types`],order:s.order,direction:s.direction,page:s.page,per_page:s[`per-page`],include_resources:s[`include-resources`],include_recipient_counts:s[`include-recipient-counts`],tag:s.tag};if(s.dryRun){a({command:`cf share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.share.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const C={command:`create <share-id>`,describe:"Adds a single recipient to an account-targeted resource share, granting them access to the shared resources. The recipient account must belong to the same organization as the share owner. To replace the entire recipient list in one call, use `PUT /accounts/{account_id}/shares/{share_id}/recipients` instead.",builder:S,handler:async e=>{if(e.dryRun){a({command:`cf share recipient create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({organization_id:l(e[`organization-id`],`organization-id`,`text`)}):s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.share.recipient.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`});return}let n=c({organization_id:l(e[`organization-id`],`organization-id`,`text`)});i(await o(`Creating`,async()=>t.share.recipient.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`})}};function w(e){return e.positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,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 T={command:`delete <recipient-id>`,describe:"Performs a **soft delete**: sets the recipient's `desired_association_status` to `disassociated`, which signals the background reconciliation workflow (Temporal) to remove the shared resources from the recipient account. The recipient record remains in the database for audit purposes and is still returned by `GET /accounts/{account_id}/shares/{share_id}/recipients` with its updated status. Resource access is not fully removed until the workflow completes and `current_association_status` transitions to `disassociated`. The recipient record itself is never physically deleted.",builder:w,handler:async s=>{if(s.dryRun){a({command:`cf share recipient delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/recipients/${s[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(s[`recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"recipient-id":String(s[`recipient-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.share.recipient.delete({account_id:l,share_id:s[`share-id`],recipient_id:s[`recipient-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <recipient-id>`,describe:`Get share recipient by ID.`,builder:E,handler:async s=>{let c={include_resources:s[`include-resources`]};if(s.dryRun){a({command:`cf share recipient get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/recipients/${s[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(s[`recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"recipient-id":String(s[`recipient-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.share.recipient.get({account_id:u,share_id:s[`share-id`],recipient_id:s[`recipient-id`],...c})),{successLabel:`Loaded`})}};function O(e){return e.option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:'List share recipients by share ID. Returns **all** recipients regardless of their `association_status` (associating, associated, disassociating, disassociated). Callers that want only "active" recipients must filter client-side on the `association_status` field.',builder:O,handler:async e=>{let t={include_resources:e[`include-resources`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf share recipient list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);i(await o(`Loading`,async()=>n.share.recipient.list({account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t})),{successLabel:`Loaded`})}};function A(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,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 j={command:`update <share-id>`,describe:"Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (`target_type=organization`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.",builder:A,handler:async e=>{if(e.dryRun){a({command:`cf share recipient update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Updating`,async()=>t.share.recipient.update({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},M={command:`recipient`,describe:`Operations for recipient`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).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 <share-id>`,describe:`Adds a resource to an existing share, making it available to share recipients.`,builder:N,handler:async f=>{if(f.dryRun){a({command:`cf share resource create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${f[`share-id`]==null?`<share-id>`:encodeURIComponent(String(f[`share-id`]))}/resources`,pathParams:{"share-id":String(f[`share-id`]??``)},bodyKind:`json`,body:f.body===void 0?c({resource_account_id:l(f[`resource-account-id`],`resource-account-id`,`text`),resource_id:l(f[`resource-id`],`resource-id`,`text`),resource_type:l(f[`resource-type`],`resource-type`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.share.resource.create({body:e,account_id:m,share_id:f[`share-id`]})),{successLabel:`Created`});return}f[`resource-account-id`]===void 0&&(f[`resource-account-id`]=await u(`resource-account-id`,`Account identifier.`)),f[`resource-id`]===void 0&&(f[`resource-id`]=await u(`resource-id`,`Share Resource identifier.`)),f[`resource-type`]===void 0&&(f[`resource-type`]=await d(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let h=c({resource_account_id:l(f[`resource-account-id`],`resource-account-id`,`text`),resource_id:l(f[`resource-id`],`resource-id`,`text`),resource_type:l(f[`resource-type`],`resource-type`,`text`)});i(await o(`Creating`,async()=>p.share.resource.create({body:h,account_id:m,share_id:f[`share-id`]})),{successLabel:`Created`})}};function F(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,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 I={command:`delete <share-resource-id>`,describe:`Deletion is not immediate, an updated share resource object with a new status will be returned.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf share resource delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/resources/${s[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(s[`share-resource-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"share-resource-id":String(s[`share-resource-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>c.share.resource.delete({account_id:l,share_id:s[`share-id`],share_resource_id:s[`share-resource-id`]})),{successLabel:`Deleted`})}};function L(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <share-resource-id>`,describe:`Get share resource by ID.`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf share resource get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/resources/${s[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(s[`share-resource-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"share-resource-id":String(s[`share-resource-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.share.resource.get({account_id:l,share_id:s[`share-id`],share_resource_id:s[`share-resource-id`]})),{successLabel:`Loaded`})}};function z(e){return e.option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List share resources by share ID.`,builder:p(z),handler:async s=>{let c={status:s.status,resource_type:s[`resource-type`],page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf share resource list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/resources`,pathParams:{"share-id":String(s[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.share.resource.list({account_id:u,share_id:s[`share-id`],...c})),{successLabel:`Loaded`})}};function V(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,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 H={command:`update <share-resource-id>`,describe:`Update is not immediate, an updated share resource object with a new status will be returned.`,builder:V,handler:async c=>{if(c.dryRun){a({command:`cf share resource update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/resources/${c[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(c[`share-resource-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"share-resource-id":String(c[`share-resource-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.share.resource.update({...e,account_id:u,share_id:c[`share-id`],share_resource_id:c[`share-resource-id`]})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},U={command:`resource`,describe:`Operations for resource`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for `PUT /accounts/{account_id}/shares/{share_id}`. The share's display `name` and `tags` can be updated via this endpoint. To modify recipients, use the `/accounts/{account_id}/shares/{share_id}/recipients` subresource endpoints (POST, PUT, DELETE). "})}const G={command:`update <share-id>`,describe:"Updates the share's display name and tags. This endpoint does **not** modify recipients or resources — those are managed via dedicated subresource endpoints: - **Recipients**: Use `POST /accounts/{account_id}/shares/{share_id}/recipients` to add a single recipient, `PUT /accounts/{account_id}/shares/{share_id}/recipients` to replace the full recipient list, or `DELETE /accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` to remove a recipient. - **Resources**: Use the share's resource subresource endpoints. Updating is not immediate; an updated share object with a new status will be returned.",builder:W,handler:async d=>{if(d.dryRun){a({command:`cf share update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${d[`share-id`]==null?`<share-id>`:encodeURIComponent(String(d[`share-id`]))}`,pathParams:{"share-id":String(d[`share-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.share.update({...e,account_id:p,share_id:d[`share-id`]})),{successLabel:`Updated`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the share.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Updating`,async()=>f.share.update({...m,account_id:p,share_id:d[`share-id`]})),{successLabel:`Updated`})}},K={command:`share`,describe:`share`,builder:e=>e.command(h).command(_).command(y).command(x).command(G).command(M).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,o as t}from"./theme-BePJemMn.mjs";import"./ui-DjQ4AQww.mjs";import{f as n}from"./oauth-BjHjJtnn.mjs";import{c as r}from"./interactive-CM2G03lr.mjs";import{i}from"./auth-C6MhC9EZ.mjs";import{a,i as o,n as s}from"./build-Nivzj54_.mjs";import{a as c,c as l,i as u,l as d,n as f,o as p,t as m}from"./deploy-input-BRMQehgs.mjs";function h(e){return e.option(`mode`,{type:`string`,alias:`m`,description:`Deployment mode (e.g. production, staging, preview)`}).option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output API files without building`,default:!1}).option(`tag`,{type:`string`,description:`A tag to associate with this Worker Version`,requiresArg:!0}).option(`message`,{type:`string`,description:`A message to associate with this Worker Version`,requiresArg:!0}).option(`secrets-file`,{type:`string`,description:`Path to a file containing secrets to upload with the version (JSON or .env format)`,requiresArg:!0}).option(`dry-run`,{describe:`Build a project and run checks without actually uploading the Worker`,type:`boolean`,default:!1})}async function g(h,g){h.prebuilt||(await s(h.mode),r.message(``,{spacing:0}));let{workers:{default:_},settings:v}=await a(process.cwd()),{wranglerConfig:y,builtConfig:b}=o(_,v),x=m(_,b),S=await i(),C=await n();if(d(c(S)),g.command===`Deploy`){let n=f(_,y,C,h);r.message(e.bold(`Deploy`),{symbol:t.dim(`├`),spacing:0}),await p(n,y,x,{syncWorkersSite:void 0,getNormalizedContainerOptions:void 0,buildContainer:void 0,deployContainers:void 0,analyseBundle:void 0})}else{let n=u(_,y,C,h);r.message(e.bold(`Upload`),{symbol:t.dim(`├`),spacing:0}),await l(n,y,x,{analyseBundle:void 0})}r.success(h[`dry-run`]?`Dry run complete`:`${g.command} complete`)}export{h as n,g as t};
2
+ import{a as e,o as t}from"./theme-CeVf-5qG.mjs";import"./ui-DE8CNn6c.mjs";import{f as n}from"./oauth-B0ETkNcX.mjs";import{c as r}from"./interactive-DtsCYfrK.mjs";import{i}from"./auth-MQEamPN9.mjs";import{a,i as o,n as s}from"./build-DcflwvqN.mjs";import{a as c,c as l,i as u,l as d,n as f,o as p,t as m}from"./deploy-input-CrvuoDGJ.mjs";function h(e){return e.option(`mode`,{type:`string`,alias:`m`,description:`Deployment mode (e.g. production, staging, preview)`}).option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output API files without building`,default:!1}).option(`tag`,{type:`string`,description:`A tag to associate with this Worker Version`,requiresArg:!0}).option(`message`,{type:`string`,description:`A message to associate with this Worker Version`,requiresArg:!0}).option(`secrets-file`,{type:`string`,description:`Path to a file containing secrets to upload with the version (JSON or .env format)`,requiresArg:!0}).option(`dry-run`,{describe:`Build a project and run checks without actually uploading the Worker`,type:`boolean`,default:!1})}async function g(h,g){h.prebuilt||(await s(h.mode),r.message(``,{spacing:0}));let{workers:{default:_},settings:v}=await a(process.cwd()),{wranglerConfig:y,builtConfig:b}=o(_,v),x=m(_,b),S=await i(),C=await n();if(d(c(S)),g.command===`Deploy`){let n=f(_,y,C,h);r.message(e.bold(`Deploy`),{symbol:t.dim(`├`),spacing:0}),await p(n,y,x,{syncWorkersSite:void 0,getNormalizedContainerOptions:void 0,buildContainer:void 0,deployContainers:void 0,analyseBundle:void 0})}else{let n=u(_,y,C,h);r.message(e.bold(`Upload`),{symbol:t.dim(`├`),spacing:0}),await l(n,y,x,{analyseBundle:void 0})}r.success(h[`dry-run`]?`Dry run complete`:`${g.command} complete`)}export{h as n,g as t};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-BjHjJtnn.mjs";import{r as t}from"./auth-C6MhC9EZ.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-C-oFUtvC.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{a as c,n as l}from"./prompt-DM4z101s.mjs";function u(e){return e.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 d={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
3
- `);return}n(await i(`Deleting`,async()=>o.smartShield.cacheReserveClear.clear({zone_id:s})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.smartShield.cacheReserveClear.status({zone_id:s})),{successLabel:`Loaded`})}},m={command:`cache-reserve-clear`,describe:`Operations for cache-reserve-clear`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve Smart Shield Settings.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.smartShield.get({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`,default:!1}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`,default:!1}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`],default:`GET`}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`,default:`/`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`,default:80}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`],default:`connection_established`}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`,default:80}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).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 v={command:`create`,describe:`Create a new health check.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.smartShield.healthChecks.create({body:e,zone_id:d})),{successLabel:`Created`});return}l.address===void 0&&(l.address=await c(`address`,`The hostname or IP address of the origin server to run health checks on.`)),l.name===void 0&&(l.name=await c(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)});n(await i(`Creating`,async()=>u.smartShield.healthChecks.create({body:f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,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 b={command:`delete <healthcheck-id>`,describe:`Delete a health check.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/healthchecks/${a[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(a[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(a[`healthcheck-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";import{a as c,n as l}from"./prompt-DdegNPpg.mjs";function u(e){return e.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 d={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
3
+ `);return}n(await i(`Deleting`,async()=>o.smartShield.cacheReserveClear.clear({zone_id:s})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.smartShield.cacheReserveClear.status({zone_id:s})),{successLabel:`Loaded`})}},m={command:`cache-reserve-clear`,describe:`Operations for cache-reserve-clear`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve Smart Shield Settings.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.smartShield.get({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).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 v={command:`create`,describe:`Create a new health check.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.smartShield.healthChecks.create({body:e,zone_id:d})),{successLabel:`Created`});return}l.address===void 0&&(l.address=await c(`address`,`The hostname or IP address of the origin server to run health checks on.`)),l.name===void 0&&(l.name=await c(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)});n(await i(`Creating`,async()=>u.smartShield.healthChecks.create({body:f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,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 b={command:`delete <healthcheck-id>`,describe:`Delete a health check.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/healthchecks/${a[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(a[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(a[`healthcheck-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
4
4
  `);return}n(await i(`Deleting`,async()=>o.smartShield.healthChecks.delete({zone_id:s,healthcheck_id:a[`healthcheck-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).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 <healthcheck-id>`,describe:`Patch a configured health check.`,builder:x,handler:async l=>{if(l.dryRun){r({command:`cf smart-shield health-checks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/smart_shield/healthchecks/${l[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(l[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(l[`healthcheck-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.smartShield.healthChecks.edit({body:e,zone_id:d,healthcheck_id:l[`healthcheck-id`]})),{successLabel:`Updated`});return}l.address===void 0&&(l.address=await c(`address`,`The hostname or IP address of the origin server to run health checks on.`)),l.name===void 0&&(l.name=await c(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=o({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)});n(await i(`Updating`,async()=>u.smartShield.healthChecks.edit({body:f,zone_id:d,healthcheck_id:l[`healthcheck-id`]})),{successLabel:`Updated`})}};function C(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <healthcheck-id>`,describe:`Fetch a single configured health check.`,builder:C,handler:async a=>{if(a.dryRun){r({command:`cf smart-shield health-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/healthchecks/${a[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(a[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(a[`healthcheck-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.smartShield.healthChecks.get({zone_id:s,healthcheck_id:a[`healthcheck-id`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List configured health checks.`,builder:T,handler:async a=>{let o={page:a.page,per_page:a[`per-page`]};if(a.dryRun){r({command:`cf smart-shield health-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.smartShield.healthChecks.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function D(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`result-address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`result-check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`result-consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`result-consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`result-description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`result-http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`result-http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`result-http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`result-http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`result-http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`result-http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`result-http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`result-interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`result-name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`result-retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`result-suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`result-tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`result-tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`result-timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`result-type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).option(`success`,{type:`boolean`,description:`Whether the API call was successful.`}).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 O={command:`update <healthcheck-id>`,describe:`Update a configured health check.`,builder:D,handler:async c=>{if(c.dryRun){r({command:`cf smart-shield health-checks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/smart_shield/healthchecks/${c[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(c[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(c[`healthcheck-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({result:{address:s(c[`result-address`],`result-address`,`text`),check_regions:c[`result-check-regions`],consecutive_fails:c[`result-consecutive-fails`],consecutive_successes:c[`result-consecutive-successes`],description:s(c[`result-description`],`result-description`,`text`),http_config:{allow_insecure:c[`result-http-config-allow-insecure`],expected_body:s(c[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:c[`result-http-config-expected-codes`],follow_redirects:c[`result-http-config-follow-redirects`],method:s(c[`result-http-config-method`],`result-http-config-method`,`text`),path:s(c[`result-http-config-path`],`result-http-config-path`,`text`),port:c[`result-http-config-port`]},interval:c[`result-interval`],name:s(c[`result-name`],`result-name`,`text`),retries:c[`result-retries`],suspended:c[`result-suspended`],tcp_config:{method:s(c[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:c[`result-tcp-config-port`]},timeout:c[`result-timeout`],type:s(c[`result-type`],`result-type`,`text`)},success:c.success}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.smartShield.healthChecks.update({...e,zone_id:u,healthcheck_id:c[`healthcheck-id`]})),{successLabel:`Updated`});return}if(c.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);let d=o({result:{address:s(c[`result-address`],`result-address`,`text`),check_regions:c[`result-check-regions`],consecutive_fails:c[`result-consecutive-fails`],consecutive_successes:c[`result-consecutive-successes`],description:s(c[`result-description`],`result-description`,`text`),http_config:{allow_insecure:c[`result-http-config-allow-insecure`],expected_body:s(c[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:c[`result-http-config-expected-codes`],follow_redirects:c[`result-http-config-follow-redirects`],method:s(c[`result-http-config-method`],`result-http-config-method`,`text`),path:s(c[`result-http-config-path`],`result-http-config-path`,`text`),port:c[`result-http-config-port`]},interval:c[`result-interval`],name:s(c[`result-name`],`result-name`,`text`),retries:c[`result-retries`],suspended:c[`result-suspended`],tcp_config:{method:s(c[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:c[`result-tcp-config-port`]},timeout:c[`result-timeout`],type:s(c[`result-type`],`result-type`,`text`)},success:c.success});n(await i(`Updating`,async()=>l.smartShield.healthChecks.update({...d,zone_id:u,healthcheck_id:c[`healthcheck-id`]})),{successLabel:`Updated`})}},k={command:`health-checks`,describe:`Operations for health-checks`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`cache-reserve-value`,{type:`string`,description:`Specifies the enablement value of Cache Reserve.`,choices:[`on`,`off`]}).option(`regional-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Regional Tiered Cache.`,choices:[`on`,`off`]}).option(`smart-routing-value`,{type:`string`,description:`Specifies the enablement value of Smart Routing.`,choices:[`on`,`off`]}).option(`smart-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The patch body for Smart Shield.`})}const j={command:`update`,describe:`Set Smart Shield Settings.`,builder:A,handler:async c=>{if(c.dryRun){r({command:`cf smart-shield update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({cache_reserve:{value:s(c[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:s(c[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:s(c[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:s(c[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.smartShield.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=o({cache_reserve:{value:s(c[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:s(c[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:s(c[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:s(c[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}});n(await i(`Updating`,async()=>l.smartShield.update({...d,zone_id:u})),{successLabel:`Updated`})}},M={command:`smart-shield`,describe:`smart-shield`,builder:e=>e.command(g).command(j).command(m).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{M as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-BjHjJtnn.mjs";import{a as t,r as n}from"./auth-C6MhC9EZ.mjs";import{t as r}from"./output-DgW1hQGX.mjs";import{n as i,t as a}from"./progress-C-oFUtvC.mjs";import{n as o}from"./body-parser-CYD7PKFC.mjs";import{n as s,t as c}from"./input-validation-BBKJRoRB.mjs";import{n as l}from"./prompt-DM4z101s.mjs";import{n as u,t as d}from"./raw-fetch-25gXED6c.mjs";function f(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,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 p={command:`get <snippet-name>`,describe:`Fetches the content of a snippet belonging to the zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}/content`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let r=await n(t);t.zoneId=await e({zone:t.zone},r,{quiet:t.quiet});let o=await a(`Loading`,async()=>d(`/zones/${t.zoneId}/snippets/${encodeURIComponent(String(t[`snippet-name`]))}/content`,{method:`GET`,local:t.local===!0,persistTo:t.persistTo}));u(t.text===!0?o.toString(`utf-8`):o)}},m={command:`content`,describe:`Operations for content`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,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 <snippet-name>`,describe:`Deletes a snippet belonging to the zone. Returns a 4XX response if the zone or snippet no longer exists.`,builder:h,handler:async t=>{if(t.dryRun){i({command:`cf snippets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await l({force:!!t.force})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-B0ETkNcX.mjs";import{a as t,r as n}from"./auth-MQEamPN9.mjs";import{t as r}from"./output-DrpYYfnB.mjs";import{n as i,t as a}from"./progress-CsHIt3Tp.mjs";import{n as o}from"./body-parser-C-c9gfH1.mjs";import{n as s,t as c}from"./input-validation-Bav2M9F-.mjs";import{n as l}from"./prompt-DdegNPpg.mjs";import{n as u,t as d}from"./raw-fetch-CteyTOM2.mjs";function f(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,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 p={command:`get <snippet-name>`,describe:`Fetches the content of a snippet belonging to the zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}/content`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let r=await n(t);t.zoneId=await e({zone:t.zone},r,{quiet:t.quiet});let o=await a(`Loading`,async()=>d(`/zones/${t.zoneId}/snippets/${encodeURIComponent(String(t[`snippet-name`]))}/content`,{method:`GET`,local:t.local===!0,persistTo:t.persistTo}));u(t.text===!0?o.toString(`utf-8`):o)}},m={command:`content`,describe:`Operations for content`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,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 <snippet-name>`,describe:`Deletes a snippet belonging to the zone. Returns a 4XX response if the zone or snippet no longer exists.`,builder:h,handler:async t=>{if(t.dryRun){i({command:`cf snippets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await l({force:!!t.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>o.snippets.delete({zone_id:s,snippet_name:t[`snippet-name`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <snippet-name>`,describe:`Fetches a snippet belonging to the zone.`,builder:_,handler:async t=>{if(t.dryRun){i({command:`cf snippets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.snippets.get({zone_id:s,snippet_name:t[`snippet-name`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Specifies the current page number.`}).option(`per-page`,{type:`number`,description:`Specifies how many results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches all snippets belonging to the zone.`,builder:y,handler:async t=>{let o={page:t.page,per_page:t[`per-page`]};if(t.dryRun){i({command:`cf snippets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.snippets.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function x(e){return e.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 S={command:`delete`,describe:`Deletes all snippet rules belonging to the zone.`,builder:x,handler:async t=>{if(t.dryRun){i({command:`cf snippets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await l({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>o.snippets.rules.delete({zone_id:s})),{successLabel:`Deleted`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Fetches all snippet rules belonging to the zone.`,builder:C,handler:async t=>{if(t.dryRun){i({command:`cf snippets rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.snippets.rules.list({zone_id:s})),{successLabel:`Loaded`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet rules object.`})}const E={command:`update`,describe:`Updates all snippet rules belonging to the zone.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf snippets rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.snippets.rules.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/snippets/snippet_rules`)),{successLabel:`Updated`})}},D={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet object.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`Provide metadata about the snippet.`})}const k={command:`update <snippet-name>`,describe:`Creates or updates a snippet belonging to the zone.`,builder:O,handler:async o=>{if(o.dryRun){i({command:`cf snippets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/snippets/${o[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(o[`snippet-name`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"snippet-name":String(o[`snippet-name`]??``)},bodyKind:`multipart`,body:{body:o.body,file:o.file,metadata:o.metadata}});return}let l=await n(o);if(o.zoneId=await e({zone:o.zone},l,{quiet:o.quiet}),o.file!==void 0||o.body!==void 0||o.metadata!==void 0){let e=new FormData;if(o.file){let t=c(o.file);e.append(`file`,new Blob([t]),o.file.split(/[\\/]/).filter(Boolean).pop())}else o.body!==void 0&&e.append(`file`,o.body);if(o.metadata!==void 0){let t=typeof o.metadata==`string`?s(o.metadata,`metadata`,`text`):o.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r(await a(`Updating`,async()=>t(l,`PUT`,`/zones/${o.zoneId}/snippets/${encodeURIComponent(String(o[`snippet-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(o.body){let e=s(o.body,`body`,`binary`);r(await a(`Updating`,async()=>t(l,`PUT`,`/zones/${o.zoneId}/snippets/${encodeURIComponent(String(o[`snippet-name`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},A={command:`snippets`,describe:`snippets`,builder:e=>e.command(g).command(v).command(b).command(k).command(m).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};