cf 1.0.0-beta.16 → 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 (239) hide show
  1. package/dist/_meta/commands.json +6117 -4540
  2. package/dist/_meta/schemas.json +5016 -3257
  3. package/dist/{abuse-reports-17K-TRhO.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
  4. package/dist/{access-BwB7sg1D.mjs → access-BtsMwesh.mjs} +1 -1
  5. package/dist/{accounts-BnIGu_ac.mjs → accounts-X5QVzEUW.mjs} +27 -21
  6. package/dist/{acm-CQRcu_zw.mjs → acm-C_NepMi6.mjs} +1 -1
  7. package/dist/{addressing-Qcm9jd3C.mjs → addressing-BkQY1hoA.mjs} +18 -18
  8. package/dist/{agent-memory-B3xN9I6-.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
  9. package/dist/{ai-BRKOCckA.mjs → ai-Bb0_Zknm.mjs} +1 -1
  10. package/dist/{ai-audit-Cd9Rc2Fc.mjs → ai-audit-DuEjVdML.mjs} +1 -1
  11. package/dist/{ai-gateway-BWU5064V.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
  12. package/dist/ai-search-DDRpxyOM.mjs +79 -0
  13. package/dist/{ai-security-Dn0Ee6QS.mjs → ai-security-A2STvE1b.mjs} +5 -5
  14. package/dist/{alerting-BXTiMfXo.mjs → alerting-CIwSk-Ks.mjs} +1 -1
  15. package/dist/{analytics-Jyd04TRW.mjs → analytics-H--uM3DA.mjs} +7 -7
  16. package/dist/{analytics-engine-CzrNfUeh.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
  17. package/dist/{api-security-DRBHZaf_.mjs → api-security-D-pcnhUL.mjs} +26 -26
  18. package/dist/{argo-DiQt0pSb.mjs → argo-Lvmcx3am.mjs} +1 -1
  19. package/dist/{artifacts-eBZ4YN53.mjs → artifacts-xT5S-mVa.mjs} +1 -1
  20. package/dist/{audit-logs-Bb4HTZay.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
  21. package/dist/{auth-C6My1gI6.mjs → auth-B73lQS2h.mjs} +1 -1
  22. package/dist/auth-DMzEmOhG.mjs +2 -0
  23. package/dist/{auth-eVI_UEt8.mjs → auth-Db1KT0vm.mjs} +1 -1
  24. package/dist/{auth-token-Cfj2yehs.mjs → auth-token-D9XIPlwf.mjs} +1 -1
  25. package/dist/{autoconfig-B0ESZ8DJ.mjs → autoconfig-9po_tqsS.mjs} +1 -1
  26. package/dist/{basin-catalog-Cwk1RSMX.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
  27. package/dist/{billing-CfV8oi6A.mjs → billing-Bm2JNSGa.mjs} +6 -6
  28. package/dist/body-parser-DnBfDdx3.mjs +2 -0
  29. package/dist/{bot-management-CH4_Kewx.mjs → bot-management-CSr38g-O.mjs} +4 -4
  30. package/dist/{botnet-feed-Cg_Wp8ei.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
  31. package/dist/{brand-protection-Cp2ckWou.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
  32. package/dist/browser-run-BcWxzhAn.mjs +42 -0
  33. package/dist/build-BRJnyeu8.mjs +2 -0
  34. package/dist/{build-sBpqm9ga.mjs → build-i8l2qGVZ.mjs} +1 -1
  35. package/dist/{builds-B2RBgVL9.mjs → builds-BMwDzi7G.mjs} +39 -39
  36. package/dist/{cache-yvrYPvRI.mjs → cache-_VaTLC5T.mjs} +1 -1
  37. package/dist/chunk-JP6R7L72-C0kFUelb.mjs +2 -0
  38. package/dist/cli-P3q5DG3W.mjs +6 -0
  39. package/dist/{client-side-security-D50iZjd_.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
  40. package/dist/{cloud-connector-wvSGdxWT.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
  41. package/dist/{cloudforce-one-j6vlmaMB.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
  42. package/dist/{command-CM_f48gs.mjs → command-BXiA79DP.mjs} +1 -1
  43. package/dist/{command-CmUtmu5j.mjs → command-BbsPxJBT.mjs} +1 -1
  44. package/dist/{command-BDpm-U8z.mjs → command-Bkc04OyY.mjs} +1 -1
  45. package/dist/{command-BSbhJRmu.mjs → command-BtTc28ql.mjs} +1 -1
  46. package/dist/{command-DFRsim8q.mjs → command-CBZhxmKD.mjs} +1 -1
  47. package/dist/{command-BbO3sBQ2.mjs → command-CL7LLXM7.mjs} +1 -1
  48. package/dist/{command-DQojhTEQ.mjs → command-CYyfigfC.mjs} +1 -1
  49. package/dist/{command-DiqRELHF.mjs → command-CxWLFv5Y.mjs} +1 -1
  50. package/dist/{command-74P4_CTx.mjs → command-DDcBC4px.mjs} +1 -1
  51. package/dist/{command-Dr4PEvB2.mjs → command-NoxvOARP.mjs} +1 -1
  52. package/dist/{completions-oD1EcuHk.mjs → completions-CrDmwKnK.mjs} +1 -1
  53. package/dist/{connector-interrupts-DP4rbOe8.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
  54. package/dist/{connector-telemetry-events-BQGBQwzR.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
  55. package/dist/{connector-telemetry-snapshots-DBO0Mdcj.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
  56. package/dist/{connectors-BSVr3Kz1.mjs → connectors-DvVlxGDx.mjs} +1 -1
  57. package/dist/{containers-BTqAeVV2.mjs → containers-Bt2zFsFd.mjs} +8 -8
  58. package/dist/{containers-BOpKpipz.mjs → containers-BtcOgwm5.mjs} +2 -2
  59. package/dist/{content-scan-B9Keyxe-.mjs → content-scan-DldLmTjy.mjs} +1 -1
  60. package/dist/{context-B-vEsyrK.mjs → context-C_a8oSY9.mjs} +1 -1
  61. package/dist/cps-REo1OWP1.mjs +6 -0
  62. package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
  63. package/dist/{custom-csrs-DM5X-K6H.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
  64. package/dist/{custom-hostnames-BBjqaiFF.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
  65. package/dist/{custom-nameservers-C0NDMLPJ.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
  66. package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
  67. package/dist/{d1-hin5PmxW.mjs → d1-DvCiQibO.mjs} +8 -8
  68. package/dist/{deploy-Bo7FtE44.mjs → deploy-K664XPOb.mjs} +1 -1
  69. package/dist/{deploy-context-ClvBD87y.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
  70. package/dist/{deploy-input-BqJ7GVZ-.mjs → deploy-input-KK6yyBN_.mjs} +1 -1
  71. package/dist/{dev-EtnMYA7K.mjs → dev-CnoMHxf4.mjs} +1 -1
  72. package/dist/{diagnostics-LZuMrGjK.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
  73. package/dist/{dls-Bq8k3iy-.mjs → dls-DoqfqutH.mjs} +1 -1
  74. package/dist/{dns-ry5E2Bsa.mjs → dns-DC6WcO3m.mjs} +21 -21
  75. package/dist/{dns-firewall-zavP5Qxj.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
  76. package/dist/{docs-B08YtL0U.mjs → docs-CqNRBHab.mjs} +1 -1
  77. package/dist/{durable-objects-B9fo41B1.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
  78. package/dist/{email-auth-D9LGjFlh.mjs → email-auth--NHg1TjG.mjs} +1 -1
  79. package/dist/{email-routing-6iDnNPhY.mjs → email-routing-COjENK55.mjs} +13 -13
  80. package/dist/{email-security-ty4ufRnJ.mjs → email-security-rdjH95T2.mjs} +38 -38
  81. package/dist/{email-sending-d7LO_Cz_.mjs → email-sending-26VJhR6Q.mjs} +18 -18
  82. package/dist/{field-extractors-DkgQ7PSw.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
  83. package/dist/{firewall-Q88YyEwD.mjs → firewall-D8K93ffF.mjs} +20 -20
  84. package/dist/{flagship-CzI8zhd6.mjs → flagship-CHdmCmvQ.mjs} +11 -11
  85. package/dist/{fraud-CvFXTR0w.mjs → fraud-CY4TV5Vc.mjs} +1 -1
  86. package/dist/{google-tag-gateway-Y2zbyey8.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
  87. package/dist/healthchecks-B52Mf3uL.mjs +22 -0
  88. package/dist/{hostnames-B3k7fIUL.mjs → hostnames-BMITIM8P.mjs} +1 -1
  89. package/dist/{hyperdrive-BWGYz95H.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
  90. package/dist/{iam-AXco_qmt.mjs → iam-o1n9eUXf.mjs} +9 -9
  91. package/dist/{images-BzYh8y0u.mjs → images-CJHAGxX6.mjs} +37 -37
  92. package/dist/index.mjs +1 -1
  93. package/dist/{init-DlenHBtS.mjs → init-CqQDL6i3.mjs} +1 -1
  94. package/dist/{intel-BBi3i_GU.mjs → intel-B3S1gxUg.mjs} +1 -1
  95. package/dist/{ips-CWG2b7AM.mjs → ips-q_UJMiy8.mjs} +1 -1
  96. package/dist/{k2-DXdMe3Cb.mjs → k2-BNqVZnDN.mjs} +2 -2
  97. package/dist/{kv-FUd7UdDu.mjs → kv-B0nXSOcW.mjs} +1 -1
  98. package/dist/{lazy-command-BC8rIlHu.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
  99. package/dist/{leaked-credential-checks-BufVA9vL.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
  100. package/dist/load-balancers-DJtMztJ0.mjs +76 -0
  101. package/dist/{login-DVbXZ_Tv.mjs → login-D-1FiBNv.mjs} +1 -1
  102. package/dist/{login-BJr2PBaJ.mjs → login-chQP8825.mjs} +1 -1
  103. package/dist/{logo-matches-BluaPvMa.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
  104. package/dist/{logos-CXtmYWEJ.mjs → logos-tnIahhcu.mjs} +1 -1
  105. package/dist/{logpush-DCYgrqz0.mjs → logpush-D4s3pJRw.mjs} +24 -24
  106. package/dist/{logs-as60IP29.mjs → logs-cw7UL5V2.mjs} +3 -3
  107. package/dist/{magic-cloud-networking-0RsHugUF.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
  108. package/dist/{magic-network-monitoring-CPqvZdcb.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
  109. package/dist/{magic-transit-ClPyGzOE.mjs → magic-transit-BFopRdPs.mjs} +170 -170
  110. package/dist/{managed-defense-P4_QWSbK.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
  111. package/dist/{managed-transforms-CUwQXMij.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
  112. package/dist/{matches-BjckDBW1.mjs → matches-ClJ_24EY.mjs} +1 -1
  113. package/dist/{mcp-C2EG2c7L.mjs → mcp-50os3IRG.mjs} +10 -10
  114. package/dist/{mesh-CpMZA7Xt.mjs → mesh-jxtQP8sS.mjs} +2 -2
  115. package/dist/{migrate-6e5mJ79R.mjs → migrate-DerOyuv2.mjs} +1 -1
  116. package/dist/{monetization-DypuCZmU.mjs → monetization-D6cCDi-h.mjs} +4 -4
  117. package/dist/{network-DQ5Ridgy.mjs → network-dnWHB2uY.mjs} +27 -25
  118. package/dist/{network-interconnects-ifU4JhGE.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
  119. package/dist/{o11y-CzssfRHt.mjs → o11y-oMSg1pG4.mjs} +49 -49
  120. package/dist/{oauth-BNTiErBG.mjs → oauth-BfBdHhPS.mjs} +1 -1
  121. package/dist/{oauth-BDdhqasa.mjs → oauth-DDOiiH7h.mjs} +1 -1
  122. package/dist/{oauth-clients-gknNcBdV.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
  123. package/dist/{oauth-scopes-BJeSanuF.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
  124. package/dist/open-PCXX3ZDZ-5J5IU2MX-CKla-jDt.mjs +4 -0
  125. package/dist/organization-94lHeeOs.mjs +75 -0
  126. package/dist/{organizations-kfFFW4uO.mjs → organizations-BJf3UTFi.mjs} +1 -1
  127. package/dist/{origin-post-quantum-encryption-DfrnptJ1.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
  128. package/dist/{page-rules-ByrDMDBZ.mjs → page-rules-BUI-50oz.mjs} +4 -4
  129. package/dist/pages-CcdpCzHs.mjs +54 -0
  130. package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
  131. package/dist/{pay-per-use-49EXt75f.mjs → pay-per-use-t066I5wm.mjs} +7 -7
  132. package/dist/{pipelines-Bvgh1BQZ.mjs → pipelines-Co6S044l.mjs} +8 -8
  133. package/dist/precursor-BftyvS86.mjs +4 -0
  134. package/dist/previews-BLhnhElx.mjs +7 -0
  135. package/dist/{progress-R-1tIuep.mjs → progress-Q5w9PNTT.mjs} +1 -1
  136. package/dist/{prompt-dgLm0iFJ.mjs → prompt-C0hKSr-R.mjs} +1 -1
  137. package/dist/{queries-EbIadtC5.mjs → queries-4MubO6Sz.mjs} +3 -3
  138. package/dist/{queues-C4GZ-O3f.mjs → queues-CteS5M92.mjs} +17 -17
  139. package/dist/{r2-DEuFfWBR.mjs → r2-2QpT_Gso.mjs} +24 -24
  140. package/dist/{radar-CDOERVcR.mjs → radar-ODKaK4FJ.mjs} +1 -1
  141. package/dist/{raw-fetch-BapeoreV.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
  142. package/dist/{realtime-D_A9Qgly.mjs → realtime-DkfU8uEX.mjs} +84 -84
  143. package/dist/registrar-DM6JTVPS.mjs +43 -0
  144. package/dist/{registrar-sandbox-BF3cYO3n.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
  145. package/dist/{reporting-BWm9jIF8.mjs → reporting-5yFNXbJg.mjs} +1 -1
  146. package/dist/{request-headers-BRxv6NkA.mjs → request-headers-DXvswze2.mjs} +1 -1
  147. package/dist/request-tracers-BarLZY95.mjs +4 -0
  148. package/dist/{resource-sharing-C186jZv0.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
  149. package/dist/{rules-DYnGIU_0.mjs → rules-_C31X4Jz.mjs} +6 -6
  150. package/dist/{rulesets-BcNrbVcq.mjs → rulesets-8RwxoFhG.mjs} +6 -6
  151. package/dist/{rum-BDyRecfp.mjs → rum-CAUcpXpM.mjs} +6 -6
  152. package/dist/{run-BvDCuZ8q.mjs → run-DtFLvOHB.mjs} +1 -1
  153. package/dist/run-LcOb9rhI.mjs +2 -0
  154. package/dist/{schema-flags-DcKjAxI1.mjs → schema-flags-DibfxEF6.mjs} +1 -1
  155. package/dist/{scim-zn-CNCsc.mjs → scim-DX5XrQ4w.mjs} +1 -1
  156. package/dist/{secrets-store-CFhyQUV6.mjs → secrets-store-DSqqrr25.mjs} +1 -1
  157. package/dist/{security-insights-D8XgtCed.mjs → security-insights-FSktO04S.mjs} +1 -1
  158. package/dist/{security-txt-CCM-Vro0.mjs → security-txt-D2g3lQdg.mjs} +1 -1
  159. package/dist/{shared-ouAF7o4S.mjs → shared-eefMO8R4.mjs} +1 -1
  160. package/dist/smart-shield-IVb2sR0C.mjs +24 -0
  161. package/dist/{snippets-B2jBY0m_.mjs → snippets-cWwWficN.mjs} +2 -2
  162. package/dist/{spawn-DQttFH05.mjs → spawn-BW2bJmKO.mjs} +1 -1
  163. package/dist/{spectrum-Cf_4cGE8.mjs → spectrum-DYiIBYRB.mjs} +1 -1
  164. package/dist/{speed-DoXdyIYK.mjs → speed-C7uiW2Wf.mjs} +1 -1
  165. package/dist/{sql-Bze4h80q.mjs → sql-TGV8qQMj.mjs} +1 -1
  166. package/dist/{src-BguQDHjS.mjs → src-BUH-P_zd.mjs} +5 -5
  167. package/dist/ssl-xQP_HbWN.mjs +139 -0
  168. package/dist/{stream-BcReYIHJ.mjs → stream-CfWgj8Cr.mjs} +55 -55
  169. package/dist/{submit-ldFVNfNC.mjs → submit-DxGr1T40.mjs} +1 -1
  170. package/dist/tags-LEJ2VYhQ.mjs +23 -0
  171. package/dist/{telemetry-Cojgz4Sv.mjs → telemetry-BHne10Yy.mjs} +1 -1
  172. package/dist/telemetry-BavSU4ku.mjs +2 -0
  173. package/dist/{tenant-AZ0EAsmT.mjs → tenant-7d5vwc6K.mjs} +1 -1
  174. package/dist/{tenant-custom-nameservers-aozjaasc.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
  175. package/dist/{tunnels-CXez5LPB.mjs → tunnels-DlGODvwT.mjs} +4 -4
  176. package/dist/{turnstile-B2NQ8Nsk.mjs → turnstile-DhLkdhij.mjs} +5 -5
  177. package/dist/update-check-nLfkSfdz.mjs +2 -0
  178. package/dist/update-check-worker.mjs +1 -1
  179. package/dist/{update-check-BlyKN8m0.mjs → update-check-wvjOsnGK.mjs} +1 -1
  180. package/dist/{url-info-D_UqGiWD.mjs → url-info-CeoV5dBc.mjs} +1 -1
  181. package/dist/{url-normalization-CF1YHpIN.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
  182. package/dist/{url-scanner-ChF3GO2U.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
  183. package/dist/{user-BfWRsdJh.mjs → user-D33B3alX.mjs} +59 -59
  184. package/dist/{vectorize-CRYbWKg5.mjs → vectorize-Wp9De13y.mjs} +17 -17
  185. package/dist/version-B2RUUqGT.mjs +2 -0
  186. package/dist/{waiting-rooms-Crp7MVd9.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
  187. package/dist/{web-assets-CgyrPnT-.mjs → web-assets-ew0iaP7c.mjs} +35 -35
  188. package/dist/{web3-Cd0Yd0eQ.mjs → web3-BUyXBaqq.mjs} +6 -6
  189. package/dist/{workers-builds-f2nVw7EZ.mjs → workers-builds-DzU9NGno.mjs} +7 -7
  190. package/dist/{workers-for-platforms-DjeKp2uy.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
  191. package/dist/{workers-CTwJpTfJ.mjs → workers-pP5tsDbD.mjs} +25 -22
  192. package/dist/{workers-vpc-B_L3TEg2.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
  193. package/dist/{workflows-CBPGf65x.mjs → workflows-DXYGKtqq.mjs} +1 -1
  194. package/dist/wrangler-migration-R9TQ_4Qd.mjs +946 -0
  195. package/dist/zaraz-DoH4QD0u.mjs +22 -0
  196. package/dist/{zero-trust-B9xY8zcn.mjs → zero-trust-DKt20rzE.mjs} +461 -458
  197. package/dist/{zone-CmwVqTI2.mjs → zone-BXM3p0JR.mjs} +1 -1
  198. package/dist/{zones-Bf0VVpMf.mjs → zones-CJdtqEBx.mjs} +21 -21
  199. package/package.json +11 -11
  200. package/dist/account-tags-povXTDAu.mjs +0 -15
  201. package/dist/ai-search-CJ3b8eot.mjs +0 -79
  202. package/dist/auth-OFqV2M4q.mjs +0 -2
  203. package/dist/body-parser-DkHKPkJ7.mjs +0 -2
  204. package/dist/browser-run-CfQ30dB6.mjs +0 -42
  205. package/dist/build-Bm6kGyzo.mjs +0 -2
  206. package/dist/certificate-authorities-BdMRaOnD.mjs +0 -6
  207. package/dist/cli-CsnoQloF.mjs +0 -6
  208. package/dist/client-certificates-CuWGvZSr.mjs +0 -13
  209. package/dist/cps-VRP794c5.mjs +0 -6
  210. package/dist/csam-scanner-C1jOgXVu.mjs +0 -10
  211. package/dist/ct-alerting-Y9vfa6Fo.mjs +0 -5
  212. package/dist/custom-certificates-CojTEC0E.mjs +0 -17
  213. package/dist/custom-pages-M4RUxcn6.mjs +0 -21
  214. package/dist/dcv-delegation-KOO8syyQ.mjs +0 -4
  215. package/dist/healthchecks-4Hz-6xYi.mjs +0 -22
  216. package/dist/keyless-certificates-B4ta_OGS.mjs +0 -13
  217. package/dist/keys-B9zvFzrf.mjs +0 -4
  218. package/dist/load-balancers-CWd9mSWM.mjs +0 -76
  219. package/dist/mtls-certificates-B5AWTU6u.mjs +0 -13
  220. package/dist/organization-CXAM41sd.mjs +0 -71
  221. package/dist/origin-ca-certificates-DwhYV3m_.mjs +0 -11
  222. package/dist/origin-tls-client-auth-COSxTc2q.mjs +0 -30
  223. package/dist/pages-DuGcBC6k.mjs +0 -54
  224. package/dist/pay-per-crawl-B3_Gn9Cj.mjs +0 -38
  225. package/dist/precursor-VobQf--m.mjs +0 -4
  226. package/dist/previews-DkwFHNRx.mjs +0 -7
  227. package/dist/registrar-X1YLlnmg.mjs +0 -43
  228. package/dist/request-tracers-CHWpiejG.mjs +0 -4
  229. package/dist/resource-tagging-BTagOZli.mjs +0 -4
  230. package/dist/run-roYb_Odh.mjs +0 -2
  231. package/dist/smart-shield-DwW7N92r.mjs +0 -24
  232. package/dist/ssl-u_0gUhPA.mjs +0 -45
  233. package/dist/tags-D_Hc_A-r.mjs +0 -4
  234. package/dist/telemetry-Ct_2AaO4.mjs +0 -2
  235. package/dist/update-check-BnGDxswi.mjs +0 -2
  236. package/dist/values-CLfxkAUJ.mjs +0 -4
  237. package/dist/version-CVlh2Zaq.mjs +0 -2
  238. package/dist/wrangler-migration-DxTB5yPT.mjs +0 -2
  239. package/dist/zaraz-3VDxl0gF.mjs +0 -22
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import"./api-eMuS5GI1.mjs";import{t}from"./path-DRw6Y-nd.mjs";import{n,t as r}from"./local-Dil4fTWX.mjs";import{a as i,i as a,n as o}from"./auth-eVI_UEt8.mjs";import{a as s,t as c}from"./context-B-vEsyrK.mjs";import{t as l}from"./output-Co4xdFf6.mjs";import{t as u}from"./dry-run-C2KjGX10.mjs";import{t as d}from"./progress-R-1tIuep.mjs";import{n as f,t as p}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";import{i as m,n as h,r as g,t as _}from"./body-parser-DkHKPkJ7.mjs";import{n as v}from"./input-validation-D7z60HJH.mjs";import{a as ee,i as y,n as te,o as b,r as ne}from"./prompt-dgLm0iFJ.mjs";import{_ as x,a as S,c as re,d as C,g as w,h as T,i as E,m as D,o as O,p as k,r as A,s as ie,t as j,u as ae}from"./schema-flags-DcKjAxI1.mjs";import{domainToASCII as oe}from"node:url";import{isDeepStrictEqual as se}from"node:util";var M={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions/${e.extension}`};function ce(e){return e.usage("$0 registrar extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get <extension>`,describe:`Get extension`,builder:ce,handler:async e=>p({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(M,{account_id:n,extension:e.extension}));l(i,{successLabel:`Loaded`})})};var ue={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions`,query:[`name`,`cursor`,`per_page`,`direction`,`sort_by`]};function de(e){return e.usage("$0 registrar extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
3
- Pass this value to fetch the next page of results. Omit (or
4
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List extensions`,builder:de,handler:async e=>p({command:`registrar extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await s();u({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/extensions`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(ue,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})},pe={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(le).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var N={method:`POST`,path:e=>t`/accounts/${e.account_id}/registrar/domain-check`,body:`json`,errors:{400:`BadRequestError`}};function me(e){return e.usage("$0 registrar registrations check <domains...>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,array:!0,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const he={command:`check <domains...>`,describe:`Check domain availability`,builder:me,handler:async e=>p({command:`registrar registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({domains:e.domains}):h(e.body)});return}let t=await o(e),n=e.local?r:await c();if(e.accountId=n,e.body){let r=h(e.body),i=await d(`Creating`,async()=>t.send(N,{body:r,account_id:n}));l(i,{successLabel:`Created`});return}let i=_({domains:e.domains}),a=await d(`Creating`,async()=>t.send(N,{body:i,account_id:n}));l(a,{successLabel:`Created`})})};var ge={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/registration-status`};function _e(e){return e.usage("$0 registrar registrations get-registration-status <domain-name>\n\nReturns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:_e,handler:async e=>p({command:`registrar registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(ge,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var ye={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/transfer-in-status`};function be(e){return e.usage("$0 registrar registrations get-transfer-status <domain-name>\n\nReturns the current status of a domain transfer workflow. Use this endpoint to poll transfer progress after initiating a transfer with `POST /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in`. The URL is provided in the `links.self` field of the transfer response. ### Transfer timelines Transfers typically take 1–10 days due to ICANN-mandated approval windows. ### Workflow states **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `in_progress`: Transfer has been submitted to the registry and is being processed. Continue polling. - `blocked`: The workflow is waiting on the losing registrar or registry to release the domain. This is the **most common state** for transfers and is entirely normal — it means the ICANN transfer approval window is in effect. The losing registrar has up to 5 days to approve or reject. Continue polling with longer intervals (e.g., every 30–60 minutes). - `action_required`: The user needs to take action (e.g., the FOA email needs to be accepted). See `context` for details on what is needed. - `pending`: Transfer workflow created but not yet started processing. ### Polling guidance Adjust your polling interval based on the current workflow state: - `pending` or `in_progress`: Poll every 30 seconds. - `blocked`: The transfer is waiting on a third party (e.g., losing registrar approval). Poll every 30–60 minutes. - `action_required`: Stop polling. The workflow will not advance until the user takes action. Check `context` for details on what is needed. - `succeeded` or `failed`: Terminal — stop polling.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get-transfer-status <domain-name>`,describe:`Get Transfer Status`,builder:be,handler:async e=>p({command:`registrar registrations get-transfer-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-transfer-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(ye,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var Se={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/update-status`};function Ce(e){return e.usage("$0 registrar registrations get-update-status <domain-name>\n\nReturns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:Ce,handler:async e=>p({command:`registrar registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(Se,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var Te={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}`};function Ee(e){return e.usage("$0 registrar registrations get <domain-name>\n\nReturns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.").positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`get <domain-name>`,describe:`Get Registration`,builder:Ee,handler:async e=>p({command:`registrar registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(Te,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var Oe={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations`,query:[`cursor`,`per_page`,`direction`,`sort_by`]};function ke(e){return e.usage("$0 registrar registrations list\n\nReturns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.").option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
5
- Pass this value to fetch the next page of results. Omit (or
6
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date (`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`list`,describe:`List Registrations`,builder:ke,handler:async e=>p({command:`registrar registrations list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await s();u({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/registrations`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(Oe,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})};var je={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/domain-search`,query:[`q`,`extensions`,`limit`],joined:[`extensions`],errors:{400:`BadRequestError`}};function Me(e){return e.usage('$0 registrar registrations search\n\nSearches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.').option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
7
- - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
8
- - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
9
- returns results across all supported extensions. Extensions not in the supported
10
- set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`search`,describe:`Search for available domains`,builder:Me,handler:async e=>p({command:`registrar registrations search`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={q:e.query,extensions:e.extensions,limit:e.limit};if(e.dryRun){let e=await s();u({command:`cf registrar registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/domain-search`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(je,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})};var P={method:`POST`,path:e=>t`/accounts/${e.account_id}/registrar/domain-transfer-check`,body:`json`,errors:{400:`BadRequestError`,503:`ServiceUnavailableError`}};function Pe(e){return e.usage("$0 registrar registrations transfer-check\n\nPerforms real-time, authoritative eligibility checks directly against needed requirements. Use this endpoint to verify a domain is available before attempting a transfer via `POST /registrations/:domain_name/transfer-in`. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Behavior - Maximum 10 domains per request - Pricing is only returned for domains where `transferable: true` - Results are not cached; each request queries the registry & other needed upstreams ## Extension Support All `.uk` extensions (`.uk`, `.co.uk`, etc) do not support auth codes. As such, Cloudflare will ignore the `auth_code` section of this request for `.uk` domains. This means that a `.uk` domain depends on public data to obtain domain information, so it might be a few minutes outdated. ### Workflow 1. Call this endpoint with domains the user wants to transfer. 2. For each domain where `transferable: true`, present pricing to the user. 3. For each domain where `transferable: false`, present reasons to the user 4. Proceed to `POST /registrations/:domain_name/transfer-in` only for the `transferable: true` domains.").option(`domains`,{type:`string`,description:`List of domain objects to evaluate for transfer eligibility. 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:`List of transferable domain objects to check.`})}const Fe={command:`transfer-check`,describe:`Check domain transfer eligibility`,builder:Pe,handler:async e=>p({command:`registrar registrations transfer-check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations transfer-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/domain-transfer-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({domains:g(e.domains,`domains`)}):h(e.body)});return}let t=await o(e),n=e.local?r:await c();if(e.accountId=n,e.body){let r=h(e.body),i=await d(`Creating`,async()=>t.send(P,{body:r,account_id:n}));l(i,{successLabel:`Created`});return}if(e.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let i=_({domains:g(e.domains,`domains`)}),a=await d(`Creating`,async()=>t.send(P,{body:i,account_id:n}));l(a,{successLabel:`Created`})})};function Ie(e){return e.usage("$0 registrar registrations transfer-in <domain-name>\n\nStarts a domain transfer-in workflow. This is typically a billable operation — successful transfers charge the account's default payment method, except for extensions with zero transfer pricing (e.g. UK extensions). All successful domain transfers are non-refundable. ### How transfers work Domain transfers move a domain from another registrar to Cloudflare. Transfers typically take 1-10 days due to ICANN-mandated approval windows. ### Prerequisites - The domain must already have a zone in the Cloudflare account (added through the dashboard or zone API). - The zone must have DNSSec disabled. - For billable transfers (i.e. extensions with non-zero transfer pricing), the account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The domain must be unlocked at the current registrar. - An authorization/EPP code from the current registrar is required, except for UK extensions — see Auth code below. ### Auth code An authorization code (also called EPP code, transfer key, or auth-info code) is required for most extensions, with the exception of UK extensions. Obtain this from your current registrar's control panel. The auth code in the request body must be base64-encoded per RFC 4648 §4 (standard alphabet, no line breaks). ### Response behavior Successful transfer initiation returns `202 Accepted`. Validation or initiation failures return the documented `4XX` responses. Poll `GET /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in-status` to track progress. ### Premium domains Premium domain transfers are not currently supported by this API. Please use the [dashboard](https://dash.cloudflare.com/) for now. ### Billing The account's default payment method is charged upon successful transfer completion, unless the extension has zero transfer pricing (e.g. UK extensions). The transfer adds time to the domain's existing expiration date (typically 1 year).").positional(`domain-name`,{type:`string`,description:`Domain name to transfer.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to indicate a preference for asynchronous\nprocessing (RFC 7240)."}).option(`auth-code`,{type:`string`,description:`The EPP/authorization code from your current registrar, base64-encoded
11
- per RFC 4648 §4. Obtain this from your current registrar's control panel.
12
- Required for all extensions, except for UK.
13
- `}).option(`auto-renew`,{type:`boolean`,description:"Enable or disable automatic renewal after transfer. Defaults to `false` if omitted.\n",default:!1}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
14
- communications from the registry, including ownership verification
15
- and renewal notices.
16
- `}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
17
- Most registrations do not require a fax number.
18
- `}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-administrator-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-billing-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
19
- communications from the registry, including ownership verification
20
- and renewal notices.
21
- `}).option(`contacts-billing-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
22
- Most registrations do not require a fax number.
23
- `}).option(`contacts-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-billing-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-billing-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-registrant-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
24
- communications from the registry, including ownership verification
25
- and renewal notices.
26
- `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
27
- Most registrations do not require a fax number.
28
- `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-registrant-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-technical-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
29
- communications from the registry, including ownership verification
30
- and renewal notices.
31
- `}).option(`contacts-technical-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
32
- Most registrations do not require a fax number.
33
- `}).option(`contacts-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-technical-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`privacy-mode`,{type:`string`,description:`WHOIS privacy mode to apply after transfer completes. Defaults to
34
- the extension's default privacy mode (typically \`redaction\`).
35
- `,choices:[`off`,`redaction`]}).coerce(`privacy-mode`,e=>v(e,`privacy-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`,`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`,`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`,`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].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 --contacts-* flag is set`)}return!0})}const Le={command:`transfer-in <domain-name>`,describe:`Initiate Transfer`,builder:Ie,handler:async e=>p({command:`registrar registrations transfer-in`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){let t=await s();u({command:`cf registrar registrations transfer-in`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?_({auth_code:v(e[`auth-code`],`auth-code`,`text`),auto_renew:e[`auto-renew`],contacts:{administrator:{email:v(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:v(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:v(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:v(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:v(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:v(e[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:v(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:v(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:v(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:v(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:v(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:v(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:v(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:v(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:v(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:v(e[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:v(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:v(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:v(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:v(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},privacy_mode:e[`privacy-mode`]}):h(e.body)});return}let n=await o(e),i=e.local?r:await c();if(e.accountId=i,e.body){let r=h(e.body),o=await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(o,{successLabel:`Created`});return}let f={};e[`auth-code`]!==void 0&&m(f,[`auth_code`],v(e[`auth-code`],`auth-code`,`text`)),e[`auto-renew`]!==void 0&&m(f,[`auto_renew`],e[`auto-renew`]),e[`contacts-administrator-email`]!==void 0&&m(f,[`contacts`,`administrator`,`email`],v(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),e[`contacts-administrator-fax`]!==void 0&&m(f,[`contacts`,`administrator`,`fax`],v(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),e[`contacts-administrator-phone`]!==void 0&&m(f,[`contacts`,`administrator`,`phone`],v(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),e[`contacts-administrator-postal-info-name`]!==void 0&&m(f,[`contacts`,`administrator`,`postal_info`,`name`],v(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),e[`contacts-administrator-postal-info-organization`]!==void 0&&m(f,[`contacts`,`administrator`,`postal_info`,`organization`],v(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),e[`contacts-billing-email`]!==void 0&&m(f,[`contacts`,`billing`,`email`],v(e[`contacts-billing-email`],`contacts-billing-email`,`text`)),e[`contacts-billing-fax`]!==void 0&&m(f,[`contacts`,`billing`,`fax`],v(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),e[`contacts-billing-phone`]!==void 0&&m(f,[`contacts`,`billing`,`phone`],v(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),e[`contacts-billing-postal-info-name`]!==void 0&&m(f,[`contacts`,`billing`,`postal_info`,`name`],v(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),e[`contacts-billing-postal-info-organization`]!==void 0&&m(f,[`contacts`,`billing`,`postal_info`,`organization`],v(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),e[`contacts-registrant-email`]!==void 0&&m(f,[`contacts`,`registrant`,`email`],v(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),e[`contacts-registrant-fax`]!==void 0&&m(f,[`contacts`,`registrant`,`fax`],v(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),e[`contacts-registrant-phone`]!==void 0&&m(f,[`contacts`,`registrant`,`phone`],v(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),e[`contacts-registrant-postal-info-name`]!==void 0&&m(f,[`contacts`,`registrant`,`postal_info`,`name`],v(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),e[`contacts-registrant-postal-info-organization`]!==void 0&&m(f,[`contacts`,`registrant`,`postal_info`,`organization`],v(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),e[`contacts-technical-email`]!==void 0&&m(f,[`contacts`,`technical`,`email`],v(e[`contacts-technical-email`],`contacts-technical-email`,`text`)),e[`contacts-technical-fax`]!==void 0&&m(f,[`contacts`,`technical`,`fax`],v(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),e[`contacts-technical-phone`]!==void 0&&m(f,[`contacts`,`technical`,`phone`],v(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),e[`contacts-technical-postal-info-name`]!==void 0&&m(f,[`contacts`,`technical`,`postal_info`,`name`],v(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),e[`contacts-technical-postal-info-organization`]!==void 0&&m(f,[`contacts`,`technical`,`postal_info`,`organization`],v(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),e[`privacy-mode`]!==void 0&&m(f,[`privacy_mode`],e[`privacy-mode`]);let p=await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:f,headers:Object.keys(t).length>0?t:void 0}));l(p,{successLabel:`Created`})})};function Re(e){return e.usage("$0 registrar registrations update <domain-name>\n\nUpdates an existing domain registration. By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return `200 OK` with a completed workflow status. If the update is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`. This endpoint currently supports updating `auto_renew` only.").positional(`domain-name`,{type:`string`,description:`Domain name to update.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to receive an immediate `202 Accepted` without\nwaiting for the operation to complete (RFC 7240)."}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal.
36
- Setting this field to \`true\` authorizes Cloudflare to charge the
37
- account's default payment method up to 30 days before domain expiry
38
- to renew the domain automatically. Renewal pricing may change over
39
- time based on registry pricing.
40
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const ze={command:`update <domain-name>`,describe:`Update Registration`,builder:Re,handler:async e=>p({command:`registrar registrations update`,classification:{safeFlags:[`auto-renew`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){let t=await s();u({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?_({auto_renew:e[`auto-renew`]}):h(e.body)});return}let n=await o(e),i=e.local?r:await c();if(e.accountId=i,e.body){let r=h(e.body),o=await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(o,{successLabel:`Updated`});return}let f={};e[`auto-renew`]!==void 0&&m(f,[`auto_renew`],e[`auto-renew`]);let p=await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:f,headers:Object.keys(t).length>0?t:void 0}));l(p,{successLabel:`Updated`})})};async function F(e,t,n){let r=b(n),i=oe(n.trim().replace(/\.$/,``)).toLowerCase(),a=await d(`Checking availability`,()=>e.send(N,{account_id:t,body:{domains:[n]}})),o=i===``?[]:a.domains.filter(e=>e.name.toLowerCase()===i),s=o.length===1?o[0]:void 0;if(!s)throw Error(`The availability check returned no result for ${r}, so cf cannot safely register it.`);if(s.registrable!==!0&&s.reason===`domain_premium`)throw Error(`${r} is a premium domain (domain_premium). Premium registration is not supported by this API, so cf will not submit it.`);if(s.registrable!==!0){let e=s.reason===void 0?``:` (${b(s.reason)})`;throw Error(`${r} is not available for registration${e}.`)}if(s.tier===`premium`)throw Error(`${r} is a premium domain. Premium registration is not supported by this API, so cf will not submit it.`);if(s.tier!==`standard`)throw Error(`${r} is not confirmed as a standard domain. This API only supports standard registrations, so cf will not submit it.`);if(!s.pricing)throw Error(`The availability check returned no pricing for ${r}, so cf cannot safely register it.`);return s.pricing}const I=`registrar-extension-schema`;function Be(e){let t=e.trim().toLowerCase().replace(/\.$/,``).split(`.`);return t.slice(1).map((e,n)=>t.slice(n+1).join(`.`))}async function Ve(e,t,n,r){let i;try{i=r===void 0?await n.send(M,{account_id:t,extension:e}):await n.send(M,{account_id:t,extension:e},{timeoutInSeconds:r/1e3,maxRetries:0})}catch(e){return{ok:!1,reason:D(e)}}let a=T(i,`registration_schema`);return a?{ok:!0,extension:e,schema:a}:{ok:!1,reason:`the API returned no registration schema for .${e}`}}async function L(e,t,n,r,i){let a=t?[t]:Be(e);if(a.length===0)return{ok:!1,reason:`'${e}' has no extension — pass a fully qualified domain name`};let o,s=`not found`;for(let e of a){let t=w(I,[n,e]);if(t)return{ok:!0,extension:e,schema:t};if(!o)try{o=await r()}catch(e){return{ok:!1,reason:D(e)}}let a;if(i!==void 0&&(a=i-Date.now(),a<=0))return{ok:!1,reason:`the request timed out`};let c=await Ve(e,n,o,a);if(c.ok)return x(I,[n,e],c.schema),c;if(s=c.reason,!/not found/i.test(c.reason))return c}return{ok:!1,reason:a.length>1?`no registration schema for ${a.map(e=>`.${e}`).join(` or `)} (${s})`:s}}const He=/* @__PURE__ */ new Set([`domain_name`,`years`,`auto_renew`,`privacy_mode`]),Ue={acknowledgements:`Acknowledgements`,contact_extensions:`Registry Details`,contacts:`Contacts`};function R(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function We(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 z(e){return typeof e==`boolean`?e?`Yes`:`No`:e===null?`null`:typeof e==`string`||typeof e==`number`?String(e):JSON.stringify(e)??`undefined`}function B(e,t){return e.find(e=>e.path.length===t.length&&e.path.every((e,n)=>e===t[n]))}function Ge(e,t,n){if(typeof t==`boolean`&&e.some(e=>e.includes(`acknowledgement`)))return t?`Accepted`:`Declined`;let r=B(n,e),i=z(t),a=R(r?.choiceLabels,i);if(a)return`${a} (${i})`;let o=(r?.schema.oneOf??r?.schema.anyOf)?.find(e=>e.title&&C(e,t).length===0);return o?.title?`${o.title} (${i})`:i}function Ke(e,t){return e.map((n,r)=>r===e.length-1&&t?.schema.title?t.schema.title:R(Ue,n)??We(n)).join(` · `)}function V(e,t,n=[]){let r=[];for(let[i,a]of Object.entries(e)){if(n.length===0&&He.has(i))continue;let e=[...n,i];if(typeof a==`object`&&a&&!Array.isArray(a)&&Object.keys(a).length>0){r.push(...V(a,t,e));continue}let o=B(t,e);r.push([Ke(e,o),Ge(e,a,t)])}return r.sort(([e],[t])=>e.localeCompare(t))}function H(e,t,n){if(Object.hasOwn(e,n))return z(e[n]);let r=qe(t,n);return r===void 0?`API default`:`${z(r)} (default)`}function U(e){return e===void 0?[]:[...e.default===void 0?[]:[e.default],...(e.allOf??[]).flatMap(U)]}function W(e,t){return e===void 0?[]:[...U(e.properties?.[t]),...(e.allOf??[]).flatMap(e=>W(e,t))]}function qe(e,t){let n=W(e,t),r=n[0];return n.length>0&&n.every(e=>se(e,r))?r:void 0}function G(t){let n=t.map(([e,t])=>[b(e),b(t)]),r=Math.min(32,Math.max(...n.map(([e])=>e.length),0));return n.map(([t,n])=>`│ ${e.muted(t.padEnd(r))} ${e.bold(n)}`)}function Je(t){let n=[[`Domain`,t.domain],[`Account`,t.accountId],[`Registration term`,`${t.years} ${t.years===1?`year`:`years`}`],[`Due now`,t.quotedCost],[`Renewal price`,`${t.pricing.currency} ${t.pricing.renewal_cost} per year`],[`Auto-renew`,H(t.body,t.schema,`auto_renew`)],[`Privacy mode`,H(t.body,t.schema,`privacy_mode`)]],r=V(t.body,t.descriptors??[]);return[`│`,`${e.brand(`◇`)} ${e.bold(`Review registration`)}`,`│`,...G(n),...r.length>0?[`│`,`│ ${e.bold(`Registration details`)}`,...G(r)]:[],`│`].join(`
41
- `)}const K=[`domain_name`],q=`Fully qualified domain name to register, e.g. example.travel`,Ye=[`domain-name`,`domainName`,`extension`,`force`,`f`,`prefer`,`contacts`];function Xe(e){return`/${e.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}function Ze(e,t,n){return t.some(t=>{if(t.path[0]!==e||t.path.length===1)return!1;let r=t.name.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase());return Object.hasOwn(n,t.name)&&n[t.name]!==void 0||Object.hasOwn(n,r)&&n[r]!==void 0})}function Qe(e){if(e.choices===void 0)return;let t=(e.schema.enum??(e.schema.oneOf??e.schema.anyOf)?.flatMap(e=>e.const===void 0?e.enum??[]:[e.const]))?.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t?.length===e.choices.length?t:void 0}function $e(e){let t=e.type===`boolean`&&e.schema.const===!0,n=e.schema.description,r=n===void 0?void 0:b(n);return{path:Xe(e.path),flag:`--${e.name}`,question:ie(e),description:r,choices:Qe(e)?.map(t=>{let n=String(t),r=e.choiceLabels!==void 0&&Object.hasOwn(e.choiceLabels,n)?e.choiceLabels[n]??n:n;return{value:t,label:b(r)}}),requiredValue:e.schema.const,acknowledgementText:t?r:void 0}}function et(e,t,n,r,i){let a=S(n,r);return a.length!==0&&(l({submitted:!1,reason:`registration_input_required`,message:`Not submitted. Additional registration input is required.`,domainName:e,extension:t,missingFields:a.map($e),validationErrors:i}),!0)}function tt(e){let t=/^(\d+)(?:\.(\d+))?$/.exec(e);if(!t)return;let n=t[2]??``;return{units:BigInt(`${t[1]}${n}`),scale:n.length}}function nt(e,t){let n=tt(e.registration_cost),r=tt(e.renewal_cost);if(!n||!r)return;let i=Math.max(n.scale,r.scale),a=e=>10n**BigInt(e),o=n.units*a(i-n.scale)+r.units*a(i-r.scale)*BigInt(t-1);if(i===0)return o.toString();let s=a(i);return`${o/s}.${(o%s).toString().padStart(i,`0`)}`}function rt(e,t){let n=nt(e,t);if(!n||!/^[A-Z]{3}$/.test(e.currency))throw Error(`The availability check returned invalid pricing, so cf cannot safely confirm this registration.`);return`${e.currency} ${n}`}function J(e,t){return e.flatMap(e=>t.map(t=>[...e,...t]))}function Y(e,t,n,r=!1,i=[]){let a=e.properties?.[t],o=a!==void 0,s=[a===void 0?[]:[a]],c=e.if&&e.then&&A(e.if)&&C(e.if,n).length===0?[e.then]:[];for(let a of[...e.allOf??[],...c]){let e=Y(a,t,n,r,i);e.found&&(o=!0,s=J(s,e.bundles))}for(let a of[e.oneOf,e.anyOf]){if(!a?.length)continue;let e=r&&a.every(A)?a.filter(e=>st(e,t,n,i)):[],c=(e.length>0?e:a).map(e=>Y(e,t,n,r,i));c.some(e=>e.found)&&(o=!0,s=J(s,c.flatMap(e=>e.bundles)))}return{found:o,bundles:s}}function X(e,t){let n=e[t];return[...n===void 0?[]:[n],...(e.allOf??[]).flatMap(e=>X(e,t))]}function Z(e){return e.length===0?{}:e.length===1?e[0]??{}:{allOf:e}}function it(e){let t=[...typeof e.minimum==`number`?[e.exclusiveMinimum===!0?Math.floor(e.minimum)+1:Math.ceil(e.minimum)]:[],...typeof e.exclusiveMinimum==`number`?[Math.floor(e.exclusiveMinimum)+1]:[],...(e.allOf??[]).flatMap(e=>{let t=it(e);return t===void 0?[]:[t]})];return t.length>0?Math.max(1,...t):void 0}function at(e){let t=X(e,`const`);if(t.length>0)return t.every(e=>Object.is(e,t[0]))?{found:!0,value:t[0]}:{found:!1};let n=X(e,`default`);if(n.length>0)return n.every(e=>Object.is(e,n[0]))?{found:!0,value:n[0]}:{found:!1};let r=it(e);return r===void 0?{found:!1}:{found:!0,value:r}}function Q(e){let{allOf:t,anyOf:n,oneOf:r,...i}=e,a=[Object.keys(i).length===0?[]:[i]];for(let e of t??[])a=J(a,Q(e).map(e=>[e]));for(let e of[r,n])e?.length&&(a=J(a,e.flatMap(e=>Q(e).map(e=>[e]))));return a.map(Z)}function ot(e){return e.flatMap(e=>Q(e).map(t=>({schema:e,candidate:at(t)})))}function st(e,t,n,r){let i=C(e,n);return Object.hasOwn(n,t)||i.length===0?i.length===0:r.some(r=>C(e,{...n,[t]:r}).length===0)}function ct(e,t){let n=Object.hasOwn(e,`years`),r=Y(t,`years`,e,!1);if(!r.found)throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let i=r.bundles.map(Z),a=Y(t,`years`,e,!0,n?[]:ot(i).flatMap(({schema:e,candidate:t})=>t.found&&C(e,t.value).length===0?[t.value]:[]));if(!a.found||n&&a.bundles.some(e=>e.length===0))throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let o=a.bundles.map(Z),s=o,c,l;if(n)l=e.years;else{let n=ot(o).filter(({schema:e,candidate:t})=>{if(!t.found)return!0;let[n]=C(e,t.value);return n===void 0||(c??=n,!1)});if(A(t)){let r=n.filter(({candidate:e})=>!e.found),i=n.filter(({candidate:n})=>n.found&&C(t,{...e,years:n.value}).length===0);i.length>0&&(n=[...r,...i])}s=n.map(({schema:e})=>e);let r=n.map(({candidate:e})=>e),[i]=r;l=i?.found===!0&&r.every(e=>e.found&&Object.is(e.value,i.value))?i.value:void 0}if(typeof l!=`number`||!Number.isInteger(l)||l<=0)throw!n&&s.length===0&&c?Error(`The extension schema returned an invalid default registration term: ${c}`):Error(n?`The requested registration term must be a positive whole number of years.`:`The extension schema returned no safe default registration term, so cf cannot safely confirm this registration.`);let u=n?C(o.length===1?o[0]??{}:{anyOf:o},l):s.flatMap(e=>C(e,l));if(u.length>0)throw Error(n?`The requested registration term is invalid: ${u[0]}`:`The extension schema returned an invalid default registration term: ${u[0]}`);return e.years=l,l}let lt;function $(e){let t=v(e,`domain-name`,`text`);if(t!==void 0&&typeof t!=`string`)throw Error(`--domain-name must be a string`);return t}function ut(e){return lt=e,e.positional(`domain-name`,{type:`string`,description:`Fully qualified domain name, e.g. example.travel`}).option(`extension`,{type:`string`,description:`Extension whose registration schema to use (default: derived from the domain)`}).option(`prefer`,{type:`string`,description:"Set the Prefer header, e.g. `respond-async` to skip the synchronous wait"}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip the registration confirmation prompt`,default:!1}).option(`contacts`,{type:`string`,description:`Registrant contacts as inline JSON or @path to a reusable JSON file`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this extension's input flags`}).epilogue("Input flags depend on the extension: run `cf registrar registrations create <domain> --help`.\ncf rechecks availability and pricing before confirmation. Run `cf registrar registrations check --domains <domain>` to inspect them separately.")}async function dt(t){lt?.showHelp(`log`);let n=$(t[`domain-name`]);if(!n)return;let r=b(n);if(t.local){console.log(`\n${e.muted(`Registration fields are unavailable in local mode.`)}`);return}let a=Date.now()+k,s=await i(a);if(!s){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the registration fields for ${r}.`)}`);return}let c=await L(n,t.extension,s,()=>o(t),a);console.log(c.ok?`\n${O(re(c.schema,{exclude:[K]}),`Registration fields for .${c.extension}`)}`:`\n${e.muted(`Could not load the registration fields for ${r}: ${b(c.reason)}.`)}`)}async function ft(e,t,n){for(;;){let r=E(e,t,n);if(r.length===0)return!0;for(let e of r){let n=e.description??``,r=ie(e);if(e.type===`boolean`&&e.schema.const===!0){let r=b(e.schema.description??n);if(!await ne(e.name,r))return!1;t[e.name]=!0}else e.choices?.length?t[e.name]=await y(e.name,r,e.choices,e.choiceLabels):t[e.name]=await ee(e.name,r,{validate:t=>ae(e,t)})}}}function pt(e){let t=h(e);if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--body must contain a JSON object`);return t}function mt(e){let t;if(e.startsWith(`@`))t=v(e,`contacts`,`json`);else try{t=JSON.parse(e)}catch{throw Error(`--contacts must contain a JSON object or @path to a JSON file`)}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--contacts must contain a JSON object or @path to a JSON file`);return t}var ht=f({command:`create [domain-name]`,describe:"Register a domain. Billable and non-refundable — input fields are extension-specific, see `create <domain> --help`",builder:ut,handler:async e=>{if(e.help){await dt(e);return}if(e.local)throw Error(n);let t={};e.prefer!==void 0&&(t.Prefer=String(e.prefer));let r;if(e.body!==void 0){let t=j([],e,{reserved:Ye}).errors.some(e=>e.startsWith(`Unknown flag`));if(e.contacts!==void 0||t)throw Error(`--body cannot be combined with registration field flags. Pass one or the other.`);r=pt(e.body)}let i=e.contacts===void 0?void 0:mt(e.contacts),f=$(e[`domain-name`]),p=r?.domain_name;if(p!==void 0&&typeof p!=`string`)throw Error(`--body field domain_name must be a string`);if(f!==void 0&&p!==void 0&&f!==p)throw Error(`The positional domain '${b(f)}' does not match --body domain_name '${b(p)}'`);let m=f??p;if(!m){if(r!==void 0){l({submitted:!1,reason:`registration_input_required`,message:`Not submitted. A domain is required to determine the registration schema.`,missingFields:[{path:`/domain_name`,flag:`--domain-name`,question:q}],validationErrors:["`/domain_name` is required"]});return}m=await ee(`domain-name`,q)}let h=b(m);r&&(r.domain_name=m);let g=e.dryRun?await s()??`<account-id>`:await c(),_,v=async()=>(_||=await o(e),_);e.dryRun||await F(await v(),g,m);let y=await L(m,e.extension,g,v);if(!y.ok)throw Error(`Could not load the registration schema for ${h}: ${b(y.reason)}.`);let ne=b(y.extension),x=y.schema,S=re(y.schema,{exclude:[K]});if(!r){if(i!==void 0&&Ze(`contacts`,S,e))throw Error(`--contacts cannot be combined with --contacts-* fields. Pass one or the other.`);let t={...e},n=i===void 0?void 0:{contacts:i};if(n!==void 0&&delete t.contacts,!await ft(S,t,n))return;let a=j(S,t,{reserved:Ye,baseBody:n});if(a.errors.length>0)throw Error(`${a.errors.join(`
42
- `)}\n\nRun \`cf registrar registrations create ${h} --help\` for .${ne}'s registration fields.`);r={domain_name:m,...a.body}}let w;try{w=ct(r,x)}catch(e){let t=C(x,r);if(et(m,y.extension,S,r,t))return;throw e}let T=C(x,r);if(et(m,y.extension,S,r,T))return;if(T.length>0)throw Error(`${T.join(`
43
- `)}\n\nRun \`cf registrar registrations create ${h} --help\` for this extension's registration fields.`);if(e.dryRun){u({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${g}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:r});return}let E=await F(await v(),g,m),D=rt(E,w);if(e.force||process.stderr.write(`${Je({domain:m,accountId:g,years:w,quotedCost:D,pricing:E,body:r,schema:x,descriptors:S})}\n`),!await te({force:e.force,message:`Registering ${h} for ${w} ${w===1?`year`:`years`} costs ${D}, charges the account's default payment method, and cannot be refunded.`}))return;if(r.years!==w)throw Error(`The registration term changed after confirmation, so cf will not submit this registration.`);let O=await F(await v(),g,m);if(O.currency!==E.currency||O.registration_cost!==E.registration_cost||O.renewal_cost!==E.renewal_cost)throw Error(`Availability or pricing changed while awaiting confirmation, so cf will not submit this registration. Re-run the command to review the current quote.`);let k=await v();e.accountId=g;let A=await d(`Registering`,async()=>a(k,`POST`,`/accounts/${g}/registrar/registrations`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(A,{successLabel:`Registered ${h}`})}},{command:`registrar registrations create`,recordArgs:!1});const gt={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(he).command(ht).command(De).command(ve).command(xe).command(we).command(Ae).command(Ne).command(Fe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_t={command:`registrar`,describe:`registrar`,builder:e=>e.command(pe).command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_t as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-eVI_UEt8.mjs";import{a as r,t as i}from"./context-B-vEsyrK.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-R-1tIuep.mjs";import{t as c}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.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}from"./prompt-dgLm0iFJ.mjs";var p={method:`POST`,path:t=>e`/accounts/${t.account_id}/request-tracer/trace`,body:`json`};function m(e){return e.usage(`$0 request-tracers traces create
3
-
4
- Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`).option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Request Trace`,builder:m,handler:async e=>c({command:`request-tracers traces create`,classification:{safeFlags:[`context-geoloc-is-eu-country`,`context-skip-challenge`,`skip-response`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({body:{base64:d(e[`body-base64`],`body-base64`,`text`),plain_text:d(e[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:e[`context-bot-score`],geoloc:{city:d(e[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:d(e[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:e[`context-geoloc-is-eu-country`],iso_code:d(e[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:e[`context-geoloc-latitude`],longitude:e[`context-geoloc-longitude`],postal_code:d(e[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:d(e[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:d(e[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:d(e[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:e[`context-skip-challenge`],threat_score:e[`context-threat-score`]},method:d(e.method,`method`,`text`),protocol:d(e.protocol,`protocol`,`text`),skip_response:e[`skip-response`],url:d(e.url,`url`,`text`)}):l(e.body)});return}let c=await n(e),m=e.local?t:await i();if(e.accountId=m,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(p,{body:t,account_id:m}));a(n,{successLabel:`Created`});return}e.method===void 0&&(e.method=await f(`method`,`HTTP Method of tracing request`)),e.url===void 0&&(e.url=await f(`url`,`URL to which perform tracing request`));let h=u({body:{base64:d(e[`body-base64`],`body-base64`,`text`),plain_text:d(e[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:e[`context-bot-score`],geoloc:{city:d(e[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:d(e[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:e[`context-geoloc-is-eu-country`],iso_code:d(e[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:e[`context-geoloc-latitude`],longitude:e[`context-geoloc-longitude`],postal_code:d(e[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:d(e[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:d(e[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:d(e[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:e[`context-skip-challenge`],threat_score:e[`context-threat-score`]},method:d(e.method,`method`,`text`),protocol:d(e.protocol,`protocol`,`text`),skip_response:e[`skip-response`],url:d(e.url,`url`,`text`)}),g=await s(`Creating`,async()=>c.send(p,{body:h,account_id:m}));a(g,{successLabel:`Created`})})},g={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_ as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-eVI_UEt8.mjs";import{a as r,t as i}from"./context-B-vEsyrK.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-R-1tIuep.mjs";import{t as c}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/tags/summary`,query:[`cursor`]};function u(e){return e.usage(`$0 resource-tagging summary get
3
-
4
- Lists all distinct tag keys and their distinct values across resources in an account.`).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`List tag key summary`,builder:u,handler:async e=>c({command:`resource-tagging summary get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor};if(e.dryRun){let e=await r();o({command:`cf resource-tagging summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/tags/summary`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})},f={command:`summary`,describe:`Operations for summary`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`resource-tagging`,describe:`resource-tagging`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./run-BvDCuZ8q.mjs";export{e as runWithTelemetry};
@@ -1,24 +0,0 @@
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-eVI_UEt8.mjs";import{i as n}from"./context-B-vEsyrK.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-R-1tIuep.mjs";import{t as o}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";import{n as s,r as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,n as f}from"./prompt-dgLm0iFJ.mjs";var p={method:`POST`,path:t=>e`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function m(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 h={command:`clear`,describe:`Start Cache Reserve Clear`,builder:m,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 f({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(p,{zone_id:s}));r(c,{successLabel:`Deleted`})})};var g={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function _(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 v={command:`status`,describe:`Get Cache Reserve Clear`,builder:_,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(g,{zone_id:s}));r(c,{successLabel:`Loaded`})})},y={command:`cache-reserve-clear`,describe:`Cache Reserve Clear operations`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield`,errors:{500:`InternalServerError`,502:`BadGatewayError`}};function x(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 S={command:`get`,describe:`Get Smart Shield Settings`,builder:x,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(b,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var C={method:`POST`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks`,body:`json`};function w(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-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`http-config-method`,e=>u(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=>u(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 T={command:`create`,describe:`Create Health Check`,builder:w,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?l({address:u(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:u(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:u(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],method:e[`http-config-method`],path:u(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:u(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:u(e.type,`type`,`text`)}):s(e.body)});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=s(e.body),n=await a(`Creating`,async()=>o.send(C,{body:t,zone_id:c}));r(n,{successLabel:`Created`});return}e.address===void 0&&(e.address=await d(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await d(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=l({address:u(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:u(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:u(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],method:e[`http-config-method`],path:u(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:u(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:u(e.type,`type`,`text`)}),p=await a(`Creating`,async()=>o.send(C,{body:f,zone_id:c}));r(p,{successLabel:`Created`})})};var E={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`};function D(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 O={command:`delete <healthcheck-id>`,describe:`Delete Health Check`,builder:D,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 f({force:!!e.force})){process.stderr.write(`Aborted.
14
- `);return}let c=await a(`Deleting`,async()=>o.send(E,{zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(c,{successLabel:`Deleted`})})};var k={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`,body:`json`};function A(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-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`http-config-method`,e=>u(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=>u(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 j={command:`edit <healthcheck-id>`,describe:`Patch Health Check`,builder:A,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?l({address:u(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:u(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:u(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],method:e[`http-config-method`],path:u(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:u(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:u(e.type,`type`,`text`)}):s(e.body)});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(k,{body:t,zone_id:c,healthcheck_id:e[`healthcheck-id`]}));r(n,{successLabel:`Updated`});return}e.address===void 0&&(e.address=await d(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await d(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=l({address:u(e.address,`address`,`text`),check_regions:e[`check-regions`],consecutive_fails:e[`consecutive-fails`],consecutive_successes:e[`consecutive-successes`],description:u(e.description,`description`,`text`),http_config:{allow_insecure:e[`http-config-allow-insecure`],expected_body:u(e[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:e[`http-config-expected-codes`],follow_redirects:e[`http-config-follow-redirects`],method:e[`http-config-method`],path:u(e[`http-config-path`],`http-config-path`,`text`),port:e[`http-config-port`]},interval:e.interval,name:u(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:u(e.type,`type`,`text`)}),p=await a(`Updating`,async()=>o.send(k,{body:f,zone_id:c,healthcheck_id:e[`healthcheck-id`]}));r(p,{successLabel:`Updated`})})};var M={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`};function N(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 P={command:`get <healthcheck-id>`,describe:`Health Check Details`,builder:N,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(M,{zone_id:s,healthcheck_id:e[`healthcheck-id`]}));r(c,{successLabel:`Loaded`})})};var F={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks`,query:[`page`,`per_page`]};function I(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 L={command:`list`,describe:`List Health Checks`,builder:I,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(F,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})};var R={method:`PUT`,path:t=>e`/zones/${t.zone_id}/smart_shield/healthchecks/${t.healthcheck_id}`,body:`json`,constants:{success:!0}};function z(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-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).coerce(`result-http-config-method`,e=>u(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=>u(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 B={command:`update <healthcheck-id>`,describe:`Update Health Check`,builder:z,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?l({errors:c(e.errors,`errors`),messages:c(e.messages,`messages`),result:{address:u(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:u(e[`result-description`],`result-description`,`text`),http_config:{allow_insecure:e[`result-http-config-allow-insecure`],expected_body:u(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`],method:e[`result-http-config-method`],path:u(e[`result-http-config-path`],`result-http-config-path`,`text`),port:e[`result-http-config-port`]},interval:e[`result-interval`],name:u(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:u(e[`result-type`],`result-type`,`text`)},success:e.success}):s(e.body)});return}let o=await t(e),d=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(R,{body:t,zone_id:d,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 f=l({errors:c(e.errors,`errors`),messages:c(e.messages,`messages`),result:{address:u(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:u(e[`result-description`],`result-description`,`text`),http_config:{allow_insecure:e[`result-http-config-allow-insecure`],expected_body:u(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`],method:e[`result-http-config-method`],path:u(e[`result-http-config-path`],`result-http-config-path`,`text`),port:e[`result-http-config-port`]},interval:e[`result-interval`],name:u(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:u(e[`result-type`],`result-type`,`text`)},success:e.success}),p=await a(`Updating`,async()=>o.send(R,{body:f,zone_id:d,healthcheck_id:e[`healthcheck-id`]}));r(p,{successLabel:`Updated`})})},V={command:`health-checks`,describe:`Health checks operations`,builder:e=>e.command(T).command(O).command(j).command(P).command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/smart_shield`,body:`json`,errors:{500:`InternalServerError`,502:`BadGatewayError`}};function U(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=>u(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=>u(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=>u(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=>u(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 W={command:`update`,describe:`Patch Smart Shield Settings`,builder:U,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?l({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`]}}):s(e.body)});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(H,{body:t,zone_id:c}));r(n,{successLabel:`Updated`});return}let u=l({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(H,{body:u,zone_id:c}));r(d,{successLabel:`Updated`})})},G={command:`smart-shield`,describe:`Smart Shield settings, health checks, and cache reserve management`,builder:e=>e.command(S).command(W).command(y).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
@@ -1,45 +0,0 @@
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-eVI_UEt8.mjs";import{i as n}from"./context-B-vEsyrK.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-R-1tIuep.mjs";import{t as o}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";import{n as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{i as u,n as d}from"./prompt-dgLm0iFJ.mjs";var f={method:`POST`,path:t=>e`/zones/${t.zone_id}/ssl/analyze`,body:`json`};function p(e){return e.usage(`$0 ssl analyze create
3
-
4
- Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.`).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).coerce(`bundle-method`,e=>l(e,`bundle-method`,`text`)).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).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:`Analyze Certificate`,builder:p,handler:async e=>o({command:`ssl analyze create`,classification:{safeFlags:[`bundle-method`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl analyze create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/analyze`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({bundle_method:e[`bundle-method`],certificate:l(e.certificate,`certificate`,`text`)}):s(e.body)});return}let o=await t(e),u=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=s(e.body),n=await a(`Creating`,async()=>o.send(f,{body:t,zone_id:u}));r(n,{successLabel:`Created`});return}let d=c({bundle_method:e[`bundle-method`],certificate:l(e.certificate,`certificate`,`text`)}),p=await a(`Creating`,async()=>o.send(f,{body:d,zone_id:u}));r(p,{successLabel:`Created`})})},h={command:`analyze`,describe:`Operations for analyze`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var g={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/settings/auto_origin_tls_kex`,body:`json`};function _(e){return e.usage('$0 ssl auto-origin-tls-kex edit\n\nEnable or disable Auto-Origin TLS KEX selection for the zone by sending `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a periodic scan of the zone\'s origins to determine the preferred key-exchange algorithm and writes that preference to the edge so it is sent first in the TLS ClientHello to the origin.').option(`enabled`,{type:`boolean`,description:`Controls enablement of Auto-Origin TLS KEX selection for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Auto-Origin TLS KEX selection.`})}const v={command:`edit`,describe:`Patch Auto-Origin TLS KEX enrollment status for the given zone`,builder:_,handler:async e=>o({command:`ssl auto-origin-tls-kex edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl auto-origin-tls-kex edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(g,{body:t,zone_id:l}));r(n,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=c({enabled:e.enabled}),d=await a(`Updating`,async()=>o.send(g,{body:u,zone_id:l}));r(d,{successLabel:`Updated`})})};var ee={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/auto_origin_tls_kex`};function te(e){return e.usage(`$0 ssl auto-origin-tls-kex get
5
-
6
- When enabled, Cloudflare automatically selects the preferred TLS key-exchange algorithm to use when establishing the TLS connection to the zone's origin, picking from the algorithms permitted by the zone's \`origin_tls_compliance_modes\` setting. When disabled, the default key-exchange ordering is used.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get`,describe:`Get Auto-Origin TLS KEX enrollment status for the given zone`,builder:te,handler:async e=>o({command:`ssl auto-origin-tls-kex get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl auto-origin-tls-kex get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,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(ee,{zone_id:s}));r(c,{successLabel:`Loaded`})})},b={command:`auto-origin-tls-kex`,describe:`Operations for auto-origin-tls-kex`,builder:e=>e.command(v).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/ssl_automatic_mode`};function S(e){return e.usage(`$0 ssl automatic-upgrader get
7
-
8
- If the system is enabled, the response will include next_scheduled_scan, representing the next time this zone will be scanned and the zone's ssl/tls encryption mode is potentially upgraded by the system. If the system is disabled, next_scheduled_scan will not be present in the response body.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Get Automatic SSL/TLS enrollment status for the given zone`,builder:S,handler:async e=>o({command:`ssl automatic-upgrader get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl automatic-upgrader get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ssl_automatic_mode`,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:`PATCH`,path:t=>e`/zones/${t.zone_id}/settings/ssl_automatic_mode`,body:`json`};function T(e){return e.usage(`$0 ssl automatic-upgrader patch
9
-
10
- The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".`).option(`value`,{type:`string`,description:`Controls enablement of Automatic SSL/TLS.`,choices:[`auto`,`custom`]}).coerce(`value`,e=>l(e,`value`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Automatic SSL/TLS.`})}const E={command:`patch`,describe:`Patch Automatic SSL/TLS Enrollment status for given zone`,builder:T,handler:async e=>o({command:`ssl automatic-upgrader patch`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl automatic-upgrader patch`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({value:e.value}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(w,{body:t,zone_id:l}));r(n,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await u(`value`,`Controls enablement of Automatic SSL/TLS.`,[`auto`,`custom`]));let d=c({value:e.value}),f=await a(`Updating`,async()=>o.send(w,{body:d,zone_id:l}));r(f,{successLabel:`Updated`})})},D={command:`automatic-upgrader`,describe:`SSL automatic mode enrollment — get or update automatic SSL/TLS upgrader settings`,builder:e=>e.command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`POST`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs/order`,body:`json`,constants:{type:`advanced`}};function k(e){return e.usage(`$0 ssl certificate-packs create
11
-
12
- For a given zone, order an advanced certificate pack.`).option(`certificate-authority`,{type:`string`,description:`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).coerce(`certificate-authority`,e=>l(e,`certificate-authority`,`text`)).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`hosts`,{type:`string`,array:!0,description:`Comma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty.`}).option(`type`,{type:`string`,description:`Type of certificate pack.`,choices:[`advanced`]}).coerce(`type`,e=>l(e,`type`,`text`)).option(`validation-method`,{type:`string`,description:`Validation Method selected for the order.`,choices:[`txt`,`http`,`email`]}).coerce(`validation-method`,e=>l(e,`validation-method`,`text`)).option(`validity-days`,{type:`number`,description:`Validity Days selected for the order.`}).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 A={command:`create`,describe:`Order Advanced Certificate Manager Certificate Pack`,builder:k,handler:async e=>o({command:`ssl certificate-packs create`,classification:{safeFlags:[`certificate-authority`,`cloudflare-branding`,`type`,`validation-method`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl certificate-packs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/order`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({certificate_authority:e[`certificate-authority`],cloudflare_branding:e[`cloudflare-branding`],hosts:e.hosts,type:e.type,validation_method:e[`validation-method`],validity_days:e[`validity-days`]}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Creating`,async()=>o.send(O,{body:t,zone_id:l}));r(n,{successLabel:`Created`});return}if(e[`certificate-authority`]===void 0&&(e[`certificate-authority`]=await u(`certificate-authority`,`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,[`google`,`lets_encrypt`,`ssl_com`])),e.hosts===void 0)throw Error(`--hosts is required (or pass --body with this field set).`);if(e.type===void 0&&(e.type=await u(`type`,`Type of certificate pack.`,[`advanced`])),e[`validation-method`]===void 0&&(e[`validation-method`]=await u(`validation-method`,`Validation Method selected for the order.`,[`txt`,`http`,`email`])),e[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let d=c({certificate_authority:e[`certificate-authority`],cloudflare_branding:e[`cloudflare-branding`],hosts:e.hosts,type:e.type,validation_method:e[`validation-method`],validity_days:e[`validity-days`]}),f=await a(`Creating`,async()=>o.send(O,{body:d,zone_id:l}));r(f,{successLabel:`Created`})})};var j={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs/${t.certificate_pack_id}`};function M(e){return e.usage(`$0 ssl certificate-packs delete <certificate-pack-id>
13
-
14
- For a given zone, delete an advanced certificate pack.`).positional(`certificate-pack-id`,{type:`string`,description:`The unique identifier for a certificate_pack.`,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 N={command:`delete <certificate-pack-id>`,describe:`Delete Advanced Certificate Manager Certificate Pack`,builder:M,handler:async e=>o({command:`ssl certificate-packs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf ssl certificate-packs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"certificate-pack-id":String(e[`certificate-pack-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await d({force:!!e.force})){process.stderr.write(`Aborted.
15
- `);return}let c=await a(`Deleting`,async()=>o.send(j,{zone_id:s,certificate_pack_id:e[`certificate-pack-id`]}));r(c,{successLabel:`Deleted`})})};var P={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs/${t.certificate_pack_id}`,body:`json`};function F(e){return e.usage(`$0 ssl certificate-packs edit <certificate-pack-id>
16
-
17
- For a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.`).positional(`certificate-pack-id`,{type:`string`,description:`The unique identifier for a certificate_pack.`,demandOption:!0}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).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 I={command:`edit <certificate-pack-id>`,describe:`Restart Validation or Update Advanced Certificate Manager Certificate Pack`,builder:F,handler:async e=>o({command:`ssl certificate-packs edit`,classification:{safeFlags:[`cloudflare-branding`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl certificate-packs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"certificate-pack-id":String(e[`certificate-pack-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({cloudflare_branding:e[`cloudflare-branding`]}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(P,{body:t,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]}));r(n,{successLabel:`Updated`});return}let u=c({cloudflare_branding:e[`cloudflare-branding`]}),d=await a(`Updating`,async()=>o.send(P,{body:u,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]}));r(d,{successLabel:`Updated`})})};var L={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs/${t.certificate_pack_id}`};function R(e){return e.usage(`$0 ssl certificate-packs get <certificate-pack-id>
18
-
19
- For a given zone, get a certificate pack.`).positional(`certificate-pack-id`,{type:`string`,description:`The unique identifier for a certificate_pack.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <certificate-pack-id>`,describe:`Get Certificate Pack`,builder:R,handler:async e=>o({command:`ssl certificate-packs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl certificate-packs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"certificate-pack-id":String(e[`certificate-pack-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,certificate_pack_id:e[`certificate-pack-id`]}));r(c,{successLabel:`Loaded`})})};var B={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs`,query:[`page`,`per_page`,`status`,`deploy`]};function V(e){return e.usage(`$0 ssl certificate-packs list
20
-
21
- For a given zone, list all active certificate packs.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of certificate packs per page.`}).option(`status`,{type:`string`,description:`Include Certificate Packs of all statuses, not just active ones.`,choices:[`all`]}).option(`deploy`,{type:`string`,description:`Specify the deployment environment for the certificate packs.`,choices:[`staging`,`production`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List Certificate Packs`,builder:V,handler:async e=>o({command:`ssl certificate-packs list`,classification:{safeFlags:[`status`,`deploy`,`dry-run`]}},e,async()=>{let o={page:e.page,per_page:e[`per-page`],status:e.status,deploy:e.deploy};if(e.dryRun){i({command:`cf ssl certificate-packs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs`,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(B,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})};var ne={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/certificate_packs/quota`};function U(e){return e.usage(`$0 ssl certificate-packs quota get
22
-
23
- For a given zone, list certificate pack quotas.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:`Get Certificate Pack Quotas`,builder:U,handler:async e=>o({command:`ssl certificate-packs quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl certificate-packs quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/quota`,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(ne,{zone_id:s}));r(c,{successLabel:`Loaded`})})},G={command:`quota`,describe:`Operations for certificate-packs.quota`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`certificate-packs`,describe:`Operations for certificate-packs`,builder:e=>e.command(A).command(N).command(I).command(z).command(H).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/recommendation`};function J(e){return e.usage(`$0 ssl recommendations get
24
-
25
- Retrieve the SSL/TLS Recommender's recommendation for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get`,describe:`SSL/TLS Recommendation`,builder:J,handler:async e=>o({command:`ssl recommendations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl recommendations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/recommendation`,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(q,{zone_id:s}));r(c,{successLabel:`Loaded`})})},X={command:`recommendations`,describe:`Get the recommended SSL/TLS encryption mode based on your origin server's certificate configuration`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/ssl/universal/settings`,body:`json`};function re(e){return e.usage(`$0 ssl universal settings edit
26
-
27
- Patch Universal SSL Settings for a Zone.`).option(`enabled`,{type:`boolean`,description:`Disabling Universal SSL removes any currently active Universal SSL certificates for your zone from the edge and prevents any future Universal SSL certificates from being ordered. If there are no advanced certificates or custom certificates uploaded for the domain, visitors will be unable to access the domain over HTTPS.
28
-
29
- By disabling Universal SSL, you understand that the following Cloudflare settings and preferences will result in visitors being unable to visit your domain unless you have uploaded a custom certificate or purchased an advanced certificate.
30
-
31
- * HSTS
32
- * Always Use HTTPS
33
- * Opportunistic Encryption
34
- * Onion Routing
35
- * Any Page Rules redirecting traffic to HTTPS
36
-
37
- Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy is enabled will result in users being unable to visit your site without a valid certificate at Cloudflare's edge.
38
-
39
- If you do not have a valid custom or advanced certificate at Cloudflare's edge and are unsure if any of the above Cloudflare settings are enabled, or if any HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for your domain.`}).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 ie={command:`edit`,describe:`Edit Universal SSL Settings`,builder:re,handler:async e=>o({command:`ssl universal settings edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl universal settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/universal/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(Z,{body:t,zone_id:l}));r(n,{successLabel:`Updated`});return}let u=c({enabled:e.enabled}),d=await a(`Updating`,async()=>o.send(Z,{body:u,zone_id:l}));r(d,{successLabel:`Updated`})})};var ae={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/universal/settings`};function oe(e){return e.usage(`$0 ssl universal settings get
40
-
41
- Get Universal SSL Settings for a Zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get`,describe:`Universal SSL Settings Details`,builder:oe,handler:async e=>o({command:`ssl universal settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl universal settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/universal/settings`,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(ae,{zone_id:s}));r(c,{successLabel:`Loaded`})})},Q={command:`settings`,describe:`Operations for universal.settings`,builder:e=>e.command(ie).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`universal`,describe:`Operations for universal`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/ssl/verification/${t.certificate_pack_id}`,body:`json`};function le(e){return e.usage(`$0 ssl verification edit <certificate-pack-id>
42
-
43
- Edit SSL validation method for a certificate pack. A PATCH request will request an immediate validation check on any certificate, and return the updated status. If a validation method is provided, the validation will be immediately attempted using that method.`).positional(`certificate-pack-id`,{type:`string`,description:`Certificate Pack UUID.`,demandOption:!0}).option(`validation-method`,{type:`string`,description:`Desired validation method.`,choices:[`http`,`cname`,`txt`,`email`]}).coerce(`validation-method`,e=>l(e,`validation-method`,`text`)).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 ue={command:`edit <certificate-pack-id>`,describe:`Edit SSL Certificate Pack Validation Method`,builder:le,handler:async e=>o({command:`ssl verification edit`,classification:{safeFlags:[`validation-method`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ssl verification edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/verification/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"certificate-pack-id":String(e[`certificate-pack-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({validation_method:e[`validation-method`]}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send($,{body:t,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]}));r(n,{successLabel:`Updated`});return}e[`validation-method`]===void 0&&(e[`validation-method`]=await u(`validation-method`,`Desired validation method.`,[`http`,`cname`,`txt`,`email`]));let d=c({validation_method:e[`validation-method`]}),f=await a(`Updating`,async()=>o.send($,{body:d,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]}));r(f,{successLabel:`Updated`})})};var de={method:`GET`,path:t=>e`/zones/${t.zone_id}/ssl/verification`,query:[`retry`]};function fe(e){return e.usage(`$0 ssl verification get
44
-
45
- Get SSL Verification Info for a Zone.`).option(`retry`,{type:`string`,description:`Immediately retry SSL Verification.`,choices:[`true`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`get`,describe:`SSL Verification Details`,builder:fe,handler:async e=>o({command:`ssl verification get`,classification:{safeFlags:[`retry`,`dry-run`]}},e,async()=>{let o={retry:e.retry};if(e.dryRun){i({command:`cf ssl verification get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/verification`,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(de,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})},me={command:`verification`,describe:`Operations for verification`,builder:e=>e.command(ue).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`ssl`,describe:`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,builder:e=>e.command(h).command(b).command(D).command(K).command(X).command(ce).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{he as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-eVI_UEt8.mjs";import{a as r,t as i}from"./context-B-vEsyrK.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-R-1tIuep.mjs";import{t as c}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/tags/resources`,query:[`type`,`name`,`id`,`case_insensitive`,`tag`,`cursor`]};function u(e){return e.usage(`$0 tags resources list
3
-
4
- Lists all tagged resources for an account.`).option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`name`,{type:`string`,description:`Filter by resource name. Performs a case-insensitive substring match. Example: ?name=my-zone`}).option(`id`,{type:`string`,description:`Filter by resource ID. Can be repeated up to 50 times to filter by multiple IDs. Example: ?id=abc&id=def`}).option(`case-insensitive`,{type:`boolean`,description:"Match `tag` keys and values case-insensitively. Stored casing is unchanged. Example: ?tag=environment=production&case_insensitive=true"}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`List tagged resources`,builder:u,handler:async e=>c({command:`tags resources list`,classification:{safeFlags:[`case-insensitive`,`dry-run`]}},e,async()=>{let c={type:e.type,name:e.name,id:e.id,case_insensitive:e[`case-insensitive`],tag:e.tag,cursor:e.cursor};if(e.dryRun){let e=await r();o({command:`cf tags resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/tags/resources`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})},f={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`tags`,describe:`tags`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./run-BvDCuZ8q.mjs";const e=`unknown command`;export{e as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,r as t}from"./update-check-BlyKN8m0.mjs";export{e as getUpdateNotice,t as maybeStartBackgroundUpdateCheck};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-eVI_UEt8.mjs";import{a as r,t as i}from"./context-B-vEsyrK.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-R-1tIuep.mjs";import{t as c}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/tags/values/${t.tag_key}`,query:[`type`,`cursor`]};function u(e){return e.usage(`$0 values list
3
-
4
- Lists all distinct values for a given tag key, optionally filtered by resource type.`).option(`tag-key`,{type:`string`,description:`The tag key to retrieve values for.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter by resource type.`,choices:/* @__PURE__ */ `access_application.access_application_policy.access_group.access_service_token.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.api_gateway_operation.cloudflared_tunnel.custom_certificate.custom_hostname.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.device.dns_record.durable_object_namespace.gateway_list.gateway_rule.healthcheck.image.infrastructure_target.kv_namespace.load_balancer.load_balancer_monitor.load_balancer_pool.managed_client_certificate.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker.worker_route.worker_version.zone.zone_ruleset`.split(`.`)}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`List tag values`,builder:u,handler:async e=>c({command:`values list`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{let c={type:e.type,cursor:e.cursor};if(e.dryRun){let t=await r();o({command:`cf values list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/tags/values/${e[`tag-key`]==null?`<tag-key>`:encodeURIComponent(String(e[`tag-key`]))}`,pathParams:{"tag-key":String(e[`tag-key`]??``)},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,tag_key:e[`tag-key`],...c}));a(f,{successLabel:`Loaded`})})},f={command:`values`,describe:`values`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- const e=process.env.CLI_VERSION??`1.0.0-beta.16`,t=`cf-cli/${e}`;export{e as n,t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{o as n,s as r}from"./blocks-Bat9A8V_.mjs";import"./ui-BtIBQeaG.mjs";import i from"node:path";import{stat as a}from"node:fs/promises";import{migrateWranglerToCf as o}from"@cloudflare/codemods";const s=[`wrangler.json`,`wrangler.jsonc`,`wrangler.toml`];async function c(e){try{return(await a(e)).isFile()}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return!1;throw e}}async function l(e,{failOnMultiple:t=!0}={}){let n=s.map(t=>i.join(e,t)),r=(await Promise.all(n.map(async e=>({candidate:e,exists:await c(e)})))).filter(({exists:e})=>e).map(({candidate:e})=>e),[a]=r;if(r.length<=1)return a;if(t)throw Error(`Multiple Wrangler configs found in ${e}. Pass the exact path to cf migrate.`)}async function u(e,t=process.cwd()){if(e!==void 0)return i.resolve(t,e);let n=await l(t);if(n!==void 0)return n;throw Error(`No Wrangler config found in ${t}. Pass its path to cf migrate.`)}async function d(e){let{discoverImpls:t}=await import(`./discover-DIDEGKo3.mjs`);return t(i.dirname(e)).some(({impl:e})=>e.pkg===`@cloudflare/vite-plugin`)?`vite`:`wrangler`}function f(e){return e===`silent`?()=>{}:e===`stderr`?console.error:console.log}function p(t,n){if(t.length!==0){n(`\n${e.bold(`Follow-up work:`)}`);for(let[r,i]of t.entries()){let a=r===t.length-1,o=a?`└─`:`├─`,s=i.blocking?e.error(`[required]`):e.info(`[info]`),c=i.sourcePath?`${e.code(i.sourcePath)}: `:``;n(`${e.muted(o)} ${s} ${c}${i.message}`),i.docsUrl&&n(`${e.muted(`${a?` `:`│`} └─`)} ${e.muted(i.docsUrl)}`)}}}function m(t,a,o,s){if(t.changedFiles.length>0){s(e.bold(`${a?`Would update`:`Updated`} ${t.changedFiles.length} file(s):`));for(let[n,r]of t.changedFiles.entries()){let a=n===t.changedFiles.length-1?`└─`:`├─`,c=i.relative(process.cwd(),i.resolve(o,r));s(`${e.muted(a)} ${e.code(c)}`)}}if(p(t.followUps,s),t.status===`needs-intervention`){s(`\n${r(`Migration requires follow-up work.`)}`);return}s(`\n${n(`Migration${a?` preview`:``} complete.`)}`)}async function h(e,n={}){let r=n.dryRun??!1,a=await o(e,{bundler:n.bundler??`vite`,dryRun:r,force:n.force??!1,installDependencies:n.installDependencies??!0});if(m(a,r,i.dirname(e),f(n.output??`stdout`)),a.status===`needs-intervention`)throw new t(1)}async function g(t,n,r=`stdout`,a=!1){let o=await l(t,{failOnMultiple:!1});if(o===void 0)return!1;let s=i.relative(process.cwd(),o)||i.basename(o);return await n(`A Wrangler config was found at ${e.code(s)}. Run cf migrate before continuing?`,{defaultValue:!0,fallbackValue:!1})?(await h(o,{bundler:await d(o),output:r,dryRun:a}),!0):!1}export{h as i,g as n,u as r,d as t};
@@ -1,22 +0,0 @@
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-eVI_UEt8.mjs";import{i as r}from"./context-B-vEsyrK.mjs";import{t as i}from"./output-Co4xdFf6.mjs";import{t as a}from"./dry-run-C2KjGX10.mjs";import{t as o}from"./progress-R-1tIuep.mjs";import{t as s}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";import{n as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d}from"./prompt-dgLm0iFJ.mjs";var f={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/config`};function p(e){return e.usage(`$0 zaraz config get
3
-
4
- Gets latest Zaraz configuration for a zone. It can be preview or published configuration, whichever was the last updated. Secret variables values will not be included.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Get Zaraz configuration`,builder:p,handler:async e=>s({command:`zaraz config get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/config`,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(f,{zone_id:s}));i(c,{successLabel:`Loaded`})})};var h={method:`PUT`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/config`,body:`json`};function g(e){return e.usage(`$0 zaraz config update
5
-
6
- Updates Zaraz configuration for a zone.`).option(`analytics-default-purpose`,{type:`string`,description:`Consent purpose assigned to Monitoring.`}).option(`analytics-enabled`,{type:`boolean`,description:`Whether Advanced Monitoring reports are enabled.`}).option(`analytics-session-exp-time`,{type:`number`,description:`Session expiration time (seconds).`}).option(`consent-company-email`,{type:`string`,description:`The consent.companyEmail field`}).option(`consent-company-name`,{type:`string`,description:`The consent.companyName field`}).option(`consent-company-street-address`,{type:`string`,description:`The consent.companyStreetAddress field`}).option(`consent-consent-modal-intro-html`,{type:`string`,description:`The consent.consentModalIntroHTML field`}).option(`consent-cookie-name`,{type:`string`,description:`The consent.cookieName field`}).option(`consent-custom-css`,{type:`string`,description:`The consent.customCSS field`}).option(`consent-custom-intro-disclaimer-dismissed`,{type:`boolean`,description:`The consent.customIntroDisclaimerDismissed field`}).option(`consent-default-language`,{type:`string`,description:`The consent.defaultLanguage field`}).option(`consent-enabled`,{type:`boolean`,description:`The consent.enabled field`}).option(`consent-hide-modal`,{type:`boolean`,description:`The consent.hideModal field`}).option(`consent-tcf-compliant`,{type:`boolean`,description:`The consent.tcfCompliant field`}).option(`data-layer`,{type:`boolean`,description:`Data layer compatibility mode enabled.`}).option(`debug-key`,{type:`string`,description:`The key for Zaraz debug mode.`}).option(`history-change`,{type:`boolean`,description:`Single Page Application support enabled.`}).option(`settings-auto-inject-script`,{type:`boolean`,description:`Automatic injection of Zaraz scripts enabled.`}).option(`settings-context-enricher-escaped-worker-name`,{type:`string`,description:`The settings.contextEnricher.escapedWorkerName field`}).option(`settings-context-enricher-worker-tag`,{type:`string`,description:`The settings.contextEnricher.workerTag field`}).option(`settings-cookie-domain`,{type:`string`,description:`The domain Zaraz will use for writing and reading its cookies.`}).option(`settings-ecommerce`,{type:`boolean`,description:`Ecommerce API enabled.`}).option(`settings-events-api-path`,{type:`string`,description:`Custom endpoint for server-side track events.`}).option(`settings-hide-external-referer`,{type:`boolean`,description:`Hiding external referrer URL enabled.`}).option(`settings-hide-ipaddress`,{type:`boolean`,description:`Trimming IP address enabled.`}).option(`settings-hide-query-params`,{type:`boolean`,description:`Removing URL query params enabled.`}).option(`settings-hide-user-agent`,{type:`boolean`,description:`Removing sensitive data from User Agent string enabled.`}).option(`settings-init-path`,{type:`string`,description:`Custom endpoint for Zaraz init script.`}).option(`settings-inject-iframes`,{type:`boolean`,description:`Injection of Zaraz scripts into iframes enabled.`}).option(`settings-mc-root-path`,{type:`string`,description:`Custom path for Managed Components server functionalities.`}).option(`settings-script-path`,{type:`string`,description:`Custom endpoint for Zaraz main script.`}).option(`settings-track-path`,{type:`string`,description:`Custom endpoint for Zaraz tracking requests.`}).option(`zaraz-version`,{type:`number`,description:`Zaraz internal version of the config.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz configuration.`}).check(e=>{if([`consent-company-email`,`consent-company-name`,`consent-company-street-address`,`consent-consent-modal-intro-html`,`consent-cookie-name`,`consent-custom-css`,`consent-custom-intro-disclaimer-dismissed`,`consent-default-language`,`consent-enabled`,`consent-hide-modal`,`consent-tcf-compliant`].some(t=>e[t]!==void 0)){let t=[`consent-enabled`].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 --consent-* flag is set`)}return!0})}const _={command:`update`,describe:`Update Zaraz configuration`,builder:g,handler:async e=>s({command:`zaraz config update`,classification:{safeFlags:[`analytics-enabled`,`consent-custom-intro-disclaimer-dismissed`,`consent-enabled`,`consent-hide-modal`,`consent-tcf-compliant`,`data-layer`,`history-change`,`settings-auto-inject-script`,`settings-ecommerce`,`settings-hide-external-referer`,`settings-hide-ipaddress`,`settings-hide-query-params`,`settings-hide-user-agent`,`settings-inject-iframes`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/config`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({analytics:{defaultPurpose:u(e[`analytics-default-purpose`],`analytics-default-purpose`,`text`),enabled:e[`analytics-enabled`],sessionExpTime:e[`analytics-session-exp-time`]},consent:{companyEmail:u(e[`consent-company-email`],`consent-company-email`,`text`),companyName:u(e[`consent-company-name`],`consent-company-name`,`text`),companyStreetAddress:u(e[`consent-company-street-address`],`consent-company-street-address`,`text`),consentModalIntroHTML:u(e[`consent-consent-modal-intro-html`],`consent-consent-modal-intro-html`,`text`),cookieName:u(e[`consent-cookie-name`],`consent-cookie-name`,`text`),customCSS:u(e[`consent-custom-css`],`consent-custom-css`,`text`),customIntroDisclaimerDismissed:e[`consent-custom-intro-disclaimer-dismissed`],defaultLanguage:u(e[`consent-default-language`],`consent-default-language`,`text`),enabled:e[`consent-enabled`],hideModal:e[`consent-hide-modal`],tcfCompliant:e[`consent-tcf-compliant`]},dataLayer:e[`data-layer`],debugKey:u(e[`debug-key`],`debug-key`,`text`),historyChange:e[`history-change`],settings:{autoInjectScript:e[`settings-auto-inject-script`],contextEnricher:{escapedWorkerName:u(e[`settings-context-enricher-escaped-worker-name`],`settings-context-enricher-escaped-worker-name`,`text`),workerTag:u(e[`settings-context-enricher-worker-tag`],`settings-context-enricher-worker-tag`,`text`)},cookieDomain:u(e[`settings-cookie-domain`],`settings-cookie-domain`,`text`),ecommerce:e[`settings-ecommerce`],eventsApiPath:u(e[`settings-events-api-path`],`settings-events-api-path`,`text`),hideExternalReferer:e[`settings-hide-external-referer`],hideIPAddress:e[`settings-hide-ipaddress`],hideQueryParams:e[`settings-hide-query-params`],hideUserAgent:e[`settings-hide-user-agent`],initPath:u(e[`settings-init-path`],`settings-init-path`,`text`),injectIframes:e[`settings-inject-iframes`],mcRootPath:u(e[`settings-mc-root-path`],`settings-mc-root-path`,`text`),scriptPath:u(e[`settings-script-path`],`settings-script-path`,`text`),trackPath:u(e[`settings-track-path`],`settings-track-path`,`text`)},zarazVersion:e[`zaraz-version`]}):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(h,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}if(e[`data-layer`]===void 0)throw Error(`--data-layer is required (or pass --body with this field set).`);if(e[`debug-key`]===void 0&&(e[`debug-key`]=await d(`debug-key`,`The key for Zaraz debug mode.`)),e[`settings-auto-inject-script`]===void 0)throw Error(`--settings-auto-inject-script is required (or pass --body with this field set).`);if(e[`settings-context-enricher-escaped-worker-name`]===void 0&&(e[`settings-context-enricher-escaped-worker-name`]=await d(`settings-context-enricher-escaped-worker-name`,`The settings.contextEnricher.escapedWorkerName field`)),e[`settings-context-enricher-worker-tag`]===void 0&&(e[`settings-context-enricher-worker-tag`]=await d(`settings-context-enricher-worker-tag`,`The settings.contextEnricher.workerTag field`)),e[`zaraz-version`]===void 0)throw Error(`--zaraz-version is required (or pass --body with this field set).`);let f=l({analytics:{defaultPurpose:u(e[`analytics-default-purpose`],`analytics-default-purpose`,`text`),enabled:e[`analytics-enabled`],sessionExpTime:e[`analytics-session-exp-time`]},consent:{companyEmail:u(e[`consent-company-email`],`consent-company-email`,`text`),companyName:u(e[`consent-company-name`],`consent-company-name`,`text`),companyStreetAddress:u(e[`consent-company-street-address`],`consent-company-street-address`,`text`),consentModalIntroHTML:u(e[`consent-consent-modal-intro-html`],`consent-consent-modal-intro-html`,`text`),cookieName:u(e[`consent-cookie-name`],`consent-cookie-name`,`text`),customCSS:u(e[`consent-custom-css`],`consent-custom-css`,`text`),customIntroDisclaimerDismissed:e[`consent-custom-intro-disclaimer-dismissed`],defaultLanguage:u(e[`consent-default-language`],`consent-default-language`,`text`),enabled:e[`consent-enabled`],hideModal:e[`consent-hide-modal`],tcfCompliant:e[`consent-tcf-compliant`]},dataLayer:e[`data-layer`],debugKey:u(e[`debug-key`],`debug-key`,`text`),historyChange:e[`history-change`],settings:{autoInjectScript:e[`settings-auto-inject-script`],contextEnricher:{escapedWorkerName:u(e[`settings-context-enricher-escaped-worker-name`],`settings-context-enricher-escaped-worker-name`,`text`),workerTag:u(e[`settings-context-enricher-worker-tag`],`settings-context-enricher-worker-tag`,`text`)},cookieDomain:u(e[`settings-cookie-domain`],`settings-cookie-domain`,`text`),ecommerce:e[`settings-ecommerce`],eventsApiPath:u(e[`settings-events-api-path`],`settings-events-api-path`,`text`),hideExternalReferer:e[`settings-hide-external-referer`],hideIPAddress:e[`settings-hide-ipaddress`],hideQueryParams:e[`settings-hide-query-params`],hideUserAgent:e[`settings-hide-user-agent`],initPath:u(e[`settings-init-path`],`settings-init-path`,`text`),injectIframes:e[`settings-inject-iframes`],mcRootPath:u(e[`settings-mc-root-path`],`settings-mc-root-path`,`text`),scriptPath:u(e[`settings-script-path`],`settings-script-path`,`text`),trackPath:u(e[`settings-track-path`],`settings-track-path`,`text`)},zarazVersion:e[`zaraz-version`]}),p=await o(`Updating`,async()=>t.send(h,{body:f,zone_id:s}));i(p,{successLabel:`Updated`})})},v={command:`config`,describe:`Full Zaraz configuration including tools, triggers, and variables for the zone`,builder:e=>e.command(m).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/default`};function b(e){return e.usage(`$0 zaraz default get
7
-
8
- Gets default Zaraz configuration for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Get default Zaraz configuration`,builder:b,handler:async e=>s({command:`zaraz default get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/default`,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(y,{zone_id:s}));i(c,{successLabel:`Loaded`})})},S={command:`default`,describe:`Default Zaraz configuration template used as a starting point for new zones`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var C={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/export`};function w(e){return e.usage(`$0 zaraz export get
9
-
10
- Exports full current published Zaraz configuration for a zone, secret variables included.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Export Zaraz configuration`,builder:w,handler:async e=>s({command:`zaraz export get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz export get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/export`,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(C,{zone_id:s}));i(c,{successLabel:`Loaded`})})},E={command:`export`,describe:`Export the current Zaraz configuration as a portable JSON document`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var D={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/history/configs`,query:[`ids`],joined:[`ids`]};function O(e){return e.usage(`$0 zaraz history configs get
11
-
12
- Gets a history of published Zaraz configurations by ID(s) for a zone.`).option(`ids`,{type:`string`,description:`Comma separated list of Zaraz configuration IDs.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Get Zaraz historical configurations by ID(s)`,builder:O,handler:async e=>s({command:`zaraz history configs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={ids:e.ids};if(e.dryRun){a({command:`cf zaraz history configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/history/configs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let s=await n(e),c=await r({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await o(`Loading`,async()=>s.send(D,{zone_id:c,...t}));i(l,{successLabel:`Loaded`})})},A={command:`configs`,describe:`Operations for history.configs`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var j={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/history`,query:[`offset`,`limit`,`sortField`,`sortOrder`]};function M(e){return e.usage(`$0 zaraz history list
13
-
14
- Lists a history of published Zaraz configuration records for a zone.`).option(`offset`,{type:`number`,description:`Ordinal number to start listing the results with. Default value is 0.`}).option(`limit`,{type:`number`,description:`Maximum amount of results to list. Default value is 10.`}).option(`sort-field`,{type:`string`,description:`The field to sort by. Default is updated_at.`,choices:[`id`,`user_id`,`description`,`created_at`,`updated_at`]}).option(`sort-order`,{type:`string`,description:`Sorting order. Default is DESC.`,choices:[`DESC`,`ASC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List Zaraz historical configuration records`,builder:M,handler:async e=>s({command:`zaraz history list`,classification:{safeFlags:[`sort-field`,`sort-order`,`dry-run`]}},e,async()=>{let t={offset:e.offset,limit:e.limit,sortField:e[`sort-field`],sortOrder:e[`sort-order`]};if(e.dryRun){a({command:`cf zaraz history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/history`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let s=await n(e),c=await r({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await o(`Loading`,async()=>s.send(j,{zone_id:c,...t}));i(l,{successLabel:`Loaded`})})};var P={method:`PUT`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/history`,body:`json`};function F(e){return e.usage(`$0 zaraz history update
15
-
16
- Restores a historical published Zaraz configuration by ID for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`ID of the Zaraz configuration to restore.`})}const I={command:`update`,describe:`Restore Zaraz historical configuration by ID`,builder:F,handler:async e=>s({command:`zaraz history update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz history update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/history`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=c(e.body),n=await o(`Updating`,async()=>s.send(P,{body:t,zone_id:l}));i(n,{successLabel:`Updated`});return}let u=await o(`Updating`,async()=>t(s,`PUT`,`/zones/${e.zoneId}/settings/zaraz/history`));i(u,{successLabel:`Updated`})})},L={command:`history`,describe:`Configuration version history — browse and restore previous Zaraz configurations`,builder:e=>e.command(N).command(I).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var R={method:`POST`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/publish`,body:`json`};function z(e){return e.usage(`$0 zaraz publish create
17
-
18
- Publish current Zaraz preview configuration for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz configuration description.`})}const B={command:`create`,describe:`Publish Zaraz preview configuration`,builder:z,handler:async e=>s({command:`zaraz publish create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz publish create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/publish`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=c(e.body),n=await o(`Creating`,async()=>s.send(R,{body:t,zone_id:l}));i(n,{successLabel:`Created`});return}let u=await o(`Creating`,async()=>t(s,`POST`,`/zones/${e.zoneId}/settings/zaraz/publish`));i(u,{successLabel:`Created`})})},V={command:`publish`,describe:`Publish pending Zaraz configuration changes to make them live on the zone`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/workflow`};function U(e){return e.usage(`$0 zaraz workflow get
19
-
20
- Gets Zaraz workflow for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:`Get Zaraz workflow`,builder:U,handler:async e=>s({command:`zaraz workflow get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz workflow get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/workflow`,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(H,{zone_id:s}));i(c,{successLabel:`Loaded`})})};var G={method:`PUT`,path:t=>e`/zones/${t.zone_id}/settings/zaraz/workflow`,body:`json`};function K(e){return e.usage(`$0 zaraz workflow update
21
-
22
- Updates Zaraz workflow for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz workflow.`})}const q={command:`update`,describe:`Update Zaraz workflow`,builder:K,handler:async e=>s({command:`zaraz workflow update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf zaraz workflow update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/zaraz/workflow`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0: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(G,{body:n,zone_id:s}));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.`)})},J={command:`workflow`,describe:`Workflow state for Zaraz configuration changes (draft vs. published)`,builder:e=>e.command(W).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Y={command:`zaraz`,describe:`Server-side tag manager — load third-party tools (analytics, pixels, etc.) from Cloudflare's edge without client-side JS`,builder:e=>e.command(v).command(S).command(E).command(L).command(V).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Y as default};