cf 1.0.0-beta.13 → 1.0.0-beta.14

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 (257) hide show
  1. package/dist/_meta/commands.json +1562 -1776
  2. package/dist/_meta/hand-written-commands.json +342 -22
  3. package/dist/_meta/schemas.json +611 -956
  4. package/dist/abuse-reports-CVv52Q2w.mjs +24 -0
  5. package/dist/access-k1QjF5rE.mjs +2 -0
  6. package/dist/{account-tags-CaXDDeZ4.mjs → account-tags-RhvWOkOf.mjs} +4 -4
  7. package/dist/{accounts-BALwxDQY.mjs → accounts--3lrEkmu.mjs} +9 -15
  8. package/dist/{acm-CP9EaXQN.mjs → acm-BJxINEcu.mjs} +2 -2
  9. package/dist/{addressing-DRlaxqrI.mjs → addressing-BqByG9JW.mjs} +55 -43
  10. package/dist/{agent-memory-vGhlfZBx.mjs → agent-memory-D4dQMGbh.mjs} +2 -2
  11. package/dist/{ai-CJtbWfB9.mjs → ai-CRkQ4pjC.mjs} +1 -1
  12. package/dist/{ai-audit-C0BJNqZZ.mjs → ai-audit-fMSn4c5L.mjs} +1 -1
  13. package/dist/{ai-gateway-BQtv3U3x.mjs → ai-gateway-CbhvQK4L.mjs} +4 -4
  14. package/dist/ai-search-CvVSnOA0.mjs +79 -0
  15. package/dist/{ai-security-CFTaYk_X.mjs → ai-security-Z_qpI92I.mjs} +1 -1
  16. package/dist/{alerting-1hun27JC.mjs → alerting-CpbCB8br.mjs} +3 -3
  17. package/dist/{analytics-DXUSjvzT.mjs → analytics-DkY9dOP1.mjs} +3 -3
  18. package/dist/{analytics_engine-CQsnL09C.mjs → analytics_engine-DE_jvlx_.mjs} +1 -1
  19. package/dist/{api-security-BXhrfR6-.mjs → api-security-BHnOU5MM.mjs} +25 -25
  20. package/dist/{argo-LPUCTnee.mjs → argo-DhC5L_aN.mjs} +3 -3
  21. package/dist/{artifacts-Dt6easua.mjs → artifacts-CrIupY7P.mjs} +3 -3
  22. package/dist/{audit-logs-CVznAM2Z.mjs → audit-logs-BjeBxTox.mjs} +1 -1
  23. package/dist/{auth-eQr-kQCH.mjs → auth-BNYfOMl0.mjs} +1 -1
  24. package/dist/{auth-CGLsxbc6.mjs → auth-CAWalgW0.mjs} +1 -1
  25. package/dist/auth-DOwC01PW.mjs +2 -0
  26. package/dist/{auth-token-pNQrX_9O.mjs → auth-token-Dop0wLCw.mjs} +1 -1
  27. package/dist/{autoconfig-sD7Frryg.mjs → autoconfig-RQ3HS4m1.mjs} +1 -1
  28. package/dist/{basin-catalog-ZQICw-zF.mjs → basin-catalog-DZ7QV-_N.mjs} +3 -3
  29. package/dist/{billing-Dy1-dV_B.mjs → billing-BFyte9fL.mjs} +3 -3
  30. package/dist/bot-management-DXcbV3am.mjs +9 -0
  31. package/dist/{botnet-feed-xb98Cj3Y.mjs → botnet-feed-bGGp_cwX.mjs} +1 -1
  32. package/dist/{brand-protection-Ck3okE2k.mjs → brand-protection-DN36XkxH.mjs} +2 -2
  33. package/dist/{browser-run-DJGJSzFX.mjs → browser-run-hHD1RT43.mjs} +3 -3
  34. package/dist/build-BhpWYgNm.mjs +2 -0
  35. package/dist/{build-HmSXqjGn.mjs → build-CCe7IrWT.mjs} +1 -1
  36. package/dist/{builds-CYxcZtkG.mjs → builds-6aO61R9R.mjs} +4 -4
  37. package/dist/{cache-D9tSfovH.mjs → cache-C5YJpMqi.mjs} +6 -6
  38. package/dist/{certificate-authorities-CpiveTFC.mjs → certificate-authorities-CbqDAktQ.mjs} +1 -1
  39. package/dist/{cf-BxsXrVeh.mjs → cf-oRSQKirD.mjs} +1 -1
  40. package/dist/{chunk-DSGVRFIS-C1_SEtRK.mjs → chunk-DSGVRFIS-CPI5cYtB.mjs} +1 -1
  41. package/dist/{chunk-NDZDTP46-Bjx_wtJe.mjs → chunk-NDZDTP46-Civns3WA.mjs} +1 -1
  42. package/dist/{cli-DeJc9U8z.mjs → cli-ht4q6i2y.mjs} +1 -1
  43. package/dist/{client-certificates-CF6YZyvP.mjs → client-certificates-balaN_my.mjs} +1 -1
  44. package/dist/{client-side-security-BLoe9kS5.mjs → client-side-security-3_4Ermmg.mjs} +3 -3
  45. package/dist/{cloud-connector-DXRUHsjt.mjs → cloud-connector-avx27sLw.mjs} +1 -1
  46. package/dist/{cloudflared--1Ws1RJy.mjs → cloudflared-D83U8Yn3.mjs} +1 -1
  47. package/dist/{cloudforce-one-CBLxXi6v.mjs → cloudforce-one-CXdeqJ9l.mjs} +126 -168
  48. package/dist/{command-Dh7RmjFu.mjs → command-9VAc7b30.mjs} +1 -1
  49. package/dist/{command-Cu7dcaHT.mjs → command-B_Ixlz8Q.mjs} +1 -1
  50. package/dist/{command-oNVwyjGB.mjs → command-BtDY_MKv.mjs} +1 -1
  51. package/dist/{command-CG6RvZs0.mjs → command-CUNMrMou.mjs} +1 -1
  52. package/dist/{command-D3fyhdy-.mjs → command-Ckb9FufU.mjs} +1 -1
  53. package/dist/{command-BDe67N_n.mjs → command-CtVUNm__.mjs} +1 -1
  54. package/dist/{command-DUhX8Dcr.mjs → command-CyJQ40fc.mjs} +1 -1
  55. package/dist/{command-UiHLJ8Ji.mjs → command-DPX9sJVi.mjs} +1 -1
  56. package/dist/{command-BlIb6RR2.mjs → command-DXaRn1ls.mjs} +1 -1
  57. package/dist/{command-CcuLC6CJ.mjs → command-DjEJaOwV.mjs} +1 -1
  58. package/dist/{command-_rqD0hXF.mjs → command-DtgJilOK.mjs} +1 -1
  59. package/dist/{command-BvfKhMl7.mjs → command-OHov3PEc.mjs} +1 -1
  60. package/dist/{command-DwXiDOeH.mjs → command-OWe3v69l.mjs} +1 -1
  61. package/dist/{command-83uVfXh9.mjs → command-SmWD-MeI.mjs} +1 -1
  62. package/dist/{completions-D06AO7A8.mjs → completions-CuqAO3N_.mjs} +1 -1
  63. package/dist/{connector-interrupts-DelTmNyw.mjs → connector-interrupts-ftd10Du-.mjs} +1 -1
  64. package/dist/{connector-telemetry-events-BwxR3G8d.mjs → connector-telemetry-events-TwDZYdEM.mjs} +1 -1
  65. package/dist/{connector-telemetry-snapshots-Bqq-hrpJ.mjs → connector-telemetry-snapshots-CZxkOuC3.mjs} +1 -1
  66. package/dist/{connectors-D-m3rEpk.mjs → connectors-6lVSr-fd.mjs} +1 -1
  67. package/dist/containers-Dqs_ZnO2.mjs +78 -0
  68. package/dist/containers-ncw3bd3a.mjs +376 -0
  69. package/dist/{content-scan-W0BNzbQp.mjs → content-scan-BWFbqfQ0.mjs} +3 -3
  70. package/dist/{context-q7UaYK69.mjs → context-BBLtgdR1.mjs} +1 -1
  71. package/dist/{cps-BZ6hqRb5.mjs → cps-C5phNoVU.mjs} +2 -2
  72. package/dist/{csamScanner-Bo1t3CLh.mjs → csamScanner-BwZNZu0A.mjs} +3 -3
  73. package/dist/{ct-alerting-E03faC7p.mjs → ct-alerting-DPp3qLqO.mjs} +1 -1
  74. package/dist/{custom-certificates-CUySSPzi.mjs → custom-certificates-pfpZcr06.mjs} +5 -5
  75. package/dist/{custom-csrs-gNpWkJPQ.mjs → custom-csrs-DrvGRAkl.mjs} +2 -2
  76. package/dist/{custom-hostnames-abGBAbx7.mjs → custom-hostnames-wGtmFbz1.mjs} +3 -3
  77. package/dist/{custom-nameservers-BgNXol1P.mjs → custom-nameservers-HTG6MPKv.mjs} +1 -1
  78. package/dist/{custom-pages-DMKX3aoD.mjs → custom-pages-DqEHBSVt.mjs} +2 -2
  79. package/dist/d1-EQMUlHTJ.mjs +94 -0
  80. package/dist/{dcv-delegation-B5YUEWu0.mjs → dcv-delegation-D6nj0Z5N.mjs} +1 -1
  81. package/dist/{deploy-CWNm1-5v.mjs → deploy-B22sEVHd.mjs} +1 -1
  82. package/dist/{deploy-context-Dr6bxNcB.mjs → deploy-context-DmG9rgPO.mjs} +1 -1
  83. package/dist/{deploy-input-Cc0_2QlW.mjs → deploy-input-BCjcuP6u.mjs} +1 -1
  84. package/dist/{dev-ZA8itQE7.mjs → dev-ClhhXuNU.mjs} +1 -1
  85. package/dist/diagnostics-tqHjq-Pl.mjs +15 -0
  86. package/dist/dist-DmRM6WSZ.mjs +449 -0
  87. package/dist/{dls-DIl16mLp.mjs → dls-BEHj4X9T.mjs} +1 -1
  88. package/dist/{dns-firewall-BZwJXHLj.mjs → dns-firewall-zwbkutyf.mjs} +1 -1
  89. package/dist/{dns-QUpgljRG.mjs → dns-n4mfYBZg.mjs} +3 -3
  90. package/dist/{durable-objects-BCj4ykpU.mjs → durable-objects-CQ2dHhho.mjs} +1 -1
  91. package/dist/{email-auth-DlHIYhCk.mjs → email-auth-DOi6yOt3.mjs} +1 -1
  92. package/dist/{email-routing-UKVS4DYy.mjs → email-routing-WcSPt22u.mjs} +5 -5
  93. package/dist/{email-security-CZjfRIg0.mjs → email-security-BXu3OGay.mjs} +15 -15
  94. package/dist/{email-sending-Dquc880C.mjs → email-sending-B9zTlIjt.mjs} +2 -2
  95. package/dist/{fieldExtractors-BbwDRquU.mjs → fieldExtractors-B37m2lKW.mjs} +1 -1
  96. package/dist/{firewall--mTfDnCJ.mjs → firewall-CRtYO0Ha.mjs} +5 -5
  97. package/dist/{flagship-cfoSwwM9.mjs → flagship-DvTFZSay.mjs} +3 -3
  98. package/dist/{fraud-Dcsq3EYK.mjs → fraud-uSyibsit.mjs} +5 -5
  99. package/dist/{google-tag-gateway-DPKSkZQi.mjs → google-tag-gateway-BFXiiokq.mjs} +1 -1
  100. package/dist/hand-written-dry-run-B82fRl2N.mjs +2 -0
  101. package/dist/{healthchecks-D78hIIBC.mjs → healthchecks-27u7b7Jb.mjs} +5 -5
  102. package/dist/{hostnames-sF999-6H.mjs → hostnames-DvaUSzsj.mjs} +1 -1
  103. package/dist/hyperdrive-BzJvPdu6.mjs +37 -0
  104. package/dist/{iam-Bvg_PayW.mjs → iam-Dl3cU9GI.mjs} +1 -1
  105. package/dist/{images-DI_lEZ4L.mjs → images-C2OkI1j7.mjs} +6 -6
  106. package/dist/index.mjs +1 -1
  107. package/dist/{init-1w_mcgk3.mjs → init-Da8pe296.mjs} +1 -1
  108. package/dist/{intel-BxElBUMP.mjs → intel-DoB1g_K7.mjs} +2 -2
  109. package/dist/{ips-DWoaKxi7.mjs → ips-BRt68epr.mjs} +1 -1
  110. package/dist/{k2-tFjaftl-.mjs → k2-_eq5ZY2t.mjs} +1 -1
  111. package/dist/{keyless-certificates-BrvxHU4J.mjs → keyless-certificates-DaO2yqYu.mjs} +2 -2
  112. package/dist/{keys-DcwTYKRf.mjs → keys-7BQ3Zq6Y.mjs} +1 -1
  113. package/dist/{kv-htXS-7uP.mjs → kv-BTYCXKML.mjs} +4 -4
  114. package/dist/{lazy-command-BDiIwpss.mjs → lazy-command-CDWwCsD2.mjs} +1 -1
  115. package/dist/{leaked-credential-checks-bvGrLOmQ.mjs → leaked-credential-checks-CPHOK_dE.mjs} +1 -1
  116. package/dist/load-balancers-Bu9pd2SV.mjs +76 -0
  117. package/dist/{local-DlT72Xpn.mjs → local-BcPM4I0s.mjs} +1 -1
  118. package/dist/local-BundUuDT.mjs +2 -0
  119. package/dist/{local-runtime-CokO6qaX.mjs → local-runtime-BHKyRlCP.mjs} +1 -1
  120. package/dist/{login-Ccw-mYwT.mjs → login-BBYC_BtH.mjs} +1 -1
  121. package/dist/{login-BGF_I_LT.mjs → login-D2uoWhWh.mjs} +1 -1
  122. package/dist/{logo-matches-tE8LTKgg.mjs → logo-matches-Bc1DQ4-g.mjs} +1 -1
  123. package/dist/{logos-Bj845Mcw.mjs → logos-X5B8z7Iv.mjs} +1 -1
  124. package/dist/{logpush-Cs8JdvKi.mjs → logpush-C2ENi1et.mjs} +3 -3
  125. package/dist/{logs-C92XZvNu.mjs → logs-BKDz7kBW.mjs} +1 -1
  126. package/dist/{magic-cloud-networking-hNp5MMw-.mjs → magic-cloud-networking-B60Gld8A.mjs} +6 -6
  127. package/dist/{magic-network-monitoring-68GuWAnv.mjs → magic-network-monitoring-CxXI3Y-H.mjs} +4 -4
  128. package/dist/{magic-transit-DNd7gu4j.mjs → magic-transit-ZCSaCbl8.mjs} +171 -168
  129. package/dist/{managed-defense-B_wCAuFD.mjs → managed-defense-DrxMb7xi.mjs} +1 -1
  130. package/dist/{managed-transforms-DZdxHPOh.mjs → managed-transforms-AI7KrRU1.mjs} +1 -1
  131. package/dist/{matches-B65CkflD.mjs → matches-rPMLS3Ip.mjs} +1 -1
  132. package/dist/{mcp-DrJW5ayK.mjs → mcp-DXUMvEWt.mjs} +4 -4
  133. package/dist/{mesh-DfVzYTn1.mjs → mesh-MmBCQ37q.mjs} +2 -2
  134. package/dist/{monetization-BGaI8CMO.mjs → monetization-DQE5VtUO.mjs} +2 -2
  135. package/dist/{mtls-certificates-BsU2emDD.mjs → mtls-certificates-DwkEb-Hy.mjs} +1 -1
  136. package/dist/{network-BEMD8P0U.mjs → network-BcfobxQY.mjs} +1 -1
  137. package/dist/{network-interconnects-DMu_fcbo.mjs → network-interconnects-BU3tN_Ab.mjs} +10 -6
  138. package/dist/{o11y-C1a4gDGF.mjs → o11y-BBv7nedp.mjs} +13 -13
  139. package/dist/{oauth-Bj5Ne1o8.mjs → oauth-BUr8bPwo.mjs} +1 -1
  140. package/dist/{oauth-clients-p4Etdqy_.mjs → oauth-clients-qWVImhHE.mjs} +3 -3
  141. package/dist/{oauth-mspHHU5U.mjs → oauth-n8um6MFk.mjs} +1 -1
  142. package/dist/{oauth-scopes-B2IabFza.mjs → oauth-scopes-CdeIgJIx.mjs} +1 -1
  143. package/dist/organization-CJeOVWH7.mjs +71 -0
  144. package/dist/{organizations-5S6xEp7T.mjs → organizations-BpfoqZcG.mjs} +1 -1
  145. package/dist/{origin-ca-certificates-_VJAoK1D.mjs → origin-ca-certificates-Bimf07RF.mjs} +2 -2
  146. package/dist/{origin-post-quantum-encryption-GcldDsT2.mjs → origin-post-quantum-encryption-CM-If38w.mjs} +2 -2
  147. package/dist/{origin-tls-client-auth-DZHld9fA.mjs → origin-tls-client-auth-BPwYPhc9.mjs} +1 -1
  148. package/dist/{page-rules-o1tAMMsD.mjs → page-rules-DOeekMrj.mjs} +4 -4
  149. package/dist/pages-Bn0Sg1ay.mjs +54 -0
  150. package/dist/{pay-per-crawl-BsnOxGYU.mjs → pay-per-crawl-qJpseNNx.mjs} +1 -1
  151. package/dist/{pay-per-use-BXWMCSyE.mjs → pay-per-use-C1MWKJ4O.mjs} +3 -3
  152. package/dist/pipelines-rCwXQw6S.mjs +44 -0
  153. package/dist/{precursor-B6DjBib6.mjs → precursor-Bk8Pp6jT.mjs} +2 -2
  154. package/dist/previews-BEheHO3T.mjs +4 -0
  155. package/dist/{progress-BtkTVcHI.mjs → progress-CQqDtgmF.mjs} +1 -1
  156. package/dist/{prompt-RlgRrmbm.mjs → prompt-C8FyienX.mjs} +1 -1
  157. package/dist/{queries-yLwoJRHV.mjs → queries-DJ8looyq.mjs} +1 -1
  158. package/dist/{queues-CnJRaE1o.mjs → queues-BBH9Q-Tt.mjs} +7 -7
  159. package/dist/{r2-CuC6-zQX.mjs → r2-CdJKpP2w.mjs} +13 -13
  160. package/dist/{radar-DrQLcbkq.mjs → radar-CdvQL4xm.mjs} +1 -1
  161. package/dist/raw-fetch-DbXN3SlE.mjs +2 -0
  162. package/dist/{realtime-CjsnzHxD.mjs → realtime-onrXppzh.mjs} +9 -9
  163. package/dist/{registrar-BgOsxTnX.mjs → registrar-CbEBc5IE.mjs} +2 -2
  164. package/dist/{registrar-sandbox-3ikBD9fB.mjs → registrar-sandbox-BJhn1HFT.mjs} +3 -3
  165. package/dist/{registry-CHowrQsZ.mjs → registry-PI6sO95I.mjs} +1 -1
  166. package/dist/{reporting-hE127s5r.mjs → reporting-bXZY6obP.mjs} +1 -1
  167. package/dist/{request-headers-DiJeDAn1.mjs → request-headers-D8L95bEQ.mjs} +1 -1
  168. package/dist/{request-tracers-BCwLxmPN.mjs → request-tracers-CihskC2A.mjs} +1 -1
  169. package/dist/{resource-sharing-2qvWUuMa.mjs → resource-sharing-DDqcCHVs.mjs} +2 -2
  170. package/dist/{resource-tagging-Dwx7iL3v.mjs → resource-tagging-D63RpBce.mjs} +1 -1
  171. package/dist/{rules-DxVQ6jIg.mjs → rules-CAW0-Wde.mjs} +1 -1
  172. package/dist/{rulesets-Cdh8YjI9.mjs → rulesets-CPir63Qc.mjs} +3 -3
  173. package/dist/{rum-a4CMq4Qu.mjs → rum-BfwTcuup.mjs} +1 -1
  174. package/dist/{run-BvHwWWUX.mjs → run-CW2Cgi0S.mjs} +1 -1
  175. package/dist/run-DEynXvCc.mjs +2 -0
  176. package/dist/{schema-flags-BzoBGPWk.mjs → schema-flags-BTItUu1K.mjs} +1 -1
  177. package/dist/{scim-B8XlXl8v.mjs → scim-CtZ1FeQE.mjs} +1 -1
  178. package/dist/{secrets-store-Cqhedh_i.mjs → secrets-store-BIuBYUJT.mjs} +1 -1
  179. package/dist/{security-insights-le2-DteL.mjs → security-insights-DfUus0bs.mjs} +3 -3
  180. package/dist/{security-txt-cCArWXur.mjs → security-txt-CgZOsAIZ.mjs} +1 -1
  181. package/dist/{session-C1BhT1ZJ.mjs → session-BcM8Vyyx.mjs} +1 -1
  182. package/dist/{shared-BPjcpXuA.mjs → shared-CpS23WwR.mjs} +1 -1
  183. package/dist/{smart-shield-Csyh8hwB.mjs → smart-shield-ClgB7r-9.mjs} +5 -5
  184. package/dist/{snippets-DUWx25q6.mjs → snippets-DLO3iFAg.mjs} +1 -1
  185. package/dist/{spawn-IysxuTNW.mjs → spawn-D07wH-MH.mjs} +1 -1
  186. package/dist/{spectrum-Da3UYSOR.mjs → spectrum-B6qkjR_Z.mjs} +5 -5
  187. package/dist/{speed-NxlMnB2e.mjs → speed-DX5X2EIR.mjs} +1 -1
  188. package/dist/sql-CF044HDW.mjs +4 -0
  189. package/dist/src-BMATTZU_.mjs +125 -0
  190. package/dist/{ssl-BtaX2WEJ.mjs → ssl-CM-rChEC.mjs} +5 -5
  191. package/dist/{startup-profile-CdJWgNjd.mjs → startup-profile-CrtCP-6-.mjs} +1 -1
  192. package/dist/startup-profile-D662WI9s.mjs +2 -0
  193. package/dist/state-D7uNYnoi.mjs +2 -0
  194. package/dist/{state-BDSvdSdP.mjs → state-DIiIGEtR.mjs} +1 -1
  195. package/dist/{stream-C1Ijjzn4.mjs → stream-5EmUOQvy.mjs} +3 -3
  196. package/dist/{submit-MdkuU_Pt.mjs → submit-lEAaRSMR.mjs} +1 -1
  197. package/dist/{tags-CA1xMM96.mjs → tags-CX23P4jg.mjs} +1 -1
  198. package/dist/telemetry-0Y5hAtCX.mjs +2 -0
  199. package/dist/{telemetry-Cm39QJ-M.mjs → telemetry-ZlCi5Xhc.mjs} +1 -1
  200. package/dist/{tenant-BB6Oszcl.mjs → tenant-DnI7QziH.mjs} +1 -1
  201. package/dist/{tenant-custom-nameservers-BsbgYAEo.mjs → tenant-custom-nameservers-MR0dlcGm.mjs} +1 -1
  202. package/dist/{tunnels-CRFtyHWz.mjs → tunnels-NzYpsfi_.mjs} +15 -15
  203. package/dist/{turnstile-DBXWo_Xe.mjs → turnstile-M7sKCEz3.mjs} +11 -11
  204. package/dist/{update-check-CMXSdres.mjs → update-check-HFkPml6x.mjs} +1 -1
  205. package/dist/update-check-aTutXNRd.mjs +2 -0
  206. package/dist/update-check-worker.mjs +1 -1
  207. package/dist/{url-info-t-XAs0Mk.mjs → url-info-Dos9VOXV.mjs} +1 -1
  208. package/dist/{url-normalization-Cs4F8e0a.mjs → url-normalization-CZbFOq_v.mjs} +2 -2
  209. package/dist/{url-scanner-CBIoDbTx.mjs → url-scanner-B7quLPGW.mjs} +2 -2
  210. package/dist/{user-CevdOMoa.mjs → user-rXca0J9M.mjs} +12 -12
  211. package/dist/{values-CjNlkbIh.mjs → values-D-rrZrDa.mjs} +1 -1
  212. package/dist/{vectorize-9d9tPmg5.mjs → vectorize-D2tf_oA8.mjs} +4 -4
  213. package/dist/version-BGnqDvNR.mjs +2 -0
  214. package/dist/waiting-rooms-DrA3-0bw.mjs +53 -0
  215. package/dist/{web-assets-BHot_MU8.mjs → web-assets-DQAfvPT9.mjs} +3 -3
  216. package/dist/{web3-CYfWAF6b.mjs → web3-MI0GQDnu.mjs} +5 -5
  217. package/dist/workers-By6Pf8fv.mjs +40 -0
  218. package/dist/{workers-builds-Dw7ho3So.mjs → workers-builds-6YsWsCmC.mjs} +2 -2
  219. package/dist/{workers-for-platforms-A3yjyLh3.mjs → workers-for-platforms-DL8fC1qR.mjs} +2 -2
  220. package/dist/workers-vpc-BYx6sbgd.mjs +13 -0
  221. package/dist/workflows-ByQLnV0E.mjs +52 -0
  222. package/dist/{zaraz-BsD2dMI3.mjs → zaraz-CgbpmA85.mjs} +1 -1
  223. package/dist/{zero-trust-CA3iGQbG.mjs → zero-trust-CpjTkkWt.mjs} +42 -42
  224. package/dist/{zone-D2M4EZD0.mjs → zone-DnKIe6po.mjs} +1 -1
  225. package/dist/{zones-BoOC_JzC.mjs → zones--5ZzsDmQ.mjs} +15 -15
  226. package/package.json +12 -12
  227. package/dist/abuse-reports-BjU1s8cf.mjs +0 -24
  228. package/dist/access-C_G2MZnA.mjs +0 -2
  229. package/dist/ai-search-DGU1Y5By.mjs +0 -79
  230. package/dist/auth-CrmVwfpJ.mjs +0 -2
  231. package/dist/bot-management-DTgPwL7O.mjs +0 -9
  232. package/dist/build-B1L6xrgC.mjs +0 -2
  233. package/dist/containers-CVNfEjJs.mjs +0 -78
  234. package/dist/containers-DeoZyeQe.mjs +0 -375
  235. package/dist/d1-CE08YqYk.mjs +0 -93
  236. package/dist/diagnostics-UMbG6m4n.mjs +0 -15
  237. package/dist/dist-BHEmAAHr.mjs +0 -487
  238. package/dist/hyperdrive-qWACKfA4.mjs +0 -37
  239. package/dist/load-balancers-BNTUt4yG.mjs +0 -76
  240. package/dist/local-DlDumOSC.mjs +0 -2
  241. package/dist/organization-CdXt7AVZ.mjs +0 -75
  242. package/dist/pages-CmiOhjSl.mjs +0 -54
  243. package/dist/pipelines-DWLQC0F6.mjs +0 -44
  244. package/dist/previews-dUKEBGSM.mjs +0 -4
  245. package/dist/raw-fetch-B4NvWuZD.mjs +0 -2
  246. package/dist/run-CkbrPJPx.mjs +0 -2
  247. package/dist/sql-CNdHAlQ8.mjs +0 -4
  248. package/dist/src-JfLDUxFr.mjs +0 -125
  249. package/dist/startup-profile-B2l0ChVu.mjs +0 -2
  250. package/dist/state-JB4_BU1o.mjs +0 -2
  251. package/dist/telemetry-BsYO3nxG.mjs +0 -2
  252. package/dist/update-check-C2oVEbXx.mjs +0 -2
  253. package/dist/version-BdVUXLnK.mjs +0 -2
  254. package/dist/waiting-rooms--5WmrWb3.mjs +0 -53
  255. package/dist/workers-S17M0n3h.mjs +0 -40
  256. package/dist/workers-vpc-BZ2xXtC3.mjs +0 -13
  257. package/dist/workflows-BgGrVpSR.mjs +0 -43
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t,t as n}from"./local-DlT72Xpn.mjs";import{a as r,i,n as a}from"./auth-CGLsxbc6.mjs";import{a as o,t as s}from"./context-q7UaYK69.mjs";import{t as c}from"./output-BOe-3AQG.mjs";import{t as l}from"./dry-run-DRj2_uV3.mjs";import{t as u}from"./progress-BtkTVcHI.mjs";import{n as d,t as f}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{i as p,n as m,r as h,t as g}from"./body-parser-DkHKPkJ7.mjs";import{n as _}from"./input-validation-D7z60HJH.mjs";import{a as ee,i as v,n as te,o as y,r as b}from"./prompt-RlgRrmbm.mjs";import{t as x}from"./cli-types-9oYmRTHJ.mjs";import{_ as S,a as C,c as ne,d as w,g as T,h as E,i as D,m as O,o as k,p as A,r as j,s as M,t as N,u as re}from"./schema-flags-BzoBGPWk.mjs";import{domainToASCII as ie}from"node:url";import{isDeepStrictEqual as ae}from"node:util";function oe(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 se={command:`get <extension>`,describe:`Get extension`,builder:oe,handler:async e=>f({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.extensions.get({account_id:r,extension:e.extension}));c(i,{successLabel:`Loaded`})})};function ce(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\`.
2
+ import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t,t as n}from"./local-BcPM4I0s.mjs";import{a as r,i,n as a}from"./auth-CAWalgW0.mjs";import{a as o,t as s}from"./context-BBLtgdR1.mjs";import{t as c}from"./output-BOe-3AQG.mjs";import{t as l}from"./dry-run-DRj2_uV3.mjs";import{t as u}from"./progress-CQqDtgmF.mjs";import{n as d,t as f}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{i as p,n as m,r as h,t as g}from"./body-parser-DkHKPkJ7.mjs";import{n as _}from"./input-validation-D7z60HJH.mjs";import{a as ee,i as v,n as te,o as y,r as b}from"./prompt-C8FyienX.mjs";import{t as x}from"./cli-types-9oYmRTHJ.mjs";import{_ as S,a as C,c as ne,d as w,g as T,h as E,i as D,m as O,o as k,p as A,r as j,s as M,t as N,u as re}from"./schema-flags-BTItUu1K.mjs";import{domainToASCII as ie}from"node:url";import{isDeepStrictEqual as ae}from"node:util";function oe(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 se={command:`get <extension>`,describe:`Get extension`,builder:oe,handler:async e=>f({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.extensions.get({account_id:r,extension:e.extension}));c(i,{successLabel:`Loaded`})})};function ce(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
3
  Pass this value to fetch the next page of results. Omit (or
4
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 le={command:`list`,describe:`List extensions`,builder:x(ce),handler:async e=>f({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 o();l({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 r=await a(e),i=e.local?n:await s();e.accountId=i;let d=await u(`Loading`,async()=>r.registrar.extensions.list({account_id:i,...t}));c(d,{successLabel:`Loaded`})})},ue={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(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 fe={command:`check <domains...>`,describe:`Check domain availability`,builder:de,handler:async e=>f({command:`registrar registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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?g({domains:e.domains}):m(e.body)});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,e.body){let n=m(e.body),i=await u(`Creating`,async()=>t.registrar.registrations.check({...n,account_id:r}));c(i,{successLabel:`Created`});return}let i=g({domains:e.domains}),d=await u(`Creating`,async()=>t.registrar.registrations.check({...i,account_id:r}));c(d,{successLabel:`Created`})})};function pe(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 me={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:pe,handler:async e=>f({command:`registrar registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.registrations.getRegistrationStatus({account_id:r,domain_name:e[`domain-name`]}));c(i,{successLabel:`Loaded`})})};function he(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 ge={command:`get-transfer-status <domain-name>`,describe:`Get Transfer Status`,builder:he,handler:async e=>f({command:`registrar registrations get-transfer-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.registrations.getTransferStatus({account_id:r,domain_name:e[`domain-name`]}));c(i,{successLabel:`Loaded`})})};function _e(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 ve={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:_e,handler:async e=>f({command:`registrar registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.registrations.getUpdateStatus({account_id:r,domain_name:e[`domain-name`]}));c(i,{successLabel:`Loaded`})})};function ye(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 be={command:`get <domain-name>`,describe:`Get Registration`,builder:ye,handler:async e=>f({command:`registrar registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({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 a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.registrar.registrations.get({account_id:r,domain_name:e[`domain-name`]}));c(i,{successLabel:`Loaded`})})};function xe(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
5
  Pass this value to fetch the next page of results. Omit (or
@@ -32,7 +32,7 @@ and renewal notices.
32
32
  Most registrations do not require a fax number.
33
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
34
  the extension's default privacy mode (typically \`redaction\`).
35
- `,choices:[`off`,`redaction`]}).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 Oe={command:`transfer-in <domain-name>`,describe:`Initiate Transfer`,builder:De,handler:async e=>f({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 o();l({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?g({auth_code:_(e[`auth-code`],`auth-code`,`text`),auto_renew:e[`auto-renew`],contacts:{administrator:{email:_(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:_(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:_(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:_(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:_(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:_(e[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:_(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:_(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:_(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:_(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:_(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:_(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:_(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:_(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:_(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:_(e[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:_(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:_(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:_(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:_(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},privacy_mode:_(e[`privacy-mode`],`privacy-mode`,`text`)}):m(e.body)});return}let r=await a(e),d=e.local?n:await s();if(e.accountId=d,e.body){let n=m(e.body),a=await u(`Creating`,async()=>i(r,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:n,headers:Object.keys(t).length>0?t:void 0}));c(a,{successLabel:`Created`});return}let f={};e[`auth-code`]!==void 0&&p(f,[`auth_code`],_(e[`auth-code`],`auth-code`,`text`)),e[`auto-renew`]!==void 0&&p(f,[`auto_renew`],e[`auto-renew`]),e[`contacts-administrator-email`]!==void 0&&p(f,[`contacts`,`administrator`,`email`],_(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),e[`contacts-administrator-fax`]!==void 0&&p(f,[`contacts`,`administrator`,`fax`],_(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),e[`contacts-administrator-phone`]!==void 0&&p(f,[`contacts`,`administrator`,`phone`],_(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),e[`contacts-administrator-postal-info-name`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`name`],_(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),e[`contacts-administrator-postal-info-organization`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`organization`],_(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),e[`contacts-billing-email`]!==void 0&&p(f,[`contacts`,`billing`,`email`],_(e[`contacts-billing-email`],`contacts-billing-email`,`text`)),e[`contacts-billing-fax`]!==void 0&&p(f,[`contacts`,`billing`,`fax`],_(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),e[`contacts-billing-phone`]!==void 0&&p(f,[`contacts`,`billing`,`phone`],_(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),e[`contacts-billing-postal-info-name`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`name`],_(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),e[`contacts-billing-postal-info-organization`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`organization`],_(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),e[`contacts-registrant-email`]!==void 0&&p(f,[`contacts`,`registrant`,`email`],_(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),e[`contacts-registrant-fax`]!==void 0&&p(f,[`contacts`,`registrant`,`fax`],_(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),e[`contacts-registrant-phone`]!==void 0&&p(f,[`contacts`,`registrant`,`phone`],_(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),e[`contacts-registrant-postal-info-name`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`name`],_(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),e[`contacts-registrant-postal-info-organization`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`organization`],_(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),e[`contacts-technical-email`]!==void 0&&p(f,[`contacts`,`technical`,`email`],_(e[`contacts-technical-email`],`contacts-technical-email`,`text`)),e[`contacts-technical-fax`]!==void 0&&p(f,[`contacts`,`technical`,`fax`],_(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),e[`contacts-technical-phone`]!==void 0&&p(f,[`contacts`,`technical`,`phone`],_(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),e[`contacts-technical-postal-info-name`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`name`],_(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),e[`contacts-technical-postal-info-organization`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`organization`],_(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),e[`privacy-mode`]!==void 0&&p(f,[`privacy_mode`],_(e[`privacy-mode`],`privacy-mode`,`text`));let h=await u(`Creating`,async()=>i(r,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:Object.keys(f).length>0?f:void 0,headers:Object.keys(t).length>0?t:void 0}));c(h,{successLabel:`Created`})})};function ke(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.
35
+ `,choices:[`off`,`redaction`]}).coerce(`privacy-mode`,e=>_(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 Oe={command:`transfer-in <domain-name>`,describe:`Initiate Transfer`,builder:De,handler:async e=>f({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 o();l({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?g({auth_code:_(e[`auth-code`],`auth-code`,`text`),auto_renew:e[`auto-renew`],contacts:{administrator:{email:_(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:_(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:_(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:_(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:_(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:_(e[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:_(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:_(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:_(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:_(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:_(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:_(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:_(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:_(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:_(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:_(e[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:_(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:_(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:_(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:_(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},privacy_mode:e[`privacy-mode`]}):m(e.body)});return}let r=await a(e),d=e.local?n:await s();if(e.accountId=d,e.body){let n=m(e.body),a=await u(`Creating`,async()=>i(r,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:n,headers:Object.keys(t).length>0?t:void 0}));c(a,{successLabel:`Created`});return}let f={};e[`auth-code`]!==void 0&&p(f,[`auth_code`],_(e[`auth-code`],`auth-code`,`text`)),e[`auto-renew`]!==void 0&&p(f,[`auto_renew`],e[`auto-renew`]),e[`contacts-administrator-email`]!==void 0&&p(f,[`contacts`,`administrator`,`email`],_(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),e[`contacts-administrator-fax`]!==void 0&&p(f,[`contacts`,`administrator`,`fax`],_(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),e[`contacts-administrator-phone`]!==void 0&&p(f,[`contacts`,`administrator`,`phone`],_(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),e[`contacts-administrator-postal-info-name`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`name`],_(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),e[`contacts-administrator-postal-info-organization`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`organization`],_(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),e[`contacts-billing-email`]!==void 0&&p(f,[`contacts`,`billing`,`email`],_(e[`contacts-billing-email`],`contacts-billing-email`,`text`)),e[`contacts-billing-fax`]!==void 0&&p(f,[`contacts`,`billing`,`fax`],_(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),e[`contacts-billing-phone`]!==void 0&&p(f,[`contacts`,`billing`,`phone`],_(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),e[`contacts-billing-postal-info-name`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`name`],_(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),e[`contacts-billing-postal-info-organization`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`organization`],_(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),e[`contacts-registrant-email`]!==void 0&&p(f,[`contacts`,`registrant`,`email`],_(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),e[`contacts-registrant-fax`]!==void 0&&p(f,[`contacts`,`registrant`,`fax`],_(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),e[`contacts-registrant-phone`]!==void 0&&p(f,[`contacts`,`registrant`,`phone`],_(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),e[`contacts-registrant-postal-info-name`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`name`],_(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),e[`contacts-registrant-postal-info-organization`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`organization`],_(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),e[`contacts-technical-email`]!==void 0&&p(f,[`contacts`,`technical`,`email`],_(e[`contacts-technical-email`],`contacts-technical-email`,`text`)),e[`contacts-technical-fax`]!==void 0&&p(f,[`contacts`,`technical`,`fax`],_(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),e[`contacts-technical-phone`]!==void 0&&p(f,[`contacts`,`technical`,`phone`],_(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),e[`contacts-technical-postal-info-name`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`name`],_(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),e[`contacts-technical-postal-info-organization`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`organization`],_(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),e[`privacy-mode`]!==void 0&&p(f,[`privacy_mode`],e[`privacy-mode`]);let h=await u(`Creating`,async()=>i(r,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:Object.keys(f).length>0?f:void 0,headers:Object.keys(t).length>0?t:void 0}));c(h,{successLabel:`Created`})})};function ke(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
36
  Setting this field to \`true\` authorizes Cloudflare to charge the
37
37
  account's default payment method up to 30 days before domain expiry
38
38
  to renew the domain automatically. Renewal pricing may change over
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{i as t,n}from"./auth-CGLsxbc6.mjs";import{a as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{i as l,n as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p}from"./prompt-RlgRrmbm.mjs";import{t as m}from"./cli-types-9oYmRTHJ.mjs";function h(e){return e.usage("$0 registrar-sandbox 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 g={command:`get <extension>`,describe:`Get extension`,builder:h,handler:async t=>c({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/extensions/${t.extension==null?`<extension>`:encodeURIComponent(String(t.extension))}`,pathParams:{extension:String(t.extension??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:t.extension}));a(u,{successLabel:`Loaded`})})};function _(e){return e.usage("$0 registrar-sandbox 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\`.
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{i as t,n}from"./auth-CAWalgW0.mjs";import{a as r,t as i}from"./context-BBLtgdR1.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-CQqDtgmF.mjs";import{t as c}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{i as l,n as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p}from"./prompt-C8FyienX.mjs";import{t as m}from"./cli-types-9oYmRTHJ.mjs";function h(e){return e.usage("$0 registrar-sandbox 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 g={command:`get <extension>`,describe:`Get extension`,builder:h,handler:async t=>c({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/extensions/${t.extension==null?`<extension>`:encodeURIComponent(String(t.extension))}`,pathParams:{extension:String(t.extension??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:t.extension}));a(u,{successLabel:`Loaded`})})};function _(e){return e.usage("$0 registrar-sandbox 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
3
  Pass this value to fetch the next page of results. Omit (or
4
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 v={command:`list`,describe:`List extensions`,builder:m(_),handler:async t=>c({command:`registrar-sandbox extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},t,async()=>{let c={name:t.name,cursor:t.cursor,per_page:t[`per-page`],direction:t.direction,sort_by:t[`sort-by`]};if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})},y={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage("$0 registrar-sandbox 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 x={command:`check <domains...>`,describe:`Check domain availability`,builder:b,handler:async t=>c({command:`registrar-sandbox registrations check`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({domains:t.domains}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...e,account_id:l}));a(n,{successLabel:`Created`});return}let f=d({domains:t.domains}),p=await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...f,account_id:l}));a(p,{successLabel:`Created`})})};function S(e){return e.usage("$0 registrar-sandbox registrations create\n\nStarts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 500 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration 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`.").option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
5
5
  waiting for the operation to complete (RFC 7240).
@@ -34,7 +34,7 @@ Most registrations do not require a fax number.
34
34
  (e.g., \`example.com\`, \`mybrand.app\`). The domain name uniquely identifies
35
35
  a registration. Cloudflare permits only one registration per domain, making
36
36
  the domain name a natural idempotency key for registration requests.
37
- `}).option(`privacy-mode`,{type:`string`,description:"Sets the WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Disables WHOIS privacy.\n- `redaction`: Requests WHOIS redaction where the extension supports it.\n Some extensions exclude privacy and redaction.\n",choices:[`off`,`redaction`],default:`redaction`}).option(`years`,{type:`number`,description:`Sets the registration term from 1 to 10 years. When omitted, this
37
+ `}).option(`privacy-mode`,{type:`string`,description:"Sets the WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Disables WHOIS privacy.\n- `redaction`: Requests WHOIS redaction where the extension supports it.\n Some extensions exclude privacy and redaction.\n",choices:[`off`,`redaction`],default:`redaction`}).coerce(`privacy-mode`,e=>f(e,`privacy-mode`,`text`)).option(`years`,{type:`number`,description:`Sets the registration term from 1 to 10 years. When omitted, this
38
38
  field defaults to the registry's minimum registration period for the
39
39
  extension. Most extensions require 1 year, while some require longer
40
40
  minimum terms (e.g., \`.ai\` requires 2 years).
@@ -42,7 +42,7 @@ minimum terms (e.g., \`.ai\` requires 2 years).
42
42
  Each registry may also enforce its own maximum registration term. A
43
43
  request above that maximum fails. When uncertain, omit this field to
44
44
  use the default.
45
- `}).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 C={command:`create`,describe:`Create Registration`,builder:S,handler:async m=>c({command:`registrar-sandbox registrations create`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},m,async()=>{let c={};if(m.prefer!==void 0&&(c.Prefer=String(m.prefer)),m.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:m.body===void 0?d({auto_renew:m[`auto-renew`],contacts:{administrator:{email:f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:f(m[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:f(m[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:f(m[`domain-name`],`domain-name`,`text`),privacy_mode:f(m[`privacy-mode`],`privacy-mode`,`text`),years:m.years}):u(m.body)});return}let h=await n(m),g=m.local?e:await i();if(m.accountId=g,m.body){let e=u(m.body),n=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{successLabel:`Created`});return}m[`domain-name`]===void 0&&(m[`domain-name`]=await p(`domain-name`,"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. "));let _={};m[`auto-renew`]!==void 0&&l(_,[`auto_renew`],m[`auto-renew`]),m[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),m[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),m[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),m[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),m[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),m[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],f(m[`contacts-billing-email`],`contacts-billing-email`,`text`)),m[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),m[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),m[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),m[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),m[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),m[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),m[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),m[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),m[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),m[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],f(m[`contacts-technical-email`],`contacts-technical-email`,`text`)),m[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),m[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),m[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),m[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),m[`domain-name`]!==void 0&&l(_,[`domain_name`],f(m[`domain-name`],`domain-name`,`text`)),m[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],f(m[`privacy-mode`],`privacy-mode`,`text`)),m.years!==void 0&&l(_,[`years`],m.years);let v=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0}));a(v,{successLabel:`Created`})})};function w(e){return e.usage("$0 registrar-sandbox 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 T={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:w,handler:async t=>c({command:`registrar-sandbox registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function E(e){return e.usage("$0 registrar-sandbox 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 D={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:E,handler:async t=>c({command:`registrar-sandbox registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function O(e){return e.usage("$0 registrar-sandbox 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 k={command:`get <domain-name>`,describe:`Get Registration`,builder:O,handler:async t=>c({command:`registrar-sandbox registrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function A(e){return e.usage("$0 registrar-sandbox 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\`.
45
+ `}).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 C={command:`create`,describe:`Create Registration`,builder:S,handler:async m=>c({command:`registrar-sandbox registrations create`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},m,async()=>{let c={};if(m.prefer!==void 0&&(c.Prefer=String(m.prefer)),m.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:m.body===void 0?d({auto_renew:m[`auto-renew`],contacts:{administrator:{email:f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:f(m[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:f(m[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:f(m[`domain-name`],`domain-name`,`text`),privacy_mode:m[`privacy-mode`],years:m.years}):u(m.body)});return}let h=await n(m),g=m.local?e:await i();if(m.accountId=g,m.body){let e=u(m.body),n=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{successLabel:`Created`});return}m[`domain-name`]===void 0&&(m[`domain-name`]=await p(`domain-name`,"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. "));let _={};m[`auto-renew`]!==void 0&&l(_,[`auto_renew`],m[`auto-renew`]),m[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),m[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),m[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),m[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),m[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),m[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],f(m[`contacts-billing-email`],`contacts-billing-email`,`text`)),m[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),m[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),m[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),m[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),m[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),m[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),m[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),m[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),m[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),m[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],f(m[`contacts-technical-email`],`contacts-technical-email`,`text`)),m[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),m[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),m[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),m[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),m[`domain-name`]!==void 0&&l(_,[`domain_name`],f(m[`domain-name`],`domain-name`,`text`)),m[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],m[`privacy-mode`]),m.years!==void 0&&l(_,[`years`],m.years);let v=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0}));a(v,{successLabel:`Created`})})};function w(e){return e.usage("$0 registrar-sandbox 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 T={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:w,handler:async t=>c({command:`registrar-sandbox registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function E(e){return e.usage("$0 registrar-sandbox 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 D={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:E,handler:async t=>c({command:`registrar-sandbox registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function O(e){return e.usage("$0 registrar-sandbox 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 k={command:`get <domain-name>`,describe:`Get Registration`,builder:O,handler:async t=>c({command:`registrar-sandbox registrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:t[`domain-name`]}));a(u,{successLabel:`Loaded`})})};function A(e){return e.usage("$0 registrar-sandbox 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\`.
46
46
  Pass this value to fetch the next page of results. Omit (or
47
47
  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 j={command:`list`,describe:`List Registrations`,builder:m(A),handler:async t=>c({command:`registrar-sandbox registrations list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},t,async()=>{let c={cursor:t.cursor,per_page:t[`per-page`],direction:t.direction,sort_by:t[`sort-by`]};if(t.dryRun){let e=await r();o({command:`cf registrar-sandbox registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.registrarSandbox.registrations.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function M(e){return e.usage('$0 registrar-sandbox 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.
48
48
  - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./cf-BxsXrVeh.mjs";import{resolve as t}from"node:path";const n=`CLOUDFLARE_REGISTRY_PATH`;function r(r=process.env){let i=r[n];return i===void 0||i===``?t(e(),`registry`):t(i)}function i(e=process.env){let t=r(e);return{[n]:t,WRANGLER_REGISTRY_PATH:t,MINIFLARE_REGISTRY_PATH:t}}export{r as n,i as t};
2
+ import{i as e}from"./cf-oRSQKirD.mjs";import{resolve as t}from"node:path";const n=`CLOUDFLARE_REGISTRY_PATH`;function r(r=process.env){let i=r[n];return i===void 0||i===``?t(e(),`registry`):t(i)}function i(e=process.env){let t=r(e);return{[n]:t,WRANGLER_REGISTRY_PATH:t,MINIFLARE_REGISTRY_PATH:t}}export{r as n,i as t};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c}from"./body-parser-DkHKPkJ7.mjs";function l(e){return e.usage(`$0 reporting industry get
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as c}from"./body-parser-DkHKPkJ7.mjs";function l(e){return e.usage(`$0 reporting industry get
3
3
 
4
4
  Gets the industry classification for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Get an account industry`,builder:l,handler:async c=>s({command:`reporting industry get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf reporting industry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.reporting.industry.get({account_id:l}));i(u,{successLabel:`Loaded`})})};function d(e){return e.usage(`$0 reporting industry update
5
5
 
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./version-BdVUXLnK.mjs";import{i as n,t as r}from"./interactive-BW9T1D1q.mjs";function i(){return r?`ci`:n()?`interactive`:`non-interactive`}function a(){let n=e(),r=n.isAgentic&&n.harness!==null?{"X-CF-CLI-Agent":n.harness.id}:{};return{"User-Agent":t,"X-CF-CLI-Mode":i(),...r}}export{a as n,i as t};
2
+ import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./version-BGnqDvNR.mjs";import{i as n,t as r}from"./interactive-BW9T1D1q.mjs";function i(){return r?`ci`:n()?`interactive`:`non-interactive`}function a(){let n=e(),r=n.isAgentic&&n.harness!==null?{"X-CF-CLI-Agent":n.harness.id}:{};return{"User-Agent":t,"X-CF-CLI-Mode":i(),...r}}export{a as n,i as t};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.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-RlgRrmbm.mjs";function f(e){return e.usage(`$0 request-tracers traces create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.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-C8FyienX.mjs";function f(e){return e.usage(`$0 request-tracers traces create
3
3
 
4
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 p={command:`create`,describe:`Request Trace`,builder:f,handler:async f=>s({command:`request-tracers traces create`,classification:{safeFlags:[`context-geoloc-is-eu-country`,`context-skip-challenge`,`skip-response`,`dry-run`]}},f,async()=>{if(f.dryRun){let e=await n();a({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)}):c(f.body)});return}let s=await t(f),p=f.local?e:await r();if(f.accountId=p,f.body){let e=c(f.body),t=await o(`Creating`,async()=>s.requestTracers.traces.create({...e,account_id:p}));i(t,{successLabel:`Created`});return}f.method===void 0&&(f.method=await d(`method`,`HTTP Method of tracing request`)),f.url===void 0&&(f.url=await d(`url`,`URL to which perform tracing request`));let m=l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)}),h=await o(`Creating`,async()=>s.requestTracers.traces.create({...m,account_id:p}));i(h,{successLabel:`Created`})})},m={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,i as p,n as m}from"./prompt-RlgRrmbm.mjs";import{t as h}from"./cli-types-9oYmRTHJ.mjs";function g(e){return e.usage(`$0 resource-sharing create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,i as p,n as m}from"./prompt-C8FyienX.mjs";import{t as h}from"./cli-types-9oYmRTHJ.mjs";function g(e){return e.usage(`$0 resource-sharing create
3
3
 
4
4
  Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Trigger a share creation`,builder:g,handler:async p=>s({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=await n();a({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body),t=await o(`Creating`,async()=>s.resourceSharing.create({...e,account_id:m}));i(t,{successLabel:`Created`});return}if(p.name===void 0&&(p.name=await f(`name`,`The name of the share.`)),p.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(p.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)}),g=await o(`Creating`,async()=>s.resourceSharing.create({...h,account_id:m}));i(g,{successLabel:`Created`})})};function v(e){return e.usage(`$0 resource-sharing delete <share-id>
5
5
 
@@ -28,7 +28,7 @@ Get share recipient by ID.`).positional(`recipient-id`,{type:`string`,descriptio
28
28
 
29
29
  Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (\`target_type=organization\`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`update <share-id>`,describe:`Trigger recipient reconciliation on a share`,builder:H,handler:async e=>s({command:`resource-sharing recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let n=await t(e);if(e.body){let t=c(e.body),r=await o(`Updating`,async()=>n.resourceSharing.recipients.update({body:t,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));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.`)})},W={command:`recipients`,describe:`Update share recipients`,builder:e=>e.command(I).command(ee).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.usage(`$0 resource-sharing resources create <share-id>
30
30
 
31
- Adds a resource to an existing share, making it available to share recipients.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create <share-id>`,describe:`Trigger a resource addition to a share`,builder:G,handler:async l=>s({command:`resource-sharing resources create`,classification:{safeFlags:[`resource-type`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares/${l[`share-id`]==null?`<share-id>`:encodeURIComponent(String(l[`share-id`]))}/resources`,pathParams:{"share-id":String(l[`share-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:d(l[`resource-type`],`resource-type`,`text`)}):c(l.body)});return}let s=await t(l),m=l.local?e:await r();if(l.accountId=m,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.resourceSharing.resources.create({body:e,account_id:m,share_id:l[`share-id`]}));i(t,{successLabel:`Created`});return}l[`resource-account-id`]===void 0&&(l[`resource-account-id`]=await f(`resource-account-id`,`Account identifier.`)),l[`resource-id`]===void 0&&(l[`resource-id`]=await f(`resource-id`,`Share Resource identifier.`)),l[`resource-type`]===void 0&&(l[`resource-type`]=await p(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let h=u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:d(l[`resource-type`],`resource-type`,`text`)}),g=await o(`Creating`,async()=>s.resourceSharing.resources.create({body:h,account_id:m,share_id:l[`share-id`]}));i(g,{successLabel:`Created`})})};function q(e){return e.usage(`$0 resource-sharing resources delete <share-resource-id>
31
+ Adds a resource to an existing share, making it available to share recipients.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).coerce(`resource-type`,e=>d(e,`resource-type`,`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 K={command:`create <share-id>`,describe:`Trigger a resource addition to a share`,builder:G,handler:async l=>s({command:`resource-sharing resources create`,classification:{safeFlags:[`resource-type`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares/${l[`share-id`]==null?`<share-id>`:encodeURIComponent(String(l[`share-id`]))}/resources`,pathParams:{"share-id":String(l[`share-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:l[`resource-type`]}):c(l.body)});return}let s=await t(l),m=l.local?e:await r();if(l.accountId=m,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.resourceSharing.resources.create({body:e,account_id:m,share_id:l[`share-id`]}));i(t,{successLabel:`Created`});return}l[`resource-account-id`]===void 0&&(l[`resource-account-id`]=await f(`resource-account-id`,`Account identifier.`)),l[`resource-id`]===void 0&&(l[`resource-id`]=await f(`resource-id`,`Share Resource identifier.`)),l[`resource-type`]===void 0&&(l[`resource-type`]=await p(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let h=u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:l[`resource-type`]}),g=await o(`Creating`,async()=>s.resourceSharing.resources.create({body:h,account_id:m,share_id:l[`share-id`]}));i(g,{successLabel:`Created`})})};function q(e){return e.usage(`$0 resource-sharing resources delete <share-resource-id>
32
32
 
33
33
  Deletion is not immediate, an updated share resource object with a new status will be returned.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <share-resource-id>`,describe:`Trigger a resource deletion from a share`,builder:q,handler:async c=>s({command:`resource-sharing resources delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf resource-sharing resources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/resources/${c[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(c[`share-resource-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"share-resource-id":String(c[`share-resource-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await m({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
34
34
  `);return}let u=await o(`Deleting`,async()=>s.resourceSharing.resources.delete({account_id:l,share_id:c[`share-id`],share_resource_id:c[`share-resource-id`]}));i(u,{successLabel:`Deleted`})})};function Y(e){return e.usage(`$0 resource-sharing resources get <share-resource-id>
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";function c(e){return e.usage(`$0 resource-tagging summary get
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";function c(e){return e.usage(`$0 resource-tagging summary get
3
3
 
4
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 l={command:`get`,describe:`List tag key summary`,builder:c,handler:async c=>s({command:`resource-tagging summary get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor};if(c.dryRun){let e=await n();a({command:`cf resource-tagging summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/tags/summary`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.resourceTagging.summary.get({account_id:u,...s}));i(d,{successLabel:`Loaded`})})},u={command:`summary`,describe:`Operations for summary`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`resource-tagging`,describe:`resource-tagging`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-RlgRrmbm.mjs";function m(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:m,handler:async c=>s({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists/bulk_operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}`,pathParams:{"operation-id":String(c[`operation-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rules.lists.bulkOperations.get({account_id:l,operation_id:c[`operation-id`]}));i(u,{successLabel:`Loaded`})})},g={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 rules lists create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-C8FyienX.mjs";function m(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:m,handler:async c=>s({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists/bulk_operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}`,pathParams:{"operation-id":String(c[`operation-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rules.lists.bulkOperations.get({account_id:l,operation_id:c[`operation-id`]}));i(u,{successLabel:`Loaded`})})},g={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 rules lists create
3
3
 
4
4
  Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a list`,builder:_,handler:async l=>s({command:`rules lists create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.rules.lists.create({...e,account_id:p}));i(t,{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)}),h=await o(`Creating`,async()=>s.rules.lists.create({...m,account_id:p}));i(h,{successLabel:`Created`})})};function y(e){return e.usage(`$0 rules lists delete <list-id>
5
5
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,i as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-RlgRrmbm.mjs";function m(e){return e.usage(`$0 rulesets create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,i as r,t as i}from"./context-BBLtgdR1.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-CQqDtgmF.mjs";import{t as c}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-C8FyienX.mjs";function m(e){return e.usage(`$0 rulesets create
3
3
 
4
- Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create an account or zone ruleset`,builder:m,handler:async p=>c({command:`rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>m.rulesets.create({...e,account_or_zone:h,account_or_zone_id:g,...c}));a(t,{successLabel:`Created`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Creating`,async()=>m.rulesets.create({..._,account_or_zone:h,account_or_zone_id:g,...c}));a(v,{successLabel:`Created`})})};function g(e){return e.usage(`$0 rulesets delete <id>
4
+ Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>f(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create an account or zone ruleset`,builder:m,handler:async p=>c({command:`rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:p.kind,phase:p.phase,rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>m.rulesets.create({...e,account_or_zone:h,account_or_zone_id:g,...c}));a(t,{successLabel:`Created`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:p.kind,phase:p.phase,rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Creating`,async()=>m.rulesets.create({..._,account_or_zone:h,account_or_zone_id:g,...c}));a(v,{successLabel:`Created`})})};function g(e){return e.usage(`$0 rulesets delete <id>
5
5
 
6
6
  Deletes all versions of an existing account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <id>`,describe:`Delete an account or zone ruleset`,builder:g,handler:async l=>c({command:`rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{"account-or-zone":String(t),id:String(l.id??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
7
7
  `);return}let m=await s(`Deleting`,async()=>u.rulesets.delete({account_or_zone:d,account_or_zone_id:f,id:l.id,...c}));a(m,{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 rulesets entrypoint get <phase>
@@ -25,7 +25,7 @@ Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`
25
25
 
26
26
  Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const L={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:I,handler:async u=>c({command:`rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await t(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await i();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>p.rulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c}));a(t,{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await s(`Updating`,async()=>p.rulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c}));a(_,{successLabel:`Updated`})})},R={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 rulesets update <ruleset-id>
27
27
 
28
- Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:z,handler:async p=>c({command:`rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>m.rulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(t,{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Updating`,async()=>m.rulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(v,{successLabel:`Updated`})})};function V(e){return e.usage(`$0 rulesets versions by-tag get <tag>
28
+ Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>f(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:z,handler:async p=>c({command:`rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:p.kind,phase:p.phase,rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>m.rulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(t,{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:p.kind,phase:p.phase,rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Updating`,async()=>m.rulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(v,{successLabel:`Updated`})})};function V(e){return e.usage(`$0 rulesets versions by-tag get <tag>
29
29
 
30
30
  Fetches the rules of a managed account or zone ruleset version for a given tag.`).positional(`tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <tag>`,describe:`List an account or zone ruleset version's rules by tag`,builder:V,handler:async l=>c({command:`rulesets versions by-tag get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets versions by-tag get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l.tag==null?`<tag>`:encodeURIComponent(String(l.tag))}`,pathParams:{"account-or-zone":String(t),tag:String(l.tag??``),"ruleset-version":String(l[`ruleset-version`]??``),id:String(l.id??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.versions.byTag.get({account_or_zone:u,account_or_zone_id:d,id:l.id,ruleset_version:l[`ruleset-version`],tag:l.tag}));a(f,{successLabel:`Loaded`})})},U={command:`by-tag`,describe:`Operations for versions.by-tag`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 rulesets versions delete <ruleset-version>
31
31
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-RlgRrmbm.mjs";import{t as p}from"./cli-types-9oYmRTHJ.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-C8FyienX.mjs";import{t as p}from"./cli-types-9oYmRTHJ.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
3
3
 
4
4
  Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Creating`,async()=>s.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:d[`ruleset-id`]}));i(t,{successLabel:`Created`});return}let p=u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}),m=await o(`Creating`,async()=>s.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:d[`ruleset-id`]}));i(m,{successLabel:`Created`})})};function g(e){return e.usage(`$0 rum rules create <ruleset-id>
5
5
 
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{Q as n}from"./dist-BHEmAAHr.mjs";import{n as r}from"./version-BdVUXLnK.mjs";import{t as i}from"./delegate-Tgfxa-MZ.mjs";import{i as a,r as o}from"./lifecycle-oud60haK.mjs";import{i as s,t as c}from"./interactive-BW9T1D1q.mjs";import{t as l}from"./request-headers-DiJeDAn1.mjs";import{n as u,t as d}from"./state-BDSvdSdP.mjs";import{t as f}from"./error-sanitization-DE_zSrXw.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${p?`sending`:`would send`}: ${JSON.stringify(n)}`),p)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=/* @__PURE__ */ new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=/* @__PURE__ */ new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
2
+ import{t as e}from"./agent-context-DFEgYjEQ.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{Q as n}from"./dist-DmRM6WSZ.mjs";import{n as r}from"./version-BGnqDvNR.mjs";import{t as i}from"./delegate-Tgfxa-MZ.mjs";import{i as a,r as o}from"./lifecycle-oud60haK.mjs";import{i as s,t as c}from"./interactive-BW9T1D1q.mjs";import{t as l}from"./request-headers-D8L95bEQ.mjs";import{n as u,t as d}from"./state-DIiIGEtR.mjs";import{t as f}from"./error-sanitization-DE_zSrXw.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${p?`sending`:`would send`}: ${JSON.stringify(n)}`),p)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=/* @__PURE__ */ new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=/* @__PURE__ */ new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./run-CW2Cgi0S.mjs";export{e as runWithTelemetry};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t}from"./version-BdVUXLnK.mjs";import{i as n}from"./cf-BxsXrVeh.mjs";import{i as r}from"./body-parser-DkHKPkJ7.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-RlgRrmbm.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
2
+ import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t}from"./version-BGnqDvNR.mjs";import{i as n}from"./cf-oRSQKirD.mjs";import{i as r}from"./body-parser-DkHKPkJ7.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-C8FyienX.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
3
3
  `)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=/* @__PURE__ */ new Set(/* @__PURE__ */ `$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,/* @__PURE__ */ new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>d(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>d(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0||A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
4
4
  `)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[.../* @__PURE__ */ new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(_&&g.length!==0)for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
5
5
  `)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>d(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>d(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:l,maximum:u,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!d(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>d(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(l!==void 0&&(f===!0?t<=l:t<l)&&n.push(f===!0?`--${r} must be greater than ${l}`:`--${r} must be at least ${l}`),u!==void 0&&(p===!0?t>=u:t>u)&&n.push(p===!0?`--${r} must be less than ${u}`:`--${r} must be at most ${u}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!d(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>d(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>d(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`)){if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`)){if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=/* @__PURE__ */ new Set([...ve,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};