cf 1.0.0-beta.17 → 1.0.0-beta.18

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 (226) hide show
  1. package/dist/_meta/commands.json +6117 -4540
  2. package/dist/_meta/schemas.json +5016 -3257
  3. package/dist/{abuse-reports-C4LxDvUM.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
  4. package/dist/{access-DnWW2AAT.mjs → access-BtsMwesh.mjs} +1 -1
  5. package/dist/{accounts-8UcHNm3S.mjs → accounts-X5QVzEUW.mjs} +27 -21
  6. package/dist/{acm-qRM3iy4Z.mjs → acm-C_NepMi6.mjs} +1 -1
  7. package/dist/{addressing-CAb8z2Dq.mjs → addressing-BkQY1hoA.mjs} +18 -18
  8. package/dist/{agent-memory-oIUP4ZV5.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
  9. package/dist/{ai-DnhytGdc.mjs → ai-Bb0_Zknm.mjs} +1 -1
  10. package/dist/{ai-audit-B7_5EOcN.mjs → ai-audit-DuEjVdML.mjs} +1 -1
  11. package/dist/{ai-gateway-b3FFu6UV.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
  12. package/dist/ai-search-DDRpxyOM.mjs +79 -0
  13. package/dist/{ai-security-KUs94UW-.mjs → ai-security-A2STvE1b.mjs} +5 -5
  14. package/dist/{alerting-CCmyEPzN.mjs → alerting-CIwSk-Ks.mjs} +1 -1
  15. package/dist/{analytics-BAvBj6qx.mjs → analytics-H--uM3DA.mjs} +7 -7
  16. package/dist/{analytics-engine-DAJp89gM.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
  17. package/dist/{api-security-BItVQymb.mjs → api-security-D-pcnhUL.mjs} +26 -26
  18. package/dist/{argo-DsJCvfml.mjs → argo-Lvmcx3am.mjs} +1 -1
  19. package/dist/{artifacts-DzHXeah6.mjs → artifacts-xT5S-mVa.mjs} +1 -1
  20. package/dist/{audit-logs-D9XxsVZm.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
  21. package/dist/{auth-C530fHKQ.mjs → auth-B73lQS2h.mjs} +1 -1
  22. package/dist/auth-DMzEmOhG.mjs +2 -0
  23. package/dist/{auth-MNz2D-PD.mjs → auth-Db1KT0vm.mjs} +1 -1
  24. package/dist/{auth-token-Cw4c0y89.mjs → auth-token-D9XIPlwf.mjs} +1 -1
  25. package/dist/{basin-catalog-DcMiZV9J.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
  26. package/dist/{billing-COgAWTYh.mjs → billing-Bm2JNSGa.mjs} +6 -6
  27. package/dist/body-parser-DnBfDdx3.mjs +2 -0
  28. package/dist/{bot-management-Dx3lh9Fi.mjs → bot-management-CSr38g-O.mjs} +4 -4
  29. package/dist/{botnet-feed-C8496Nhl.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
  30. package/dist/{brand-protection-B0p8Sv6s.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
  31. package/dist/browser-run-BcWxzhAn.mjs +42 -0
  32. package/dist/{builds-DmEFTQTa.mjs → builds-BMwDzi7G.mjs} +39 -39
  33. package/dist/{cache-BUh85NRr.mjs → cache-_VaTLC5T.mjs} +1 -1
  34. package/dist/{cli-DJhpXf38.mjs → cli-P3q5DG3W.mjs} +1 -1
  35. package/dist/{client-side-security-km3-4L_4.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
  36. package/dist/{cloud-connector-BoKFprDD.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
  37. package/dist/{cloudforce-one-DN5N3C3w.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
  38. package/dist/{command-B694oLDo.mjs → command-BXiA79DP.mjs} +1 -1
  39. package/dist/{command-rx0Kb5pn.mjs → command-BbsPxJBT.mjs} +1 -1
  40. package/dist/{command-RC9WM5jq.mjs → command-Bkc04OyY.mjs} +1 -1
  41. package/dist/{command-Bmee6uwe.mjs → command-BtTc28ql.mjs} +1 -1
  42. package/dist/{command-CAs3SxlI.mjs → command-CBZhxmKD.mjs} +1 -1
  43. package/dist/{command-CCq-Z2Ua.mjs → command-CL7LLXM7.mjs} +1 -1
  44. package/dist/{command-DerHAjQL.mjs → command-CYyfigfC.mjs} +1 -1
  45. package/dist/{command-D1JR8Fb7.mjs → command-CxWLFv5Y.mjs} +1 -1
  46. package/dist/{command-CiApsRql.mjs → command-DDcBC4px.mjs} +1 -1
  47. package/dist/{command-CbQFbfps.mjs → command-NoxvOARP.mjs} +1 -1
  48. package/dist/{completions-11latun5.mjs → completions-CrDmwKnK.mjs} +1 -1
  49. package/dist/{connector-interrupts-wvQcZsO1.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
  50. package/dist/{connector-telemetry-events-C0GGCIQk.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
  51. package/dist/{connector-telemetry-snapshots-ZXzsFgea.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
  52. package/dist/{connectors-DXIUG4Zi.mjs → connectors-DvVlxGDx.mjs} +1 -1
  53. package/dist/{containers-DCH6MFjY.mjs → containers-Bt2zFsFd.mjs} +8 -8
  54. package/dist/{containers-WMWKhLkp.mjs → containers-BtcOgwm5.mjs} +2 -2
  55. package/dist/{content-scan-CRDmR7rD.mjs → content-scan-DldLmTjy.mjs} +1 -1
  56. package/dist/{context-q-6bMSL-.mjs → context-C_a8oSY9.mjs} +1 -1
  57. package/dist/cps-REo1OWP1.mjs +6 -0
  58. package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
  59. package/dist/{custom-csrs-BV017SqE.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
  60. package/dist/{custom-hostnames-DI_dFaof.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
  61. package/dist/{custom-nameservers-BLoE8VGG.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
  62. package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
  63. package/dist/{d1-Dbs8HItA.mjs → d1-DvCiQibO.mjs} +8 -8
  64. package/dist/{deploy-5utIiOMN.mjs → deploy-K664XPOb.mjs} +1 -1
  65. package/dist/{deploy-context-C0iVbWRG.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
  66. package/dist/{diagnostics-C9B07eJY.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
  67. package/dist/{dls-lbM3i4x-.mjs → dls-DoqfqutH.mjs} +1 -1
  68. package/dist/{dns-QTMPGYMa.mjs → dns-DC6WcO3m.mjs} +21 -21
  69. package/dist/{dns-firewall-Bfv0S44I.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
  70. package/dist/{docs-bV3hPwQL.mjs → docs-CqNRBHab.mjs} +1 -1
  71. package/dist/{durable-objects-0JvGTV27.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
  72. package/dist/{email-auth-PzRqG0ex.mjs → email-auth--NHg1TjG.mjs} +1 -1
  73. package/dist/{email-routing-BgHL0Rbz.mjs → email-routing-COjENK55.mjs} +13 -13
  74. package/dist/{email-security-CSTKIecn.mjs → email-security-rdjH95T2.mjs} +38 -38
  75. package/dist/{email-sending-BSwuAir8.mjs → email-sending-26VJhR6Q.mjs} +18 -18
  76. package/dist/{field-extractors-B_lFnwaL.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
  77. package/dist/{firewall-BsZxVitA.mjs → firewall-D8K93ffF.mjs} +20 -20
  78. package/dist/{flagship-qBohOZaM.mjs → flagship-CHdmCmvQ.mjs} +11 -11
  79. package/dist/{fraud-vGNdrSm-.mjs → fraud-CY4TV5Vc.mjs} +1 -1
  80. package/dist/{google-tag-gateway-BHdOg4VW.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
  81. package/dist/healthchecks-B52Mf3uL.mjs +22 -0
  82. package/dist/{hostnames-CLlaMqHu.mjs → hostnames-BMITIM8P.mjs} +1 -1
  83. package/dist/{hyperdrive-CXTqaIqk.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
  84. package/dist/{iam-Dl_n_Lqq.mjs → iam-o1n9eUXf.mjs} +9 -9
  85. package/dist/{images-vMtXk2Rf.mjs → images-CJHAGxX6.mjs} +37 -37
  86. package/dist/index.mjs +1 -1
  87. package/dist/{init-_7djeBVw.mjs → init-CqQDL6i3.mjs} +1 -1
  88. package/dist/{intel-Bq4GGXv-.mjs → intel-B3S1gxUg.mjs} +1 -1
  89. package/dist/{ips-BcvZS46g.mjs → ips-q_UJMiy8.mjs} +1 -1
  90. package/dist/{k2-DL4hrVTj.mjs → k2-BNqVZnDN.mjs} +2 -2
  91. package/dist/{kv-BLo9wMgb.mjs → kv-B0nXSOcW.mjs} +1 -1
  92. package/dist/{lazy-command-CRcT6Dx-.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
  93. package/dist/{leaked-credential-checks-Dx4RXMyN.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
  94. package/dist/load-balancers-DJtMztJ0.mjs +76 -0
  95. package/dist/{login-Du_W6b9o.mjs → login-D-1FiBNv.mjs} +1 -1
  96. package/dist/{login-DT6Q1UJw.mjs → login-chQP8825.mjs} +1 -1
  97. package/dist/{logo-matches-C-1J0Oc3.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
  98. package/dist/{logos-BuhvSu_H.mjs → logos-tnIahhcu.mjs} +1 -1
  99. package/dist/{logpush-DgZtF9vG.mjs → logpush-D4s3pJRw.mjs} +24 -24
  100. package/dist/{logs-CaKOk-1v.mjs → logs-cw7UL5V2.mjs} +3 -3
  101. package/dist/{magic-cloud-networking-CKxXYT8r.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
  102. package/dist/{magic-network-monitoring-BykFGQCz.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
  103. package/dist/{magic-transit-DYULsrUP.mjs → magic-transit-BFopRdPs.mjs} +170 -170
  104. package/dist/{managed-defense-DIb_uN25.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
  105. package/dist/{managed-transforms-an3wQ0DW.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
  106. package/dist/{matches-DkLSWb5X.mjs → matches-ClJ_24EY.mjs} +1 -1
  107. package/dist/{mcp-BcV1XqE8.mjs → mcp-50os3IRG.mjs} +10 -10
  108. package/dist/{mesh-CSSlZ-0F.mjs → mesh-jxtQP8sS.mjs} +2 -2
  109. package/dist/{monetization-B-nJ0SyI.mjs → monetization-D6cCDi-h.mjs} +4 -4
  110. package/dist/{network-ZzxQ_Dcz.mjs → network-dnWHB2uY.mjs} +27 -25
  111. package/dist/{network-interconnects-CI9NXQpe.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
  112. package/dist/{o11y-LG6Y9LUZ.mjs → o11y-oMSg1pG4.mjs} +49 -49
  113. package/dist/{oauth-CP82E1_0.mjs → oauth-BfBdHhPS.mjs} +1 -1
  114. package/dist/{oauth-Bx693Af5.mjs → oauth-DDOiiH7h.mjs} +1 -1
  115. package/dist/{oauth-clients-BA30rTEl.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
  116. package/dist/{oauth-scopes-hseWES1v.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
  117. package/dist/organization-94lHeeOs.mjs +75 -0
  118. package/dist/{organizations-CcgZPmFl.mjs → organizations-BJf3UTFi.mjs} +1 -1
  119. package/dist/{origin-post-quantum-encryption-BhdlaolV.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
  120. package/dist/{page-rules-DFfqfllI.mjs → page-rules-BUI-50oz.mjs} +4 -4
  121. package/dist/pages-CcdpCzHs.mjs +54 -0
  122. package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
  123. package/dist/{pay-per-use-C_HxhpM4.mjs → pay-per-use-t066I5wm.mjs} +7 -7
  124. package/dist/{pipelines-DUMIVwof.mjs → pipelines-Co6S044l.mjs} +8 -8
  125. package/dist/precursor-BftyvS86.mjs +4 -0
  126. package/dist/previews-BLhnhElx.mjs +7 -0
  127. package/dist/{progress-DaQ4MzBI.mjs → progress-Q5w9PNTT.mjs} +1 -1
  128. package/dist/{prompt-KWYZvJWM.mjs → prompt-C0hKSr-R.mjs} +1 -1
  129. package/dist/{queries-DoyhspQf.mjs → queries-4MubO6Sz.mjs} +3 -3
  130. package/dist/{queues-BPxTU2rU.mjs → queues-CteS5M92.mjs} +17 -17
  131. package/dist/{r2-CQt4S7o7.mjs → r2-2QpT_Gso.mjs} +24 -24
  132. package/dist/{radar-CALpR1vq.mjs → radar-ODKaK4FJ.mjs} +1 -1
  133. package/dist/{raw-fetch-Cy09TjHc.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
  134. package/dist/{realtime-BiHKBoI4.mjs → realtime-DkfU8uEX.mjs} +84 -84
  135. package/dist/registrar-DM6JTVPS.mjs +43 -0
  136. package/dist/{registrar-sandbox-BttFwYqE.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
  137. package/dist/{reporting-8aRJD5HX.mjs → reporting-5yFNXbJg.mjs} +1 -1
  138. package/dist/{request-headers-CqfJOkpO.mjs → request-headers-DXvswze2.mjs} +1 -1
  139. package/dist/request-tracers-BarLZY95.mjs +4 -0
  140. package/dist/{resource-sharing-uVVpMW0w.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
  141. package/dist/{rules-CFOuN3t2.mjs → rules-_C31X4Jz.mjs} +6 -6
  142. package/dist/{rulesets-DkhV2Hny.mjs → rulesets-8RwxoFhG.mjs} +6 -6
  143. package/dist/{rum-BnMW0Tlb.mjs → rum-CAUcpXpM.mjs} +6 -6
  144. package/dist/{run-Clc3P2u7.mjs → run-DtFLvOHB.mjs} +1 -1
  145. package/dist/run-LcOb9rhI.mjs +2 -0
  146. package/dist/{schema-flags-b096XMpt.mjs → schema-flags-DibfxEF6.mjs} +1 -1
  147. package/dist/{scim-tvZm6A-r.mjs → scim-DX5XrQ4w.mjs} +1 -1
  148. package/dist/{secrets-store-DuNxSh1_.mjs → secrets-store-DSqqrr25.mjs} +1 -1
  149. package/dist/{security-insights-C17c9ZYZ.mjs → security-insights-FSktO04S.mjs} +1 -1
  150. package/dist/{security-txt-D4pRk7-w.mjs → security-txt-D2g3lQdg.mjs} +1 -1
  151. package/dist/{shared-zePemxHi.mjs → shared-eefMO8R4.mjs} +1 -1
  152. package/dist/smart-shield-IVb2sR0C.mjs +24 -0
  153. package/dist/{snippets-BIcZ6vSW.mjs → snippets-cWwWficN.mjs} +2 -2
  154. package/dist/{spectrum-DjDX0geK.mjs → spectrum-DYiIBYRB.mjs} +1 -1
  155. package/dist/{speed-DiPoFJMm.mjs → speed-C7uiW2Wf.mjs} +1 -1
  156. package/dist/{sql-DLjCt_R3.mjs → sql-TGV8qQMj.mjs} +1 -1
  157. package/dist/{src-CutrsNl4.mjs → src-BUH-P_zd.mjs} +5 -5
  158. package/dist/ssl-xQP_HbWN.mjs +139 -0
  159. package/dist/{stream-uhn_Zsni.mjs → stream-CfWgj8Cr.mjs} +55 -55
  160. package/dist/{submit-C3suIDBX.mjs → submit-DxGr1T40.mjs} +1 -1
  161. package/dist/tags-LEJ2VYhQ.mjs +23 -0
  162. package/dist/{telemetry-DYjsavEr.mjs → telemetry-BHne10Yy.mjs} +1 -1
  163. package/dist/telemetry-BavSU4ku.mjs +2 -0
  164. package/dist/{tenant-DK88yQM4.mjs → tenant-7d5vwc6K.mjs} +1 -1
  165. package/dist/{tenant-custom-nameservers-BZ1JD1Yf.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
  166. package/dist/{tunnels-DjbomhCa.mjs → tunnels-DlGODvwT.mjs} +4 -4
  167. package/dist/{turnstile-DXrbEy2A.mjs → turnstile-DhLkdhij.mjs} +5 -5
  168. package/dist/update-check-nLfkSfdz.mjs +2 -0
  169. package/dist/update-check-worker.mjs +1 -1
  170. package/dist/{update-check-BhhtSXVZ.mjs → update-check-wvjOsnGK.mjs} +1 -1
  171. package/dist/{url-info-a0mY4UsC.mjs → url-info-CeoV5dBc.mjs} +1 -1
  172. package/dist/{url-normalization-DiwpDIhc.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
  173. package/dist/{url-scanner-D0egjBe5.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
  174. package/dist/{user-DDH9lxf5.mjs → user-D33B3alX.mjs} +59 -59
  175. package/dist/{vectorize-DaT3amFV.mjs → vectorize-Wp9De13y.mjs} +17 -17
  176. package/dist/version-B2RUUqGT.mjs +2 -0
  177. package/dist/{waiting-rooms-BGMpu9gS.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
  178. package/dist/{web-assets-NqNglLSI.mjs → web-assets-ew0iaP7c.mjs} +35 -35
  179. package/dist/{web3-UnCUuIfB.mjs → web3-BUyXBaqq.mjs} +6 -6
  180. package/dist/{workers-builds-Cy6fdtm5.mjs → workers-builds-DzU9NGno.mjs} +7 -7
  181. package/dist/{workers-for-platforms-JscCHivQ.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
  182. package/dist/{workers-DfA9ugmb.mjs → workers-pP5tsDbD.mjs} +25 -22
  183. package/dist/{workers-vpc-FDZQBqOu.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
  184. package/dist/{workflows-Dq-k81hU.mjs → workflows-DXYGKtqq.mjs} +1 -1
  185. package/dist/zaraz-DoH4QD0u.mjs +22 -0
  186. package/dist/{zero-trust-CZ685QhO.mjs → zero-trust-DKt20rzE.mjs} +461 -458
  187. package/dist/{zone-DcZIUTWt.mjs → zone-BXM3p0JR.mjs} +1 -1
  188. package/dist/{zones-BVdvYUCv.mjs → zones-CJdtqEBx.mjs} +21 -21
  189. package/package.json +9 -9
  190. package/dist/account-tags-zvHRQZxb.mjs +0 -15
  191. package/dist/ai-search-CtfW5fzl.mjs +0 -79
  192. package/dist/auth-Ccm5viK_.mjs +0 -2
  193. package/dist/body-parser-DkHKPkJ7.mjs +0 -2
  194. package/dist/browser-run-ChXohmNG.mjs +0 -42
  195. package/dist/certificate-authorities-BTLdA7EQ.mjs +0 -6
  196. package/dist/client-certificates-B3UxH_Au.mjs +0 -13
  197. package/dist/cps-Due0P5IW.mjs +0 -6
  198. package/dist/csam-scanner-DvLrPw45.mjs +0 -10
  199. package/dist/ct-alerting-BtEGkRJi.mjs +0 -5
  200. package/dist/custom-certificates-CMLXTTEc.mjs +0 -17
  201. package/dist/custom-pages-ubava9Qm.mjs +0 -21
  202. package/dist/dcv-delegation-sGGt6UU_.mjs +0 -4
  203. package/dist/healthchecks-DAYYLZ6u.mjs +0 -22
  204. package/dist/keyless-certificates-0pzjkZb6.mjs +0 -13
  205. package/dist/keys-BSV5IXdU.mjs +0 -4
  206. package/dist/load-balancers-CCCWoQXv.mjs +0 -76
  207. package/dist/mtls-certificates-ukwDz6Lc.mjs +0 -13
  208. package/dist/organization-DMr_z6n4.mjs +0 -71
  209. package/dist/origin-ca-certificates-BZxUbB5N.mjs +0 -11
  210. package/dist/origin-tls-client-auth-DzbZvtmi.mjs +0 -30
  211. package/dist/pages-BkcL5rC4.mjs +0 -54
  212. package/dist/pay-per-crawl-Dulm7Xy5.mjs +0 -38
  213. package/dist/precursor-DsGbA_YJ.mjs +0 -4
  214. package/dist/previews-Cma3-M7K.mjs +0 -7
  215. package/dist/registrar-gERQ3b85.mjs +0 -43
  216. package/dist/request-tracers-DcnwQg3K.mjs +0 -4
  217. package/dist/resource-tagging-SlsUtLsq.mjs +0 -4
  218. package/dist/run-CHNyLZLG.mjs +0 -2
  219. package/dist/smart-shield-2egm1Vaw.mjs +0 -24
  220. package/dist/ssl-vNzK0c9S.mjs +0 -45
  221. package/dist/tags-Dy2jG-Dt.mjs +0 -4
  222. package/dist/telemetry-Bdv5LZZs.mjs +0 -2
  223. package/dist/update-check-Dld7rbLd.mjs +0 -2
  224. package/dist/values-Bfr5-bL6.mjs +0 -4
  225. package/dist/version-CAuKDZAG.mjs +0 -2
  226. package/dist/zaraz-Dpr1pLDx.mjs +0 -22
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-MNz2D-PD.mjs";import{a as r,t as i}from"./context-q-6bMSL-.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-DaQ4MzBI.mjs";import{t as c}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-KWYZvJWM.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,t as i}from"./context-C_a8oSY9.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-Q5w9PNTT.mjs";import{t as c}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as l,n as u,t as d}from"./body-parser-DnBfDdx3.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-C0hKSr-R.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
3
3
 
4
- Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>c({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_rules:e[`delete-rules`],rules:u(e.rules,`rules`)}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({delete_rules:e[`delete-rules`],rules:u(e.rules,`rules`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
4
+ Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>c({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
5
5
 
6
- Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>c({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:u,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Creating`,async()=>c.send(_,{body:p,account_id:u,ruleset_id:e[`ruleset-id`]}));a(m,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
6
+ Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>c({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:l,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Creating`,async()=>c.send(_,{body:p,account_id:l,ruleset_id:e[`ruleset-id`]}));a(m,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
7
7
 
8
8
  Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>c({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force})){process.stderr.write(`Aborted.
9
9
  `);return}let u=await s(`Deleting`,async()=>c.send(b,{account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(u,{successLabel:`Deleted`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`};function w(e){return e.usage(`$0 rum rules list
10
10
 
11
11
  Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>c({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(C,{account_id:l,ruleset_id:e[`ruleset-id`]}));a(u,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`,body:`json`};function D(e){return e.usage(`$0 rum rules update <rule-id>
12
12
 
13
- Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>c({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(E,{body:t,account_id:u,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(n,{successLabel:`Updated`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Updating`,async()=>c.send(E,{body:p,account_id:u,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(m,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
13
+ Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>c({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(E,{body:t,account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(n,{successLabel:`Updated`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Updating`,async()=>c.send(E,{body:p,account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(m,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
14
14
 
15
- Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).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:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>c({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(A,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}let p=d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Creating`,async()=>c.send(A,{body:p,account_id:u}));a(m,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
15
+ Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).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:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>c({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(A,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}let p=d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Creating`,async()=>c.send(A,{body:p,account_id:l}));a(m,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
16
16
 
17
17
  Deletes an existing Web Analytics site.`).positional(`site-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 F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>c({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force})){process.stderr.write(`Aborted.
18
18
  `);return}let u=await s(`Deleting`,async()=>c.send(N,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function ee(e){return e.usage(`$0 rum site-info get <site-id>
@@ -25,6 +25,6 @@ Returns all zone tags associated with Web Analytics sites for an account. These
25
25
 
26
26
  Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>c({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let c={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){let e=await r();o({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(W,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`,body:`json`};function J(e){return e.usage(`$0 rum site-info update <site-id>
27
27
 
28
- Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>c({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(q,{body:t,account_id:u,site_id:e[`site-id`]}));a(n,{successLabel:`Updated`});return}let p=d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Updating`,async()=>c.send(q,{body:p,account_id:u,site_id:e[`site-id`]}));a(m,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
28
+ Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>c({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(q,{body:t,account_id:l,site_id:e[`site-id`]}));a(n,{successLabel:`Updated`});return}let p=d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Updating`,async()=>c.send(q,{body:p,account_id:l,site_id:e[`site-id`]}));a(m,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
29
29
 
30
30
  Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>c({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(X,{account_id:l,hostname:e.hostname}));a(u,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(L).command(K).command(B).command(U).command(Y).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(k).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{$ as n}from"./dist-DZRTPMMA.mjs";import{n as r}from"./version-CAuKDZAG.mjs";import{t as i}from"./delegate-Tgfxa-MZ.mjs";import{i as a,r as o}from"./lifecycle-oud60haK.mjs";import{i as s,t as c}from"./interactive-BW9T1D1q.mjs";import{t as l}from"./request-headers-CqfJOkpO.mjs";import{n as u,t as d}from"./state-Boubf1X6.mjs";import{t as f}from"./error-sanitization-pOyzm2F1.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${p?`sending`:`would send`}: ${JSON.stringify(n)}`),p)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=/* @__PURE__ */ new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=/* @__PURE__ */ new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
2
+ import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{$ as n}from"./dist-DZRTPMMA.mjs";import{n as r}from"./version-B2RUUqGT.mjs";import{t as i}from"./delegate-Tgfxa-MZ.mjs";import{i as a,r as o}from"./lifecycle-oud60haK.mjs";import{i as s,t as c}from"./interactive-BW9T1D1q.mjs";import{t as l}from"./request-headers-DXvswze2.mjs";import{n as u,t as d}from"./state-Boubf1X6.mjs";import{t as f}from"./error-sanitization-pOyzm2F1.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${p?`sending`:`would send`}: ${JSON.stringify(n)}`),p)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=/* @__PURE__ */ new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=/* @__PURE__ */ new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./run-DtFLvOHB.mjs";export{e as runWithTelemetry};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{n as t}from"./version-CAuKDZAG.mjs";import{i as n}from"./cf-Bq4pA4n6.mjs";import{i as r}from"./body-parser-DkHKPkJ7.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-KWYZvJWM.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
2
+ import{r as e}from"./theme-BGHWSKCw.mjs";import{n as t}from"./version-B2RUUqGT.mjs";import{i as n}from"./cf-Bq4pA4n6.mjs";import{a as r}from"./body-parser-DnBfDdx3.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-C0hKSr-R.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
3
3
  `)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=/* @__PURE__ */ new Set(/* @__PURE__ */ `$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,/* @__PURE__ */ new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>d(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>d(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0||A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
4
4
  `)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[.../* @__PURE__ */ new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(_&&g.length!==0)for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
5
5
  `)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>d(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>d(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:l,maximum:u,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!d(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>d(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(l!==void 0&&(f===!0?t<=l:t<l)&&n.push(f===!0?`--${r} must be greater than ${l}`:`--${r} must be at least ${l}`),u!==void 0&&(p===!0?t>=u:t>u)&&n.push(p===!0?`--${r} must be less than ${u}`:`--${r} must be at most ${u}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!d(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>d(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>d(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`)){if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`)){if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=/* @__PURE__ */ new Set([...ve,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-MNz2D-PD.mjs";import{a as i,t as a}from"./context-q-6bMSL-.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-DaQ4MzBI.mjs";import{t as l}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-KWYZvJWM.mjs";function ee(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={command:`create`,describe:`Create SCIM Group`,builder:ee,handler:async e=>l({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`});return}if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var m={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-Db1KT0vm.mjs";import{a as i,t as a}from"./context-C_a8oSY9.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-Q5w9PNTT.mjs";import{t as l}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-C0hKSr-R.mjs";function ee(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={command:`create`,describe:`Create SCIM Group`,builder:ee,handler:async e=>l({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`});return}if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var m={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
3
3
 
4
4
  Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style 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 g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>l({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await f({force:!!e.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
5
5
  `);return}let u=await c(`Deleting`,async()=>n.send(m,{account_id:l,group_id:e[`group-id`]}));o(u,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style 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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async e=>l({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Updated`});return}if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{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.`)})};var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`};function b(e){return e.usage(`$0 scim groups get <group-id>
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-MNz2D-PD.mjs";import{a as r,t as i}from"./context-q-6bMSL-.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-DaQ4MzBI.mjs";import{t as c}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-KWYZvJWM.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/quota`};function h(e){return e.usage(`$0 secrets-store quota get
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,t as i}from"./context-C_a8oSY9.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-Q5w9PNTT.mjs";import{t as c}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as l,t as u}from"./body-parser-DnBfDdx3.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-C0hKSr-R.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/quota`};function h(e){return e.usage(`$0 secrets-store quota get
3
3
 
4
4
  Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`View secret usage`,builder:h,handler:async e=>c({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(m,{account_id:l}));a(u,{successLabel:`Loaded`})})},_={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,body:`json`};function y(e){return e.usage(`$0 secrets-store secrets bulk-delete
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-MNz2D-PD.mjs";import{a as r,i,t as a}from"./context-q-6bMSL-.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-DaQ4MzBI.mjs";import{t as l}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p,t as m}from"./raw-fetch-Cy09TjHc.mjs";var h={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/${t.issue_id}/audit-log`,query:[`per_page`,`cursor`,`field_changed`,`changed_by`,`since`,`before`,`order`]};function g(e){return e.usage(`$0 security-insights audit-logs get <issue-id>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,i,t as a}from"./context-C_a8oSY9.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-Q5w9PNTT.mjs";import{t as l}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as u,t as d}from"./body-parser-DnBfDdx3.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p,t as m}from"./raw-fetch-CEOuoKl9.mjs";var h={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/${t.issue_id}/audit-log`,query:[`per_page`,`cursor`,`field_changed`,`changed_by`,`since`,`before`,`order`]};function g(e){return e.usage(`$0 security-insights audit-logs get <issue-id>
3
3
 
4
4
  Lists audit log entries for a specific Security Center insight, showing changes to its status and classification over time.`).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 ee={command:`get <issue-id>`,describe:`Retrieves Issue Audit Log`,builder:g,handler:async e=>l({command:`security-insights audit-logs get`,classification:{safeFlags:[`field-changed`,`order`,`dry-run`]}},e,async()=>{let l={per_page:e[`per-page`],cursor:e.cursor,field_changed:e[`field-changed`],changed_by:e[`changed-by`],since:e.since,before:e.before,order:e.order};if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf security-insights audit-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/audit-log`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"issue-id":String(e[`issue-id`]??``)},query:l,bodyKind:`none`});return}let u=await n(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await a();d===`zones`?e.zoneId=f:e.accountId=f;let p=await c(`Loading`,async()=>u.send(h,{account_or_zone:d,account_or_zone_id:f,issue_id:e[`issue-id`],...l}));o(p,{successLabel:`Loaded`})})};var _={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/audit-log`,query:[`per_page`,`cursor`,`field_changed`,`changed_by`,`since`,`before`,`order`]};function te(e){return e.usage(`$0 security-insights audit-logs list
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-MNz2D-PD.mjs";import{i as n}from"./context-q-6bMSL-.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-DaQ4MzBI.mjs";import{t as o}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{n as u}from"./prompt-KWYZvJWM.mjs";var d={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/security-center/securitytxt`};function f(e){return e.usage(`$0 security-txt delete
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-Db1KT0vm.mjs";import{i as n}from"./context-C_a8oSY9.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-Q5w9PNTT.mjs";import{t as o}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as s,t as c}from"./body-parser-DnBfDdx3.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{n as u}from"./prompt-C0hKSr-R.mjs";var d={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/security-center/securitytxt`};function f(e){return e.usage(`$0 security-txt delete
3
3
 
4
4
  Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`).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 p={command:`delete`,describe:`Deletes security.txt`,builder:f,handler:async e=>o({command:`security-txt delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await u({force:!!e.force})){process.stderr.write(`Aborted.
5
5
  `);return}let c=await a(`Deleting`,async()=>o.send(d,{zone_id:s}));r(c,{successLabel:`Deleted`})})};var m={method:`GET`,path:t=>e`/zones/${t.zone_id}/security-center/securitytxt`};function h(e){return e.usage(`$0 security-txt get
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{i as t,r as n}from"./dotenv-usOKkeW7.mjs";import{J as r,K as i,rt as a}from"./dist-DZRTPMMA.mjs";import"./ui-BtIBQeaG.mjs";import{n as o}from"./dist-uRuGmkMB.mjs";import{t as s}from"./context-q-6bMSL-.mjs";import{_ as c,d as l,f as u,t as d}from"./deploy-context-C0iVbWRG.mjs";import{t as f}from"./auth-token-Cw4c0y89.mjs";import{c as p,i as m,l as h,t as g}from"./containers-WMWKhLkp.mjs";import{a as _,i as v,n as y,o as b,r as x}from"./build-i8l2qGVZ.mjs";import{i as S,n as C,t as w}from"./deploy-input-KK6yyBN_.mjs";import{readBuildOutput as T}from"@cloudflare/build-output-utils";function E(e){return e.option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output Specification 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}).option(`worker`,x)}async function D(e,t){if(!e.prebuilt){if(await y(e.mode,{worker:e.worker,dryRun:e[`dry-run`]})===`setup-needed`){o.success(`--dry-run: exiting now.`);return}o.message(``,{spacing:0})}return n(e,()=>O(e,t))}async function O(n,y){let{workers:x,rootConfig:E,containers:D}=await T(process.cwd());if(E.buildContext.isPreview){let e=[`cf previews deploy`,...n.prebuilt?[`--prebuilt`]:[],...E.buildContext.mode===void 0?[]:[`--mode`,E.buildContext.mode]].join(` `);throw Error(`This build output is for a Preview. Run ${e} instead.`)}b(n.mode,E.buildContext.mode);let O=_(x,n.worker),k=v(O,E),A=t(k.wranglerConfig),j=w(O,k.builtConfig),M=n[`dry-run`]?``:await f(),N=n[`dry-run`]?void 0:E.accountId??await s({skipProjectSettings:!0,complianceRegion:r(A)}),P=d(M);h(P),c({logger:P.logger,fetchResult:P.fetchResult,fetchPagedListResult:P.fetchPagedListResult}),N!==void 0&&D.length>0&&u(N,M,i(A));let F=g(D,A,{accountId:N,containersRollout:n[`containers-rollout`]}),I;if(y.command===`Deploy`){let t=C(O,A,N,n,F);o.message(e.bold(`Deploy`),{symbol:e.muted(`├`),spacing:0}),{versionId:I}=await m(t,A,j,{syncWorkersSite:void 0,analyseBundle:void 0})}else{let t=S(O,A,N,n,F);o.message(e.bold(`Upload`),{symbol:e.muted(`├`),spacing:0}),{versionId:I}=await p(t,A,j,{analyseBundle:void 0})}I!==null&&!n[`dry-run`]&&(y.command!==`Deploy`||n[`containers-rollout`]!==`none`)&&await l([...y.command===`Deploy`?F.standard.builtImages:[],...F.durableObjects.builtImages],a()),n[`dry-run`]||o.success(`${y.command} complete`)}export{E as n,D as t};
2
+ import{r as e}from"./theme-BGHWSKCw.mjs";import{i as t,r as n}from"./dotenv-usOKkeW7.mjs";import{J as r,K as i,rt as a}from"./dist-DZRTPMMA.mjs";import"./ui-BtIBQeaG.mjs";import{n as o}from"./dist-uRuGmkMB.mjs";import{t as s}from"./context-C_a8oSY9.mjs";import{_ as c,d as l,f as u,t as d}from"./deploy-context-ClNVJYlR.mjs";import{t as f}from"./auth-token-D9XIPlwf.mjs";import{c as p,i as m,l as h,t as g}from"./containers-BtcOgwm5.mjs";import{a as _,i as v,n as y,o as b,r as x}from"./build-i8l2qGVZ.mjs";import{i as S,n as C,t as w}from"./deploy-input-KK6yyBN_.mjs";import{readBuildOutput as T}from"@cloudflare/build-output-utils";function E(e){return e.option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output Specification 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}).option(`worker`,x)}async function D(e,t){if(!e.prebuilt){if(await y(e.mode,{worker:e.worker,dryRun:e[`dry-run`]})===`setup-needed`){o.success(`--dry-run: exiting now.`);return}o.message(``,{spacing:0})}return n(e,()=>O(e,t))}async function O(n,y){let{workers:x,rootConfig:E,containers:D}=await T(process.cwd());if(E.buildContext.isPreview){let e=[`cf previews deploy`,...n.prebuilt?[`--prebuilt`]:[],...E.buildContext.mode===void 0?[]:[`--mode`,E.buildContext.mode]].join(` `);throw Error(`This build output is for a Preview. Run ${e} instead.`)}b(n.mode,E.buildContext.mode);let O=_(x,n.worker),k=v(O,E),A=t(k.wranglerConfig),j=w(O,k.builtConfig),M=n[`dry-run`]?``:await f(),N=n[`dry-run`]?void 0:E.accountId??await s({skipProjectSettings:!0,complianceRegion:r(A)}),P=d(M);h(P),c({logger:P.logger,fetchResult:P.fetchResult,fetchPagedListResult:P.fetchPagedListResult}),N!==void 0&&D.length>0&&u(N,M,i(A));let F=g(D,A,{accountId:N,containersRollout:n[`containers-rollout`]}),I;if(y.command===`Deploy`){let t=C(O,A,N,n,F);o.message(e.bold(`Deploy`),{symbol:e.muted(`├`),spacing:0}),{versionId:I}=await m(t,A,j,{syncWorkersSite:void 0,analyseBundle:void 0})}else{let t=S(O,A,N,n,F);o.message(e.bold(`Upload`),{symbol:e.muted(`├`),spacing:0}),{versionId:I}=await p(t,A,j,{analyseBundle:void 0})}I!==null&&!n[`dry-run`]&&(y.command!==`Deploy`||n[`containers-rollout`]!==`none`)&&await l([...y.command===`Deploy`?F.standard.builtImages:[],...F.durableObjects.builtImages],a()),n[`dry-run`]||o.success(`${y.command} complete`)}export{E as n,D as t};
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-Db1KT0vm.mjs";import{i as n}from"./context-C_a8oSY9.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-Q5w9PNTT.mjs";import{t as o}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as s,n as c,r as l,t as u}from"./body-parser-DnBfDdx3.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-C0hKSr-R.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function h(e){return e.usage(`$0 smart-shield cache-reserve-clear clear
3
+
4
+ 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.`).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:`clear`,describe:`Start Cache Reserve Clear`,builder:h,handler:async e=>o({command:`smart-shield cache-reserve-clear clear`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
5
+ `);return}let c=await a(`Deleting`,async()=>o.send(m,{zone_id:s}));r(c,{successLabel:`Deleted`})})};var _={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function v(e){return e.usage(`$0 smart-shield cache-reserve-clear status
6
+
7
+ 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.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`status`,describe:`Get Cache Reserve Clear`,builder:v,handler:async e=>o({command:`smart-shield cache-reserve-clear status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(_,{zone_id:s}));r(c,{successLabel:`Loaded`})})},b={command:`cache-reserve-clear`,describe:`Cache Reserve Clear operations`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield`,errors:{500:`InternalServerError`,502:`BadGatewayError`}};function S(e){return e.usage(`$0 smart-shield get
8
+
9
+ Retrieve Smart Shield Settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Get Smart Shield Settings`,builder:S,handler:async e=>o({command:`smart-shield get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(x,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var w={method:`POST`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks`,body:`json`};function T(e){return e.usage(`$0 smart-shield health-checks create
10
+
11
+ Create a new health check.`).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-header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. Provide as a JSON object or @path/to/file.json.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`http-config-method`,e=>d(e,`http-config-method`,`text`)).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`]}).coerce(`tcp-config-method`,e=>d(e,`tcp-config-method`,`text`)).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 E={command:`create`,describe:`Create Health Check`,builder:T,handler:async e=>o({command:`smart-shield health-checks create`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({address:d(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:d(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:d(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],header:l(e[`http-config-header`],`http-config-header`),method:e[`http-config-method`],path:d(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:d(e.name,`name`,`text`),retries:e.retries,suspended:e.suspended,tcp_config:{method:e[`tcp-config-method`],port:e[`tcp-config-port`]},timeout:e.timeout,type:d(e.type,`type`,`text`)},[[`http_config`,`header`]]):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Creating`,async()=>o.send(w,{body:t,zone_id:s}));r(n,{successLabel:`Created`});return}e.address===void 0&&(e.address=await f(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await f(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let p=u({address:d(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:d(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:d(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],header:l(e[`http-config-header`],`http-config-header`),method:e[`http-config-method`],path:d(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:d(e.name,`name`,`text`),retries:e.retries,suspended:e.suspended,tcp_config:{method:e[`tcp-config-method`],port:e[`tcp-config-port`]},timeout:e.timeout,type:d(e.type,`type`,`text`)},[[`http_config`,`header`]]),m=await a(`Creating`,async()=>o.send(w,{body:p,zone_id:s}));r(m,{successLabel:`Created`})})};var D={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`};function O(e){return e.usage(`$0 smart-shield health-checks delete <healthcheck-id>
12
+
13
+ Delete a health check.`).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 k={command:`delete <healthcheck-id>`,describe:`Delete Health Check`,builder:O,handler:async e=>o({command:`smart-shield health-checks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks/${e[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(e[`healthcheck-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"healthcheck-id":String(e[`healthcheck-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force})){process.stderr.write(`Aborted.
14
+ `);return}let c=await a(`Deleting`,async()=>o.send(D,{zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(c,{successLabel:`Deleted`})})};var A={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`,body:`json`};function j(e){return e.usage(`$0 smart-shield health-checks edit <healthcheck-id>
15
+
16
+ Patch a configured health check.`).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-header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. Provide as a JSON object or @path/to/file.json.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`http-config-method`,e=>d(e,`http-config-method`,`text`)).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`]}).coerce(`tcp-config-method`,e=>d(e,`tcp-config-method`,`text`)).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 M={command:`edit <healthcheck-id>`,describe:`Patch Health Check`,builder:j,handler:async e=>o({command:`smart-shield health-checks edit`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield health-checks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks/${e[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(e[`healthcheck-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"healthcheck-id":String(e[`healthcheck-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({address:d(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:d(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:d(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],header:l(e[`http-config-header`],`http-config-header`),method:e[`http-config-method`],path:d(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:d(e.name,`name`,`text`),retries:e.retries,suspended:e.suspended,tcp_config:{method:e[`tcp-config-method`],port:e[`tcp-config-port`]},timeout:e.timeout,type:d(e.type,`type`,`text`)},[[`http_config`,`header`]]):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Updating`,async()=>o.send(A,{body:t,zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(n,{successLabel:`Updated`});return}e.address===void 0&&(e.address=await f(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await f(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let p=u({address:d(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:d(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:d(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],header:l(e[`http-config-header`],`http-config-header`),method:e[`http-config-method`],path:d(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:d(e.name,`name`,`text`),retries:e.retries,suspended:e.suspended,tcp_config:{method:e[`tcp-config-method`],port:e[`tcp-config-port`]},timeout:e.timeout,type:d(e.type,`type`,`text`)},[[`http_config`,`header`]]),m=await a(`Updating`,async()=>o.send(A,{body:p,zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(m,{successLabel:`Updated`})})};var N={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`};function P(e){return e.usage(`$0 smart-shield health-checks get <healthcheck-id>
17
+
18
+ Fetch a single configured health check.`).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 F={command:`get <healthcheck-id>`,describe:`Health Check Details`,builder:P,handler:async e=>o({command:`smart-shield health-checks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield health-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks/${e[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(e[`healthcheck-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"healthcheck-id":String(e[`healthcheck-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(N,{zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(c,{successLabel:`Loaded`})})};var I={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks`,query:[`page`,`per_page`]};function L(e){return e.usage(`$0 smart-shield health-checks list
19
+
20
+ List configured health checks.`).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 R={command:`list`,describe:`List Health Checks`,builder:L,handler:async e=>o({command:`smart-shield health-checks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let o={page:e.page,per_page:e[`per-page`]};if(e.dryRun){i({command:`cf smart-shield health-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(e),c=await n({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await a(`Loading`,async()=>s.send(I,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})};var z={method:`PUT`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`,body:`json`,constants:{success:!0}};function B(e){return e.usage(`$0 smart-shield health-checks update <healthcheck-id>
21
+
22
+ Update a configured health check.`).positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`errors`,{type:`string`,description:`The errors field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).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-header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. Provide as a JSON object or @path/to/file.json.`}).option(`result-http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`result-http-config-method`,e=>d(e,`result-http-config-method`,`text`)).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`]}).coerce(`result-tcp-config-method`,e=>d(e,`result-tcp-config-method`,`text`)).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 V={command:`update <healthcheck-id>`,describe:`Update Health Check`,builder:B,handler:async e=>o({command:`smart-shield health-checks update`,classification:{safeFlags:[`result-http-config-allow-insecure`,`result-http-config-follow-redirects`,`result-http-config-method`,`result-suspended`,`result-tcp-config-method`,`success`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield health-checks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/healthchecks/${e[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(e[`healthcheck-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"healthcheck-id":String(e[`healthcheck-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({errors:s(e.errors,`errors`),messages:s(e.messages,`messages`),result:{address:d(e[`result-address`],`result-address`,`text`),check_regions:e[`result-check-regions`],consecutive_fails:e[`result-consecutive-fails`],consecutive_successes:e[`result-consecutive-successes`],description:d(e[`result-description`],`result-description`,`text`),http_config:{allow_insecure:e[`result-http-config-allow-insecure`],expected_body:d(e[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:e[`result-http-config-expected-codes`],follow_redirects:e[`result-http-config-follow-redirects`],header:l(e[`result-http-config-header`],`result-http-config-header`),method:e[`result-http-config-method`],path:d(e[`result-http-config-path`],`result-http-config-path`,`text`),port:e[`result-http-config-port`]},interval:e[`result-interval`],name:d(e[`result-name`],`result-name`,`text`),retries:e[`result-retries`],suspended:e[`result-suspended`],tcp_config:{method:e[`result-tcp-config-method`],port:e[`result-tcp-config-port`]},timeout:e[`result-timeout`],type:d(e[`result-type`],`result-type`,`text`)},success:e.success},[[`result`,`http_config`,`header`]]):c(e.body)});return}let o=await t(e),f=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=f,e.body){let t=c(e.body),n=await a(`Updating`,async()=>o.send(z,{body:t,zone_id:f,healthcheck_id:e[`healthcheck-id`]}));r(n,{successLabel:`Updated`});return}if(e.errors===void 0)throw Error(`--errors is required (or pass --body with this field set).`);if(e.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);if(e.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);let p=u({errors:s(e.errors,`errors`),messages:s(e.messages,`messages`),result:{address:d(e[`result-address`],`result-address`,`text`),check_regions:e[`result-check-regions`],consecutive_fails:e[`result-consecutive-fails`],consecutive_successes:e[`result-consecutive-successes`],description:d(e[`result-description`],`result-description`,`text`),http_config:{allow_insecure:e[`result-http-config-allow-insecure`],expected_body:d(e[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:e[`result-http-config-expected-codes`],follow_redirects:e[`result-http-config-follow-redirects`],header:l(e[`result-http-config-header`],`result-http-config-header`),method:e[`result-http-config-method`],path:d(e[`result-http-config-path`],`result-http-config-path`,`text`),port:e[`result-http-config-port`]},interval:e[`result-interval`],name:d(e[`result-name`],`result-name`,`text`),retries:e[`result-retries`],suspended:e[`result-suspended`],tcp_config:{method:e[`result-tcp-config-method`],port:e[`result-tcp-config-port`]},timeout:e[`result-timeout`],type:d(e[`result-type`],`result-type`,`text`)},success:e.success},[[`result`,`http_config`,`header`]]),m=await a(`Updating`,async()=>o.send(z,{body:p,zone_id:f,healthcheck_id:e[`healthcheck-id`]}));r(m,{successLabel:`Updated`})})},H={command:`health-checks`,describe:`Health checks operations`,builder:e=>e.command(E).command(k).command(M).command(F).command(R).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/smart_shield`,body:`json`,errors:{500:`InternalServerError`,502:`BadGatewayError`}};function W(e){return e.usage(`$0 smart-shield update
23
+
24
+ Set Smart Shield Settings.`).option(`cache-reserve-value`,{type:`string`,description:`Specifies the enablement value of Cache Reserve.`,choices:[`on`,`off`]}).coerce(`cache-reserve-value`,e=>d(e,`cache-reserve-value`,`text`)).option(`regional-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Regional Tiered Cache.`,choices:[`on`,`off`]}).coerce(`regional-tiered-cache-value`,e=>d(e,`regional-tiered-cache-value`,`text`)).option(`smart-routing-value`,{type:`string`,description:`Specifies the enablement value of Smart Routing.`,choices:[`on`,`off`]}).coerce(`smart-routing-value`,e=>d(e,`smart-routing-value`,`text`)).option(`smart-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Smart Tiered Cache.`,choices:[`on`,`off`]}).coerce(`smart-tiered-cache-value`,e=>d(e,`smart-tiered-cache-value`,`text`)).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 G={command:`update`,describe:`Patch Smart Shield Settings`,builder:W,handler:async e=>o({command:`smart-shield update`,classification:{safeFlags:[`cache-reserve-value`,`regional-tiered-cache-value`,`smart-routing-value`,`smart-tiered-cache-value`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({cache_reserve:{value:e[`cache-reserve-value`]},regional_tiered_cache:{value:e[`regional-tiered-cache-value`]},smart_routing:{value:e[`smart-routing-value`]},smart_tiered_cache:{value:e[`smart-tiered-cache-value`]}}):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Updating`,async()=>o.send(U,{body:t,zone_id:s}));r(n,{successLabel:`Updated`});return}let l=u({cache_reserve:{value:e[`cache-reserve-value`]},regional_tiered_cache:{value:e[`regional-tiered-cache-value`]},smart_routing:{value:e[`smart-routing-value`]},smart_tiered_cache:{value:e[`smart-tiered-cache-value`]}}),d=await a(`Updating`,async()=>o.send(U,{body:l,zone_id:s}));r(d,{successLabel:`Updated`})})},K={command:`smart-shield`,describe:`Smart Shield settings, health checks, and cache reserve management`,builder:e=>e.command(C).command(G).command(b).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-MNz2D-PD.mjs";import{i as r}from"./context-q-6bMSL-.mjs";import{t as i}from"./output-Co4xdFf6.mjs";import{t as a}from"./dry-run-C2KjGX10.mjs";import{t as o}from"./progress-DaQ4MzBI.mjs";import{t as s}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d,t as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-KWYZvJWM.mjs";import{n as m,t as h}from"./raw-fetch-Cy09TjHc.mjs";function g(e){return e.usage(`$0 snippets content get <snippet-name>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-Db1KT0vm.mjs";import{i as r}from"./context-C_a8oSY9.mjs";import{t as i}from"./output-Co4xdFf6.mjs";import{t as a}from"./dry-run-C2KjGX10.mjs";import{t as o}from"./progress-Q5w9PNTT.mjs";import{t as s}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as c,n as l,t as u}from"./body-parser-DnBfDdx3.mjs";import{n as d,t as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-C0hKSr-R.mjs";import{n as m,t as h}from"./raw-fetch-CEOuoKl9.mjs";function g(e){return e.usage(`$0 snippets content get <snippet-name>
3
3
 
4
4
  Fetches the content of a snippet belonging to the zone.`).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 _={command:`get <snippet-name>`,describe:`Get a zone snippet content`,builder:g,handler:async e=>s({command:`snippets content get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/${e[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(e[`snippet-name`]))}/content`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"snippet-name":String(e[`snippet-name`]??``)},bodyKind:`none`});return}let t=await n(e);e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet});let i=await o(`Loading`,async()=>h(`/zones/${e.zoneId}/snippets/${encodeURIComponent(String(e[`snippet-name`]))}/content`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));m(e.text===!0?i.toString(`utf-8`):i)})},v={command:`content`,describe:`Operations for content`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/snippets/${t.snippet_name}`};function b(e){return e.usage(`$0 snippets delete <snippet-name>
5
5
 
@@ -15,6 +15,6 @@ Deletes all snippet rules belonging to the zone.`).option(`dry-run`,{type:`boole
15
15
 
16
16
  Fetches all snippet rules belonging to the zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List zone snippet rules`,builder:M,handler:async e=>s({command:`snippets rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(j,{zone_id:s}));i(c,{successLabel:`Loaded`})})};var P={method:`PUT`,path:t=>e`/zones/${t.zone_id}/snippets/snippet_rules`,body:`json`};function F(e){return e.usage(`$0 snippets rules update
17
17
 
18
- Updates all snippet rules belonging to the zone.`).option(`rules`,{type:`string`,description:`Lists snippet rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet rules object.`})}const I={command:`update`,describe:`Update zone snippet rules`,builder:F,handler:async e=>s({command:`snippets rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({rules:l(e.rules,`rules`)}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send(P,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let d=u({rules:l(e.rules,`rules`)}),f=await o(`Updating`,async()=>t.send(P,{body:d,zone_id:s}));i(f,{successLabel:`Updated`})})},L={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(A).command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.usage(`$0 snippets update <snippet-name>
18
+ Updates all snippet rules belonging to the zone.`).option(`rules`,{type:`string`,description:`Lists snippet rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet rules object.`})}const I={command:`update`,describe:`Update zone snippet rules`,builder:F,handler:async e=>s({command:`snippets rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({rules:c(e.rules,`rules`)}):l(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=l(e.body),r=await o(`Updating`,async()=>t.send(P,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let d=u({rules:c(e.rules,`rules`)}),f=await o(`Updating`,async()=>t.send(P,{body:d,zone_id:s}));i(f,{successLabel:`Updated`})})},L={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(A).command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.usage(`$0 snippets update <snippet-name>
19
19
 
20
20
  Creates or updates a snippet belonging to the zone.`).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 z={command:`update <snippet-name>`,describe:`Update a zone snippet`,builder:R,handler:async e=>s({command:`snippets update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/${e[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(e[`snippet-name`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"snippet-name":String(e[`snippet-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,metadata:e.metadata}});return}let s=await n(e);if(e.zoneId=await r({zone:e.zone},s,{quiet:e.quiet}),e.file!==void 0||e.body!==void 0||e.metadata!==void 0){let n=new FormData;if(e.file){let t=f(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.metadata!==void 0){let t=typeof e.metadata==`string`?d(e.metadata,`metadata`,`text`):e.metadata;n.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}let r=await o(`Updating`,async()=>t(s,`PUT`,`/zones/${e.zoneId}/snippets/${encodeURIComponent(String(e[`snippet-name`]))}`,{body:n}));i(r,{successLabel:`Updated`});return}if(e.body){let n=d(e.body,`body`,`binary`),r=await o(`Updating`,async()=>t(s,`PUT`,`/zones/${e.zoneId}/snippets/${encodeURIComponent(String(e[`snippet-name`]))}`,{body:n,headers:{"Content-Type":`multipart/form-data`}}));i(r,{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.`)})},B={command:`snippets`,describe:`snippets`,builder:e=>e.command(x).command(w).command(D).command(z).command(v).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-MNz2D-PD.mjs";import{i as n}from"./context-q-6bMSL-.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-DaQ4MzBI.mjs";import{t as o}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,n as d}from"./prompt-KWYZvJWM.mjs";var f={method:`GET`,path:t=>e`/zones/${t.zone_id}/spectrum/analytics/aggregate/current`,query:[`appID`,`colo_name`]};function p(e){return e.usage(`$0 spectrum analytics aggregates currents get
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-Db1KT0vm.mjs";import{i as n}from"./context-C_a8oSY9.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-Q5w9PNTT.mjs";import{t as o}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as s,t as c}from"./body-parser-DnBfDdx3.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,n as d}from"./prompt-C0hKSr-R.mjs";var f={method:`GET`,path:t=>e`/zones/${t.zone_id}/spectrum/analytics/aggregate/current`,query:[`appID`,`colo_name`]};function p(e){return e.usage(`$0 spectrum analytics aggregates currents get
3
3
 
4
4
  Retrieves analytics aggregated from the last minute of usage on Spectrum applications underneath a given zone.`).option(`app-id`,{type:`string`,description:`Comma-delimited list of Spectrum Application Id(s). If provided, the response will be limited to Spectrum Application Id(s) that match.`}).option(`colo-name`,{type:`string`,description:`Co-location identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Get current aggregated analytics`,builder:p,handler:async e=>o({command:`spectrum analytics aggregates currents get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let o={appID:e[`app-id`],colo_name:e[`colo-name`]};if(e.dryRun){i({command:`cf spectrum analytics aggregates currents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/spectrum/analytics/aggregate/current`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(e),c=await n({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await a(`Loading`,async()=>s.send(f,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})},h={command:`currents`,describe:`Operations for analytics.aggregates.currents`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`aggregates`,describe:`Operations for analytics.aggregates`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _={method:`GET`,path:t=>e`/zones/${t.zone_id}/spectrum/analytics/events/bytime`,query:[`dimensions`,`sort`,`until`,`metrics`,`filters`,`since`,`time_delta`]};function v(e){return e.usage(`$0 spectrum analytics events bytimes get
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-MNz2D-PD.mjs";import{i as n}from"./context-q-6bMSL-.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-DaQ4MzBI.mjs";import{t as o}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c}from"./prompt-KWYZvJWM.mjs";var l={method:`GET`,path:t=>e`/zones/${t.zone_id}/speed_api/availabilities`};function u(e){return e.usage(`$0 speed availabilities list
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-Db1KT0vm.mjs";import{i as n}from"./context-C_a8oSY9.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-Q5w9PNTT.mjs";import{t as o}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as s}from"./body-parser-DnBfDdx3.mjs";import{n as c}from"./prompt-C0hKSr-R.mjs";var l={method:`GET`,path:t=>e`/zones/${t.zone_id}/speed_api/availabilities`};function u(e){return e.usage(`$0 speed availabilities list
3
3
 
4
4
  Retrieves quota for all plans, as well as the current zone quota.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Get quota and availability`,builder:u,handler:async e=>o({command:`speed availabilities list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf speed availabilities list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/speed_api/availabilities`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(l,{zone_id:s}));r(c,{successLabel:`Loaded`})})},f={command:`availabilities`,describe:`Check which speed test regions and configurations are available for your zone`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var p={method:`GET`,path:t=>e`/zones/${t.zone_id}/speed_api/pages`};function m(e){return e.usage(`$0 speed pages list
5
5
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,n as t}from"./auth-MNz2D-PD.mjs";import{t as n}from"./output-Co4xdFf6.mjs";import{t as r}from"./dry-run-C2KjGX10.mjs";import{t as i}from"./progress-DaQ4MzBI.mjs";import{t as a}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{i as o,n as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l,t as u}from"./input-validation-D7z60HJH.mjs";var d={method:`GET`,path:()=>`/analytics/sql/introspection`,query:[`account_tag`,`include_columns`,`include_custom_attributes`,`include_attributes`,`include_wae`,`include_lex`,`dataset_name`],errors:{400:`BadRequestError`,403:`ForbiddenError`,422:`UnprocessableEntityError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function f(e){return e.usage("$0 sql datasets\n\nReturns the analytics dataset catalogue. By default, the response contains dataset names, titles, categories, descriptions, kinds, and hidden flags. Set `include_columns` to include each dataset's column names, descriptions, data types, and hidden flags. The caller must have Account Analytics Read permission on the account identified by `account_tag`. Dataset names, descriptions, and columns are the same for every authorized account. When `include_custom_attributes` or `include_attributes` is set, the response also includes attribute names and types discovered from that account's own data, which legitimately differs per caller. `attributes` is a replacement for `custom_attributes` that will eventually be removed; until then, set either flag independently to receive the corresponding field. `hidden` marks catalogue entries a client should de-emphasise. It has no effect on access: hidden datasets and columns are returned here and remain fully queryable. The catalogue lists the datasets this deployment is able to describe, which is not a fixed list. Some datasets are described by the service that owns them and are listed only where that service is available, so the same account may see a different catalogue in different environments, and datasets may appear or disappear without a change to this API. Clients should query the catalogue rather than hard-coding it, and should not treat a dataset's absence as proof that it does not exist. Workers Analytics Engine datasets are named by the account that writes them, so they are discovered from that account's own data rather than from a fixed list. They appear as `events.analyticsEngine.<dataset_name>` and differ per account. A dataset is listed for as long as any of its data is retained, so it does not disappear from the catalogue merely because writes have stopped. An account with a very large number of datasets may receive a truncated list. Set `include_wae=false` to omit them. Log Explorer datasets are listed only where the account has them, so they differ per account and are not part of the static catalogue. Set `include_lex=false` to omit them.").option(`account-tag`,{type:`string`,description:`Account whose available analytics datasets are returned.`,demandOption:!0}).option(`include-columns`,{type:`boolean`,description:`Include column metadata for each returned dataset.`}).option(`include-custom-attributes`,{type:`boolean`,description:"Include a capped set of custom attribute names and types observed during the preceding seven days, as `custom_attributes`. Requires a nonempty dataset_name. Deprecated in favor of `include_attributes`."}).option(`include-attributes`,{type:`boolean`,description:"Include a capped set of attribute names and types observed during the preceding seven days, as `attributes`. Requires a nonempty dataset_name. Replaces `include_custom_attributes`, which is deprecated."}).option(`include-wae`,{type:`boolean`,description:"Include Workers Analytics Engine datasets, which are discovered from the account's own data. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`include-lex`,{type:`boolean`,description:"Include Log Explorer datasets, which are listed only where the account has them. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`dataset-name`,{type:`string`,description:"Return only the dataset with this exact name. An empty value is treated as if the parameter had been omitted, and does not filter the catalogue. A name that matches no dataset in this deployment's catalogue is rejected with `422`; a dataset that exists but is not describable here is rejected identically, so the two cases cannot be told apart.\n\nA Workers Analytics Engine dataset is named in full, as `events.analyticsEngine.<dataset_name>`; the namespace on its own returns every such dataset the account has. A `dataset_name` the account does not have is rejected with `422` like any other unknown name."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`datasets`,describe:`List available analytics datasets`,builder:f,handler:async e=>a({command:`sql datasets`,classification:{safeFlags:[`include-columns`,`include-custom-attributes`,`include-attributes`,`include-wae`,`include-lex`,`dry-run`]}},e,async()=>{let a={account_tag:e[`account-tag`],include_columns:e[`include-columns`],include_custom_attributes:e[`include-custom-attributes`],include_attributes:e[`include-attributes`],include_wae:e[`include-wae`],include_lex:e[`include-lex`],dataset_name:e[`dataset-name`]};if(e.dryRun){r({command:`cf sql datasets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql/introspection`,pathParams:{},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(d,a));n(s,{successLabel:`Loaded`})})};function m(e){return e.usage("$0 sql query <query>\n\nExecutes a SQL query against the analytics datasets available to the caller. Send either raw SQL or a JSON object containing the query and optional positional or named parameters, time range, and account or zone scope. Raw SQL placeholders can also be bound with query parameters named `param_<name>`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").positional(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset. `,demandOption:!0}).option(`scope-account`,{type:`string`,description:`Account tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
2
+ import{i as e,n as t}from"./auth-Db1KT0vm.mjs";import{t as n}from"./output-Co4xdFf6.mjs";import{t as r}from"./dry-run-C2KjGX10.mjs";import{t as i}from"./progress-Q5w9PNTT.mjs";import{t as a}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{a as o,n as s,t as c}from"./body-parser-DnBfDdx3.mjs";import{n as l,t as u}from"./input-validation-D7z60HJH.mjs";var d={method:`GET`,path:()=>`/analytics/sql/introspection`,query:[`account_tag`,`include_columns`,`include_custom_attributes`,`include_attributes`,`include_wae`,`include_lex`,`dataset_name`],errors:{400:`BadRequestError`,403:`ForbiddenError`,422:`UnprocessableEntityError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function f(e){return e.usage("$0 sql datasets\n\nReturns the analytics dataset catalogue. By default, the response contains dataset names, titles, categories, descriptions, kinds, and hidden flags. Set `include_columns` to include each dataset's column names, descriptions, data types, and hidden flags. The caller must have Account Analytics Read permission on the account identified by `account_tag`. Dataset names, descriptions, and columns are the same for every authorized account. When `include_custom_attributes` or `include_attributes` is set, the response also includes attribute names and types discovered from that account's own data, which legitimately differs per caller. `attributes` is a replacement for `custom_attributes` that will eventually be removed; until then, set either flag independently to receive the corresponding field. `hidden` marks catalogue entries a client should de-emphasise. It has no effect on access: hidden datasets and columns are returned here and remain fully queryable. The catalogue lists the datasets this deployment is able to describe, which is not a fixed list. Some datasets are described by the service that owns them and are listed only where that service is available, so the same account may see a different catalogue in different environments, and datasets may appear or disappear without a change to this API. Clients should query the catalogue rather than hard-coding it, and should not treat a dataset's absence as proof that it does not exist. Workers Analytics Engine datasets are named by the account that writes them, so they are discovered from that account's own data rather than from a fixed list. They appear as `events.analyticsEngine.<dataset_name>` and differ per account. A dataset is listed for as long as any of its data is retained, so it does not disappear from the catalogue merely because writes have stopped. An account with a very large number of datasets may receive a truncated list. Set `include_wae=false` to omit them. Log Explorer datasets are listed only where the account has them, so they differ per account and are not part of the static catalogue. Set `include_lex=false` to omit them.").option(`account-tag`,{type:`string`,description:`Account whose available analytics datasets are returned.`,demandOption:!0}).option(`include-columns`,{type:`boolean`,description:`Include column metadata for each returned dataset.`}).option(`include-custom-attributes`,{type:`boolean`,description:"Include a capped set of custom attribute names and types observed during the preceding seven days, as `custom_attributes`. Requires a nonempty dataset_name. Deprecated in favor of `include_attributes`."}).option(`include-attributes`,{type:`boolean`,description:"Include a capped set of attribute names and types observed during the preceding seven days, as `attributes`. Requires a nonempty dataset_name. Replaces `include_custom_attributes`, which is deprecated."}).option(`include-wae`,{type:`boolean`,description:"Include Workers Analytics Engine datasets, which are discovered from the account's own data. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`include-lex`,{type:`boolean`,description:"Include Log Explorer datasets, which are listed only where the account has them. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`dataset-name`,{type:`string`,description:"Return only the dataset with this exact name. An empty value is treated as if the parameter had been omitted, and does not filter the catalogue. A name that matches no dataset in this deployment's catalogue is rejected with `422`; a dataset that exists but is not describable here is rejected identically, so the two cases cannot be told apart.\n\nA Workers Analytics Engine dataset is named in full, as `events.analyticsEngine.<dataset_name>`; the namespace on its own returns every such dataset the account has. A `dataset_name` the account does not have is rejected with `422` like any other unknown name."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`datasets`,describe:`List available analytics datasets`,builder:f,handler:async e=>a({command:`sql datasets`,classification:{safeFlags:[`include-columns`,`include-custom-attributes`,`include-attributes`,`include-wae`,`include-lex`,`dry-run`]}},e,async()=>{let a={account_tag:e[`account-tag`],include_columns:e[`include-columns`],include_custom_attributes:e[`include-custom-attributes`],include_attributes:e[`include-attributes`],include_wae:e[`include-wae`],include_lex:e[`include-lex`],dataset_name:e[`dataset-name`]};if(e.dryRun){r({command:`cf sql datasets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql/introspection`,pathParams:{},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(d,a));n(s,{successLabel:`Loaded`})})};function m(e){return e.usage("$0 sql query <query>\n\nExecutes a SQL query against the analytics datasets available to the caller. Send either raw SQL or a JSON object containing the query and optional positional or named parameters, time range, and account or zone scope. Raw SQL placeholders can also be bound with query parameters named `param_<name>`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").positional(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset. `,demandOption:!0}).option(`scope-account`,{type:`string`,description:`Account tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
3
3
  `}).option(`scope-zone`,{type:`string`,description:`Zone tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
4
4
  `}).option(`time-until`,{type:`string`,description:`Inclusive upper bound for the dataset's timestamp column.`}).option(`time-since`,{type:`string`,description:`Inclusive lower bound for the dataset's timestamp column.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).conflicts(`scope-account`,[`scope-zone`]).conflicts(`scope-zone`,[`scope-account`]).check(e=>{if([`time-until`,`time-since`].some(t=>e[t]!==void 0)){let t=[`time-since`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --time_range-* flag is set`)}return!0})}const h={command:`query <query>`,describe:`Query analytics datasets`,builder:m,handler:async d=>a({command:`sql query`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){r({command:`cf sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},bodyKind:d.file===void 0?`json`:`octet-stream`,body:d.file===void 0?d.body===void 0?c({scope:{accountTag:l(d[`scope-account`],`scope-account`,`text`),zoneTag:l(d[`scope-zone`],`scope-zone`,`text`)},time_range:{end:l(d[`time-until`],`time-until`,`text`),start:l(d[`time-since`],`time-since`,`text`)},query:d.query}):s(d.body):{file:d.file}});return}let a=await t(d);if(d.file){let t=u(d.file),r=await i(`Loading`,async()=>e(a,`POST`,`/analytics/sql`,{body:t,headers:{"Content-Type":`text/plain`}}));n(r,{successLabel:`Loaded`});return}if(d.body){let t=s(d.body),r=await i(`Loading`,async()=>e(a,`POST`,`/analytics/sql`,{body:t}));n(r,{successLabel:`Loaded`});return}let f={};d[`scope-account`]!==void 0&&o(f,[`scope`,`accountTag`],l(d[`scope-account`],`scope-account`,`text`)),d[`scope-zone`]!==void 0&&o(f,[`scope`,`zoneTag`],l(d[`scope-zone`],`scope-zone`,`text`)),d[`time-until`]!==void 0&&o(f,[`time_range`,`end`],l(d[`time-until`],`time-until`,`text`)),d[`time-since`]!==void 0&&o(f,[`time_range`,`start`],l(d[`time-since`],`time-since`,`text`)),d.query!==void 0&&(f.query=d.query);let p=await i(`Loading`,async()=>e(a,`POST`,`/analytics/sql`,{body:f}));n(p,{successLabel:`Loaded`})})},g={command:`sql`,describe:`sql`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};