cf 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/README.md +20 -5
  2. package/dist/_meta/agent-context.json +46 -39
  3. package/dist/_meta/commands.json +9358 -10581
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +14870 -14667
  6. package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
  7. package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/account-tags-Bz3JG5hI.mjs +9 -0
  10. package/dist/accounts-DCuW3xyZ.mjs +28 -0
  11. package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/args-DlUhyGU0.mjs +2 -0
  26. package/dist/artifacts-BBfXNfUg.mjs +4 -0
  27. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  28. package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
  29. package/dist/auth-DPhNN3Ly.mjs +5 -0
  30. package/dist/billing-B9e4PnvN.mjs +3 -0
  31. package/dist/body-parser-BshbixEq.mjs +2 -0
  32. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  33. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  34. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  35. package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  36. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  37. package/dist/build-D0FhOj40.mjs +8 -0
  38. package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
  39. package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
  40. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  41. package/dist/cf-Ds4JFovl.mjs +18 -0
  42. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  44. package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  45. package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  46. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  47. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  48. package/dist/command-C9VP3xaA.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  50. package/dist/config.d.mts +1460 -1348
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  53. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  54. package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
  55. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  56. package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
  57. package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  58. package/dist/containers-BrQtGiNp.mjs +58 -0
  59. package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  60. package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  61. package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  62. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  63. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  64. package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
  65. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  66. package/dist/custom-pages-DTINMR30.mjs +3 -0
  67. package/dist/d1-sKdExJYF.mjs +20 -0
  68. package/dist/data-security-mV3a6UfW.mjs +7 -0
  69. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  70. package/dist/delegate.mjs +1 -1
  71. package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
  72. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  73. package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
  74. package/dist/diagnostics-CJV6qWUA.mjs +3 -0
  75. package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
  76. package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  77. package/dist/dist-BHi7UhXO.mjs +72 -0
  78. package/dist/dist-BWpErtDM.mjs +384 -0
  79. package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
  80. package/dist/dns-C8FC2hbh.mjs +29 -0
  81. package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  84. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  85. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  86. package/dist/email-routing-CF3_Z957.mjs +6 -0
  87. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  88. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  89. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  90. package/dist/firewall-8YWWy4iB.mjs +11 -0
  91. package/dist/flagship-C4x0l-8J.mjs +4 -0
  92. package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
  93. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  94. package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
  95. package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
  96. package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  97. package/dist/iam-DR72hmii.mjs +6 -0
  98. package/dist/images-CeKc5JPh.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/intel-DtFix9WL.mjs +8 -0
  101. package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
  102. package/dist/ips-CtWCjXAN.mjs +2 -0
  103. package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  104. package/dist/keys-BmhG6Kn1.mjs +2 -0
  105. package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
  106. package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  107. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  108. package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
  109. package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  110. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  111. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  112. package/dist/logos-DRYjGBDq.mjs +3 -0
  113. package/dist/logpush-Dve9jOMp.mjs +4 -0
  114. package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
  115. package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  116. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  117. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  118. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  119. package/dist/matches-Iss9Fo4R.mjs +2 -0
  120. package/dist/mcp-8wxXT6JU.mjs +4 -0
  121. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  122. package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
  123. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  124. package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
  125. package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  126. package/dist/oauth-DuEONNgC.mjs +14 -0
  127. package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  128. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  129. package/dist/observability-Jya7-zkl.mjs +4 -0
  130. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  131. package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
  132. package/dist/organizations-SacGUW44.mjs +2 -0
  133. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  134. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  135. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  136. package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
  137. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  138. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  139. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  140. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  141. package/dist/precursor-iwK-1P_d.mjs +4 -0
  142. package/dist/progress-BqQcF5QH.mjs +2 -0
  143. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  144. package/dist/prompt-B0sWIs9c.mjs +3 -0
  145. package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  146. package/dist/queries-c7zvnfEQ.mjs +3 -0
  147. package/dist/queues-BU6y16qS.mjs +6 -0
  148. package/dist/r2-Jo3QMahK.mjs +24 -0
  149. package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  150. package/dist/radar-DIYAMEof.mjs +2 -0
  151. package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
  152. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  153. package/dist/realtimekit-cnZEVNDn.mjs +7 -0
  154. package/dist/registrar-BsWr_aPM.mjs +23 -0
  155. package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
  156. package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
  157. package/dist/reporting--1AyTV7k.mjs +2 -0
  158. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  159. package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  160. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  161. package/dist/rules-BfjzALMi.mjs +4 -0
  162. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  163. package/dist/rum-CjmIckiR.mjs +4 -0
  164. package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
  165. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  166. package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
  167. package/dist/sdk-ZctLa5jW.mjs +3 -0
  168. package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  169. package/dist/security-center-Djm06dq-.mjs +2 -0
  170. package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  171. package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
  172. package/dist/shared-BJvq4DkR.mjs +290 -0
  173. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  174. package/dist/snippets-Dyz0PH60.mjs +4 -0
  175. package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  176. package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  177. package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
  178. package/dist/src-gJma71Ec.mjs +108 -0
  179. package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
  180. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  181. package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
  182. package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  183. package/dist/submit-BxbKKhBn.mjs +2 -0
  184. package/dist/tags-DA8dq9fx.mjs +2 -0
  185. package/dist/tenant-DLXw48hS.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  187. package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
  188. package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  189. package/dist/tunnels-CC10EOsU.mjs +2 -0
  190. package/dist/turnstile-CH58hnf4.mjs +23 -0
  191. package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
  192. package/dist/url-info-BpCgdUtL.mjs +2 -0
  193. package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  194. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  195. package/dist/user-2-NGebfI.mjs +12 -0
  196. package/dist/values-S_bNv819.mjs +2 -0
  197. package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  198. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  199. package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  200. package/dist/web3-GnUocVYH.mjs +4 -0
  201. package/dist/workers-J1-PLwdl.mjs +28 -0
  202. package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
  203. package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
  204. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  205. package/dist/zero-trust-DVdUPtj1.mjs +93 -0
  206. package/dist/zone-DMAfrDJX.mjs +2 -0
  207. package/dist/zones-CNwxUi7I.mjs +21 -0
  208. package/package.json +10 -7
  209. package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
  210. package/dist/account-Dd4-tDYJ.mjs +0 -2
  211. package/dist/account-tags-65fAlHrf.mjs +0 -9
  212. package/dist/accounts-Bp5KGc6r.mjs +0 -28
  213. package/dist/agent-memory-D--BQS0W.mjs +0 -6
  214. package/dist/ai-BnVlQDiI.mjs +0 -5
  215. package/dist/ai-audit-CfpDKXkD.mjs +0 -2
  216. package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
  217. package/dist/ai-search-B2l3B_jn.mjs +0 -7
  218. package/dist/ai-security-byjIIrfl.mjs +0 -4
  219. package/dist/analytics-DeIKjC9n.mjs +0 -3
  220. package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
  221. package/dist/argo-DFerMyXF.mjs +0 -2
  222. package/dist/artifacts-CtyEYYDa.mjs +0 -4
  223. package/dist/audit-logs-retFtvow.mjs +0 -2
  224. package/dist/auth-aazs91XL.mjs +0 -5
  225. package/dist/billing-CxQVqpGZ.mjs +0 -3
  226. package/dist/body-parser-CYD7PKFC.mjs +0 -2
  227. package/dist/bot-management-Rli7v7tg.mjs +0 -5
  228. package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
  229. package/dist/brand-protection-CTvnHGfV.mjs +0 -3
  230. package/dist/browser-run-FwtwnBzA.mjs +0 -4
  231. package/dist/build-Dji9BYmV.mjs +0 -2
  232. package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
  233. package/dist/cf-oSz9pud_.mjs +0 -18
  234. package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
  235. package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
  236. package/dist/cloudforce-one-2PecncfX.mjs +0 -30
  237. package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
  238. package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
  239. package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
  240. package/dist/containers-Bog7j0Hw.mjs +0 -54
  241. package/dist/custom-certificates-4y35UC1X.mjs +0 -5
  242. package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
  243. package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
  244. package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
  245. package/dist/custom-pages-vfDxrXbt.mjs +0 -4
  246. package/dist/d1-Cllm-iTT.mjs +0 -20
  247. package/dist/data-security-rnoSCEdL.mjs +0 -7
  248. package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
  249. package/dist/deploy-input-DhCo1I0I.mjs +0 -242
  250. package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
  251. package/dist/dist-COfwjT96.mjs +0 -72
  252. package/dist/dns-DdQYtenF.mjs +0 -29
  253. package/dist/durable-objects-BvxXBht_.mjs +0 -2
  254. package/dist/email-CGOC_evd.mjs +0 -2
  255. package/dist/email-auth-DFvXKSkg.mjs +0 -2
  256. package/dist/email-routing-QBRPBlyl.mjs +0 -6
  257. package/dist/email-security-BFagcRPP.mjs +0 -18
  258. package/dist/email-sending-Ddhe7xjN.mjs +0 -7
  259. package/dist/filters-CGisPGD1.mjs +0 -4
  260. package/dist/firewall-DD8U-Brd.mjs +0 -11
  261. package/dist/flagship-FJHc4mFi.mjs +0 -4
  262. package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
  263. package/dist/iam-BhHYhMXO.mjs +0 -6
  264. package/dist/images-CDViyKtZ.mjs +0 -8
  265. package/dist/intel-YHZbPlS3.mjs +0 -8
  266. package/dist/ips-BpCdldFx.mjs +0 -2
  267. package/dist/keys-yYtv7Ztr.mjs +0 -2
  268. package/dist/load-balancers-jRCN75mX.mjs +0 -7
  269. package/dist/logexplorer-kO8CULiK.mjs +0 -24
  270. package/dist/logo-matches-LyDAYPbI.mjs +0 -2
  271. package/dist/logos-O9f5bGSB.mjs +0 -3
  272. package/dist/logpush-dtXLu3Ck.mjs +0 -5
  273. package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
  274. package/dist/magic-transit-DwgZeIj-.mjs +0 -111
  275. package/dist/managed-transforms-DCmogkxv.mjs +0 -3
  276. package/dist/matches-BAeN8VM1.mjs +0 -2
  277. package/dist/mcp-DKZ2D050.mjs +0 -4
  278. package/dist/media-CnxgOViL.mjs +0 -2
  279. package/dist/mesh-CzIPtuaM.mjs +0 -4
  280. package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
  281. package/dist/oauth-BPizUUqP.mjs +0 -15
  282. package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
  283. package/dist/observability-DXYgDdU5.mjs +0 -4
  284. package/dist/organizations-eNzfOwlP.mjs +0 -2
  285. package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
  286. package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
  287. package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
  288. package/dist/page-rules-B2Csdc4h.mjs +0 -18
  289. package/dist/pages-BAL6Q7OY.mjs +0 -14
  290. package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
  291. package/dist/pipelines-cyQOuFLb.mjs +0 -6
  292. package/dist/precursor-BrweY39h.mjs +0 -4
  293. package/dist/progress-B84wYh91.mjs +0 -2
  294. package/dist/prompt-CDtLWxNv.mjs +0 -3
  295. package/dist/queries-oM8uGZy5.mjs +0 -3
  296. package/dist/queues-CTx04ZNw.mjs +0 -6
  297. package/dist/r2-CnlIUn7R.mjs +0 -24
  298. package/dist/radar-CGNgGh8v.mjs +0 -2
  299. package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
  300. package/dist/realtimekit-BPwzhNS9.mjs +0 -7
  301. package/dist/registrar-BEcb90RX.mjs +0 -21
  302. package/dist/reporting-CLbjHlnw.mjs +0 -2
  303. package/dist/request-tracers-BcKpofP1.mjs +0 -2
  304. package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
  305. package/dist/rules-CmuB5rIN.mjs +0 -4
  306. package/dist/rulesets-CGaMq8vG.mjs +0 -8
  307. package/dist/rum-QT6EP4JK.mjs +0 -4
  308. package/dist/schema-flags-DHryz6SF.mjs +0 -5
  309. package/dist/sdk-m4xeaua4.mjs +0 -3
  310. package/dist/security-center-BNm4uPVB.mjs +0 -2
  311. package/dist/session-Ckt20hHa.mjs +0 -2
  312. package/dist/shared-BzPQog8H.mjs +0 -2
  313. package/dist/smart-shield-SODkOUyO.mjs +0 -4
  314. package/dist/snippets-B5jY8v_7.mjs +0 -4
  315. package/dist/src-CHW7s5IS.mjs +0 -108
  316. package/dist/submit-Dl_27e0n.mjs +0 -2
  317. package/dist/tags-Cdo_Pwtr.mjs +0 -2
  318. package/dist/tenant-EX-ANl6X.mjs +0 -2
  319. package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
  320. package/dist/triggers-Bf9hbP3h.mjs +0 -2
  321. package/dist/tunnels-CgyX8R2J.mjs +0 -2
  322. package/dist/turnstile-BUtzlW-0.mjs +0 -23
  323. package/dist/url-info-CJsa1Oc9.mjs +0 -2
  324. package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
  325. package/dist/user-BxHjEqpd.mjs +0 -12
  326. package/dist/values-C43NurfT.mjs +0 -2
  327. package/dist/versions-BFbc90Wu.mjs +0 -2
  328. package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
  329. package/dist/web3-Ctv9HGiR.mjs +0 -4
  330. package/dist/workers-D-YbIedB.mjs +0 -24
  331. package/dist/zaraz-BA6kY-b6.mjs +0 -2
  332. package/dist/zero-trust-DOFLlUz1.mjs +0 -102
  333. package/dist/zone-B_rgejLV.mjs +0 -2
  334. package/dist/zone-tags-BWdza4rH.mjs +0 -9
  335. package/dist/zones-DTWO7Vvn.mjs +0 -21
  336. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  337. /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
  338. /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
  339. /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
  340. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  341. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  342. /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
  343. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  344. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  345. /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
  346. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  347. /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
  348. /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
  349. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  350. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  351. /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
  352. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  353. /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
  354. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
  355. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  356. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
  357. /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
  358. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  359. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
  360. /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
  361. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  362. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  363. /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import{a as e}from"./theme-CrIBazAF.mjs";import{n as t,t as n}from"./local-Be3lg_9E.mjs";import{f as r,g as i}from"./oauth-DuEONNgC.mjs";import{a,o,r as s}from"./auth-D3X9HYhD.mjs";import{t as c}from"./output-Ccqw2WOb.mjs";import{t as l}from"./dry-run-DL2V6yFm.mjs";import{t as u}from"./progress-BqQcF5QH.mjs";import{i as d,n as f,t as p}from"./body-parser-BshbixEq.mjs";import{n as m}from"./input-validation-QDIYu7Vb.mjs";import{a as h,i as g,n as ee,o as _,r as v}from"./prompt-B0sWIs9c.mjs";import{t as y}from"./cli-types-DAYeL_Mj.mjs";import{_ as b,a as x,c as S,d as C,g as w,h as T,i as E,m as D,o as O,p as k,r as A,s as j,t as te,u as ne}from"./schema-flags-llLJuFFw.mjs";import{isDeepStrictEqual as re}from"node:util";import{domainToASCII as ie}from"node:url";function ae(e){return e.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 oe={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration 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.",builder:ae,handler:async e=>{if(e.dryRun){l({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.extensions.get({account_id:a,extension:e.extension})),{successLabel:`Loaded`})}};function se(e){return e.option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
3
+ Pass this value to fetch the next page of results. Omit (or
4
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration 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.",builder:y(se),handler:async e=>{let t={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){l({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/extensions`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.extensions.list({account_id:o,...t})),{successLabel:`Loaded`})}},le={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};async function M(e,t,n){let r=_(n),i=ie(n.trim().replace(/\.$/,``)).toLowerCase(),a=await u(`Checking availability`,()=>e.registrar.registrations.check({account_id:t,domains:[n]})),o=i===``?[]:a.domains.filter(e=>e.name.toLowerCase()===i),s=o.length===1?o[0]:void 0;if(!s)throw Error(`The availability check returned no result for ${r}, so cf cannot safely register it.`);if(s.registrable!==!0&&s.reason===`domain_premium`)throw Error(`${r} is a premium domain (domain_premium). Premium registration is not supported by this API, so cf will not submit it.`);if(s.registrable!==!0){let e=s.reason===void 0?``:` (${_(s.reason)})`;throw Error(`${r} is not available for registration${e}.`)}if(s.tier===`premium`)throw Error(`${r} is a premium domain. Premium registration is not supported by this API, so cf will not submit it.`);if(s.tier!==`standard`)throw Error(`${r} is not confirmed as a standard domain. This API only supports standard registrations, so cf will not submit it.`);if(!s.pricing)throw Error(`The availability check returned no pricing for ${r}, so cf cannot safely register it.`);return s.pricing}const N=`registrar-extension-schema`;function ue(e){let t=e.trim().toLowerCase().replace(/\.$/,``).split(`.`);return t.slice(1).map((e,n)=>t.slice(n+1).join(`.`))}async function de(e,t,n,r){let i;try{i=r===void 0?await n.registrar.extensions.get({account_id:t,extension:e}):await n.registrar.extensions.get({account_id:t,extension:e},{timeoutInSeconds:r/1e3,maxRetries:0})}catch(e){return{ok:!1,reason:D(e)}}let a=T(i,`registration_schema`);return a?{ok:!0,extension:e,schema:a}:{ok:!1,reason:`the API returned no registration schema for .${e}`}}async function P(e,t,n,r,i){let a=t?[t]:ue(e);if(a.length===0)return{ok:!1,reason:`'${e}' has no extension — pass a fully qualified domain name`};let o,s=`not found`;for(let e of a){let t=w(N,[n,e]);if(t)return{ok:!0,extension:e,schema:t};if(!o)try{o=await r()}catch(e){return{ok:!1,reason:D(e)}}let a;if(i!==void 0&&(a=i-Date.now(),a<=0))return{ok:!1,reason:`the request timed out`};let c=await de(e,n,o,a);if(c.ok)return b(N,[n,e],c.schema),c;if(s=c.reason,!/not found/i.test(c.reason))return c}return{ok:!1,reason:a.length>1?`no registration schema for ${a.map(e=>`.${e}`).join(` or `)} (${s})`:s}}const fe=new Set([`domain_name`,`years`,`auto_renew`,`privacy_mode`]),pe={acknowledgements:`Acknowledgements`,contact_extensions:`Registry Details`,contacts:`Contacts`};function F(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function me(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 I(e){return typeof e==`boolean`?e?`Yes`:`No`:e===null?`null`:typeof e==`string`||typeof e==`number`?String(e):JSON.stringify(e)??`undefined`}function L(e,t){return e.find(e=>e.path.length===t.length&&e.path.every((e,n)=>e===t[n]))}function he(e,t,n){if(typeof t==`boolean`&&e.some(e=>e.includes(`acknowledgement`)))return t?`Accepted`:`Declined`;let r=L(n,e),i=I(t),a=F(r?.choiceLabels,i);if(a)return`${a} (${i})`;let o=(r?.schema.oneOf??r?.schema.anyOf)?.find(e=>e.title&&C(e,t).length===0);return o?.title?`${o.title} (${i})`:i}function ge(e,t){return e.map((n,r)=>r===e.length-1&&t?.schema.title?t.schema.title:F(pe,n)??me(n)).join(` · `)}function R(e,t,n=[]){let r=[];for(let[i,a]of Object.entries(e)){if(n.length===0&&fe.has(i))continue;let e=[...n,i];if(typeof a==`object`&&a&&!Array.isArray(a)&&Object.keys(a).length>0){r.push(...R(a,t,e));continue}let o=L(t,e);r.push([ge(e,o),he(e,a,t)])}return r.sort(([e],[t])=>e.localeCompare(t))}function z(e,t,n){if(Object.hasOwn(e,n))return I(e[n]);let r=_e(t,n);return r===void 0?`API default`:`${I(r)} (default)`}function B(e){return e===void 0?[]:[...e.default===void 0?[]:[e.default],...(e.allOf??[]).flatMap(B)]}function V(e,t){return e===void 0?[]:[...B(e.properties?.[t]),...(e.allOf??[]).flatMap(e=>V(e,t))]}function _e(e,t){let n=V(e,t),r=n[0];return n.length>0&&n.every(e=>re(e,r))?r:void 0}function H(t){let n=t.map(([e,t])=>[_(e),_(t)]),r=Math.min(32,Math.max(...n.map(([e])=>e.length),0));return n.map(([t,n])=>`│ ${e.muted(t.padEnd(r))} ${e.bold(n)}`)}function ve(t){let n=[[`Domain`,t.domain],[`Account`,t.accountId],[`Registration term`,`${t.years} ${t.years===1?`year`:`years`}`],[`Due now`,t.quotedCost],[`Renewal price`,`${t.pricing.currency} ${t.pricing.renewal_cost} per year`],[`Auto-renew`,z(t.body,t.schema,`auto_renew`)],[`Privacy mode`,z(t.body,t.schema,`privacy_mode`)]],r=R(t.body,t.descriptors??[]);return[`│`,`${e.brand(`◇`)} ${e.bold(`Review registration`)}`,`│`,...H(n),...r.length>0?[`│`,`│ ${e.bold(`Registration details`)}`,...H(r)]:[],`│`].join(`
5
+ `)}const U=[`domain_name`],W=`Fully qualified domain name to register, e.g. example.travel`,G=[`domain-name`,`domainName`,`extension`,`force`,`f`,`prefer`,`contacts`];function ye(e){return`/${e.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}function be(e,t,n){return t.some(t=>{if(t.path[0]!==e||t.path.length===1)return!1;let r=t.name.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase());return Object.hasOwn(n,t.name)&&n[t.name]!==void 0||Object.hasOwn(n,r)&&n[r]!==void 0})}function xe(e){if(e.choices===void 0)return;let t=(e.schema.enum??(e.schema.oneOf??e.schema.anyOf)?.flatMap(e=>e.const===void 0?e.enum??[]:[e.const]))?.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t?.length===e.choices.length?t:void 0}function Se(e){let t=e.type===`boolean`&&e.schema.const===!0,n=e.schema.description,r=n===void 0?void 0:_(n);return{path:ye(e.path),flag:`--${e.name}`,question:j(e),description:r,choices:xe(e)?.map(t=>{let n=String(t);return{value:t,label:_(e.choiceLabels!==void 0&&Object.hasOwn(e.choiceLabels,n)?e.choiceLabels[n]??n:n)}}),requiredValue:e.schema.const,acknowledgementText:t?r:void 0}}function K(e,t,n,r,i){let a=x(n,r);return a.length===0?!1:(c({submitted:!1,reason:`registration_input_required`,message:`Not submitted. Additional registration input is required.`,domainName:e,extension:t,missingFields:a.map(Se),validationErrors:i}),!0)}function q(e){let t=/^(\d+)(?:\.(\d+))?$/.exec(e);if(!t)return;let n=t[2]??``;return{units:BigInt(`${t[1]}${n}`),scale:n.length}}function Ce(e,t){let n=q(e.registration_cost),r=q(e.renewal_cost);if(!n||!r)return;let i=Math.max(n.scale,r.scale),a=e=>10n**BigInt(e),o=n.units*a(i-n.scale)+r.units*a(i-r.scale)*BigInt(t-1);if(i===0)return o.toString();let s=a(i);return`${o/s}.${(o%s).toString().padStart(i,`0`)}`}function we(e,t){let n=Ce(e,t);if(!n||!/^[A-Z]{3}$/.test(e.currency))throw Error(`The availability check returned invalid pricing, so cf cannot safely confirm this registration.`);return`${e.currency} ${n}`}function J(e,t){return e.flatMap(e=>t.map(t=>[...e,...t]))}function Y(e,t,n,r=!1,i=[]){let a=e.properties?.[t],o=a!==void 0,s=[a===void 0?[]:[a]],c=e.if&&e.then&&A(e.if)&&C(e.if,n).length===0?[e.then]:[];for(let a of[...e.allOf??[],...c]){let e=Y(a,t,n,r,i);e.found&&(o=!0,s=J(s,e.bundles))}for(let a of[e.oneOf,e.anyOf]){if(!a?.length)continue;let e=r&&a.every(A)?a.filter(e=>Oe(e,t,n,i)):[],c=(e.length>0?e:a).map(e=>Y(e,t,n,r,i));c.some(e=>e.found)&&(o=!0,s=J(s,c.flatMap(e=>e.bundles)))}return{found:o,bundles:s}}function X(e,t){let n=e[t];return[...n===void 0?[]:[n],...(e.allOf??[]).flatMap(e=>X(e,t))]}function Z(e){return e.length===0?{}:e.length===1?e[0]??{}:{allOf:e}}function Te(e){let t=[...typeof e.minimum==`number`?[e.exclusiveMinimum===!0?Math.floor(e.minimum)+1:Math.ceil(e.minimum)]:[],...typeof e.exclusiveMinimum==`number`?[Math.floor(e.exclusiveMinimum)+1]:[],...(e.allOf??[]).flatMap(e=>{let t=Te(e);return t===void 0?[]:[t]})];return t.length>0?Math.max(1,...t):void 0}function Ee(e){let t=X(e,`const`);if(t.length>0)return t.every(e=>Object.is(e,t[0]))?{found:!0,value:t[0]}:{found:!1};let n=X(e,`default`);if(n.length>0)return n.every(e=>Object.is(e,n[0]))?{found:!0,value:n[0]}:{found:!1};let r=Te(e);return r===void 0?{found:!1}:{found:!0,value:r}}function Q(e){let{allOf:t,anyOf:n,oneOf:r,...i}=e,a=[Object.keys(i).length===0?[]:[i]];for(let e of t??[])a=J(a,Q(e).map(e=>[e]));for(let e of[r,n])e?.length&&(a=J(a,e.flatMap(e=>Q(e).map(e=>[e]))));return a.map(Z)}function De(e){return e.flatMap(e=>Q(e).map(t=>({schema:e,candidate:Ee(t)})))}function Oe(e,t,n,r){let i=C(e,n);return Object.hasOwn(n,t)||i.length===0?i.length===0:r.some(r=>C(e,{...n,[t]:r}).length===0)}function ke(e,t){let n=Object.hasOwn(e,`years`),r=Y(t,`years`,e,!1);if(!r.found)throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let i=r.bundles.map(Z),a=Y(t,`years`,e,!0,n?[]:De(i).flatMap(({schema:e,candidate:t})=>t.found&&C(e,t.value).length===0?[t.value]:[]));if(!a.found||n&&a.bundles.some(e=>e.length===0))throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let o=a.bundles.map(Z),s=o,c,l;if(n)l=e.years;else{let n=De(o).filter(({schema:e,candidate:t})=>{if(!t.found)return!0;let[n]=C(e,t.value);return n===void 0?!0:(c??=n,!1)});if(A(t)){let r=n.filter(({candidate:e})=>!e.found),i=n.filter(({candidate:n})=>n.found&&C(t,{...e,years:n.value}).length===0);i.length>0&&(n=[...r,...i])}s=n.map(({schema:e})=>e);let r=n.map(({candidate:e})=>e),[i]=r;l=i?.found===!0&&r.every(e=>e.found&&Object.is(e.value,i.value))?i.value:void 0}if(typeof l!=`number`||!Number.isInteger(l)||l<=0)throw!n&&s.length===0&&c?Error(`The extension schema returned an invalid default registration term: ${c}`):Error(n?`The requested registration term must be a positive whole number of years.`:`The extension schema returned no safe default registration term, so cf cannot safely confirm this registration.`);let u=n?C(o.length===1?o[0]??{}:{anyOf:o},l):s.flatMap(e=>C(e,l));if(u.length>0)throw Error(n?`The requested registration term is invalid: ${u[0]}`:`The extension schema returned an invalid default registration term: ${u[0]}`);return e.years=l,l}let Ae;function $(e){let t=m(e,`domain-name`,`text`);if(t!==void 0&&typeof t!=`string`)throw Error(`--domain-name must be a string`);return t}function je(e){return Ae=e,e.positional(`domain-name`,{type:`string`,description:`Fully qualified domain name, e.g. example.travel`}).option(`extension`,{type:`string`,description:`Extension whose registration schema to use (default: derived from the domain)`}).option(`prefer`,{type:`string`,description:"Set the Prefer header, e.g. `respond-async` to skip the synchronous wait"}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip the registration confirmation prompt`,default:!1}).option(`contacts`,{type:`string`,description:`Registrant contacts as inline JSON or @path to a reusable JSON file`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this extension's input flags`}).epilogue("Input flags depend on the extension: run `cf registrar registrations create <domain> --help`.\ncf rechecks availability and pricing before confirmation. Run `cf registrar registrations check --domains <domain>` to inspect them separately.")}async function Me(t){Ae?.showHelp(`log`);let n=$(t[`domain-name`]);if(!n)return;let r=_(n);if(t.local){console.log(`\n${e.muted(`Registration fields are unavailable in local mode.`)}`);return}let i=Date.now()+k,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the registration fields for ${r}.`)}`);return}let c=await P(n,t.extension,a,()=>s(t),i);console.log(c.ok?`\n${O(S(c.schema,{exclude:[U]}),`Registration fields for .${c.extension}`)}`:`\n${e.muted(`Could not load the registration fields for ${r}: ${_(c.reason)}.`)}`)}async function Ne(e,t,n){for(;;){let r=E(e,t,n);if(r.length===0)return!0;for(let e of r){let n=e.description??``,r=j(e);if(e.type===`boolean`&&e.schema.const===!0){let r=_(e.schema.description??n);if(!await v(e.name,r))return!1;t[e.name]=!0}else e.choices?.length?t[e.name]=await g(e.name,r,e.choices,e.choiceLabels):t[e.name]=await h(e.name,r,{validate:t=>ne(e,t)})}}}function Pe(e){let t=f(e);if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--body must contain a JSON object`);return t}function Fe(e){let t;if(e.startsWith(`@`))t=m(e,`contacts`,`json`);else try{t=JSON.parse(e)}catch{throw Error(`--contacts must contain a JSON object or @path to a JSON file`)}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--contacts must contain a JSON object or @path to a JSON file`);return t}const Ie={command:`create [domain-name]`,describe:"Register a domain. Billable and non-refundable — input fields are extension-specific, see `create <domain> --help`",builder:je,handler:async e=>{if(e.help){await Me(e);return}if(e.local)throw Error(t);let n={};e.prefer!==void 0&&(n.Prefer=String(e.prefer));let o;if(e.body!==void 0){let t=te([],e,{reserved:G}).errors.some(e=>e.startsWith(`Unknown flag`));if(e.contacts!==void 0||t)throw Error(`--body cannot be combined with registration field flags. Pass one or the other.`);o=Pe(e.body)}let d=e.contacts===void 0?void 0:Fe(e.contacts),f=$(e[`domain-name`]),p=o?.domain_name;if(p!==void 0&&typeof p!=`string`)throw Error(`--body field domain_name must be a string`);if(f!==void 0&&p!==void 0&&f!==p)throw Error(`The positional domain '${_(f)}' does not match --body domain_name '${_(p)}'`);let m=f??p;if(!m){if(o!==void 0){c({submitted:!1,reason:`registration_input_required`,message:`Not submitted. A domain is required to determine the registration schema.`,missingFields:[{path:`/domain_name`,flag:`--domain-name`,question:W}],validationErrors:["`/domain_name` is required"]});return}m=await h(`domain-name`,W)}let g=_(m);o&&(o.domain_name=m);let v=e.dryRun?await i()??`<account-id>`:await r(),y,b=async()=>(y||=await s(e),y);e.dryRun||await M(await b(),v,m);let x=await P(m,e.extension,v,b);if(!x.ok)throw Error(`Could not load the registration schema for ${g}: ${_(x.reason)}.`);let w=_(x.extension),T=x.schema,E=S(x.schema,{exclude:[U]});if(!o){if(d!==void 0&&be(`contacts`,E,e))throw Error(`--contacts cannot be combined with --contacts-* fields. Pass one or the other.`);let t={...e},n=d===void 0?void 0:{contacts:d};if(n!==void 0&&delete t.contacts,!await Ne(E,t,n))return;let r=te(E,t,{reserved:G,baseBody:n});if(r.errors.length>0)throw Error(`${r.errors.join(`
6
+ `)}\n\nRun \`cf registrar registrations create ${g} --help\` for .${w}'s registration fields.`);o={domain_name:m,...r.body}}let D;try{D=ke(o,T)}catch(e){let t=C(T,o);if(K(m,x.extension,E,o,t))return;throw e}let O=C(T,o);if(K(m,x.extension,E,o,O))return;if(O.length>0)throw Error(`${O.join(`
7
+ `)}\n\nRun \`cf registrar registrations create ${g} --help\` for this extension's registration fields.`);if(e.dryRun){l({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${v}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:o});return}let k=await M(await b(),v,m),A=we(k,D);if(e.force||process.stderr.write(`${ve({domain:m,accountId:v,years:D,quotedCost:A,pricing:k,body:o,schema:T,descriptors:E})}\n`),!await ee({force:e.force,message:`Registering ${g} for ${D} ${D===1?`year`:`years`} costs ${A}, charges the account's default payment method, and cannot be refunded.`}))return;if(o.years!==D)throw Error(`The registration term changed after confirmation, so cf will not submit this registration.`);let j=await M(await b(),v,m);if(j.currency!==k.currency||j.registration_cost!==k.registration_cost||j.renewal_cost!==k.renewal_cost)throw Error(`Availability or pricing changed while awaiting confirmation, so cf will not submit this registration. Re-run the command to review the current quote.`);let ne=await b();e.accountId=v,c(await u(`Registering`,async()=>a(ne,`POST`,`/accounts/${v}/registrar/registrations`,{body:o,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Registered ${g}`})}};function Le(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
8
+ - Minimum: 1 domain.
9
+ - Maximum: 20 domains per request.
10
+ - The response returns domains on unsupported extensions with \`registrable: false\` and a \`reason\` field.
11
+ - The response may omit malformed domain names (e.g., names missing an extension).
12
+ `}).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 Re={command:`check`,describe:"Performs 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.",builder:Le,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({domains:e.domains}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);c(await u(`Creating`,async()=>t.registrar.registrations.check({...n,account_id:a})),{successLabel:`Created`});return}if(e.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let o=p({domains:e.domains});c(await u(`Creating`,async()=>t.registrar.registrations.check({...o,account_id:a})),{successLabel:`Created`})}};function ze(e){return e.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 Be={command:`get-registration-status <domain-name>`,describe:"Returns 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. } ```",builder:ze,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<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 s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.getRegistrationStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function Ve(e){return e.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 He={command:`get-update-status <domain-name>`,describe:"Returns 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.",builder:Ve,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<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 s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.getUpdateStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function Ue(e){return e.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 We={command:`get <domain-name>`,describe:"Returns 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.",builder:Ue,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<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 s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.get({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function Ge(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
13
+ Pass this value to fetch the next page of results. Omit (or
14
+ 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 Ke={command:`list`,describe:"Returns 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.",builder:y(Ge),handler:async e=>{let t={cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){l({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.list({account_id:o,...t})),{successLabel:`Loaded`})}};function qe(e){return e.option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
15
+ - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
16
+ - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
17
+ returns results across all supported extensions. Extensions not in the supported
18
+ set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`search`,describe:'Searches 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.',builder:qe,handler:async e=>{let t={q:e.query,extensions:e.extensions,limit:e.limit};if(e.dryRun){l({command:`cf registrar registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.search({account_id:o,...t})),{successLabel:`Loaded`})}};function Ye(e){return e.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.
19
+ Setting this field to \`true\` authorizes Cloudflare to charge the
20
+ account's default payment method up to 30 days before domain expiry
21
+ to renew the domain automatically. Renewal pricing may change over
22
+ time based on registry pricing.
23
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const Xe={command:`update <domain-name>`,describe:"Updates 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.",builder:Ye,handler:async e=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){l({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({auto_renew:e[`auto-renew`]}):f(e.body)});return}let o=await s(e),m=e.local?n:await r();if(e.accountId=m,e.body){let n=f(e.body);c(await u(`Updating`,async()=>a(o,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:n,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Updated`});return}let h={};e[`auto-renew`]!==void 0&&d(h,[`auto_renew`],e[`auto-renew`]),c(await u(`Updating`,async()=>a(o,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Updated`})}},Ze={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(Re).command(Ie).command(We).command(Be).command(He).command(Ke).command(Je).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qe={command:`registrar`,describe:`registrar`,builder:e=>e.command(le).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Qe as default};
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{a as r,r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,r as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d}from"./input-validation-BBKJRoRB.mjs";import{a as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.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 h={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration 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.",builder:m,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/extensions/${r.extension==null?`<extension>`:encodeURIComponent(String(r.extension))}`,pathParams:{extension:String(r.extension??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:r.extension})),{successLabel:`Loaded`})}};function g(e){return e.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-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{i as c,n as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d}from"./input-validation-QDIYu7Vb.mjs";import{a as f}from"./prompt-B0sWIs9c.mjs";import{t as p}from"./cli-types-DAYeL_Mj.mjs";function m(e){return e.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 h={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration 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.",builder:m,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/extensions/${r.extension==null?`<extension>`:encodeURIComponent(String(r.extension))}`,pathParams:{extension:String(r.extension??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:r.extension})),{successLabel:`Loaded`})}};function g(e){return e.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 _={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration 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.",builder:p(g),handler:async r=>{let c={name:r.name,cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})}},v={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
5
5
  - Minimum: 1 domain.
6
6
  - Maximum: 20 domains per request.
7
7
  - The response returns domains on unsupported extensions with \`registrable: false\` and a \`reason\` field.
8
8
  - The response may omit malformed domain names (e.g., names missing an extension).
9
- `}).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 b={command:`check`,describe:"Performs 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.",builder:y,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({domains:r.domains}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.registrarSandbox.registrations.check({...e,account_id:d})),{successLabel:`Created`});return}if(r.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let f=u({domains:r.domains});a(await s(`Creating`,async()=>l.registrarSandbox.registrations.check({...f,account_id:d})),{successLabel:`Created`})}};function x(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
9
+ `}).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 b={command:`check`,describe:"Performs 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.",builder:y,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({domains:r.domains}):l(r.body)});return}let c=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...e,account_id:d})),{successLabel:`Created`});return}if(r.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let f=u({domains:r.domains});a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...f,account_id:d})),{successLabel:`Created`})}};function x(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
10
10
  waiting for the operation to complete (RFC 7240).
11
11
 
12
12
  The header may be combined with other preferences using standard
@@ -47,15 +47,15 @@ minimum terms (e.g., \`.ai\` requires 2 years).
47
47
  Each registry may also enforce its own maximum registration term. A
48
48
  request above that maximum fails. When uncertain, omit this field to
49
49
  use the default.
50
- `}).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 S={command:`create`,describe:"Starts 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`.",builder:x,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){o({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({auto_renew:p[`auto-renew`],contacts:{administrator:{email:d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:d(p[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:d(p[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):c(p.body)});return}let h=await i(p),g=p.local?e:await t();if(p.accountId=g,p.body){let e=c(p.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await f(`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 _={};p[`auto-renew`]!==void 0&&l(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),p[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),p[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),p[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),p[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),p[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],d(p[`contacts-billing-email`],`contacts-billing-email`,`text`)),p[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),p[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),p[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),p[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),p[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],d(p[`contacts-technical-email`],`contacts-technical-email`,`text`)),p[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),p[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),p[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),p[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&l(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&l(_,[`years`],p.years),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function C(e){return e.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 w={command:`get-registration-status <domain-name>`,describe:"Returns 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. } ```",builder:C,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function T(e){return e.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 E={command:`get-update-status <domain-name>`,describe:"Returns 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.",builder:T,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function D(e){return e.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 O={command:`get <domain-name>`,describe:"Returns 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.",builder:D,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
50
+ `}).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 S={command:`create`,describe:"Starts 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`.",builder:x,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){o({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({auto_renew:p[`auto-renew`],contacts:{administrator:{email:d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:d(p[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:d(p[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):l(p.body)});return}let h=await i(p),g=p.local?e:await t();if(p.accountId=g,p.body){let e=l(p.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await f(`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 _={};p[`auto-renew`]!==void 0&&c(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-administrator-email`]!==void 0&&c(_,[`contacts`,`administrator`,`email`],d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),p[`contacts-administrator-fax`]!==void 0&&c(_,[`contacts`,`administrator`,`fax`],d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),p[`contacts-administrator-phone`]!==void 0&&c(_,[`contacts`,`administrator`,`phone`],d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),p[`contacts-administrator-postal-info-name`]!==void 0&&c(_,[`contacts`,`administrator`,`postal_info`,`name`],d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),p[`contacts-administrator-postal-info-organization`]!==void 0&&c(_,[`contacts`,`administrator`,`postal_info`,`organization`],d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),p[`contacts-billing-email`]!==void 0&&c(_,[`contacts`,`billing`,`email`],d(p[`contacts-billing-email`],`contacts-billing-email`,`text`)),p[`contacts-billing-fax`]!==void 0&&c(_,[`contacts`,`billing`,`fax`],d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),p[`contacts-billing-phone`]!==void 0&&c(_,[`contacts`,`billing`,`phone`],d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),p[`contacts-billing-postal-info-name`]!==void 0&&c(_,[`contacts`,`billing`,`postal_info`,`name`],d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),p[`contacts-billing-postal-info-organization`]!==void 0&&c(_,[`contacts`,`billing`,`postal_info`,`organization`],d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),p[`contacts-registrant-email`]!==void 0&&c(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&c(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&c(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&c(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&c(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`contacts-technical-email`]!==void 0&&c(_,[`contacts`,`technical`,`email`],d(p[`contacts-technical-email`],`contacts-technical-email`,`text`)),p[`contacts-technical-fax`]!==void 0&&c(_,[`contacts`,`technical`,`fax`],d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),p[`contacts-technical-phone`]!==void 0&&c(_,[`contacts`,`technical`,`phone`],d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),p[`contacts-technical-postal-info-name`]!==void 0&&c(_,[`contacts`,`technical`,`postal_info`,`name`],d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),p[`contacts-technical-postal-info-organization`]!==void 0&&c(_,[`contacts`,`technical`,`postal_info`,`organization`],d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&c(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&c(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&c(_,[`years`],p.years),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function C(e){return e.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 w={command:`get-registration-status <domain-name>`,describe:"Returns 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. } ```",builder:C,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function T(e){return e.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 E={command:`get-update-status <domain-name>`,describe:"Returns 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.",builder:T,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function D(e){return e.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 O={command:`get <domain-name>`,describe:"Returns 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.",builder:D,handler:async r=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
51
51
  Pass this value to fetch the next page of results. Omit (or
52
- 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 A={command:`list`,describe:"Returns 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.",builder:p(k),handler:async r=>{let c={cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
52
+ 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 A={command:`list`,describe:"Returns 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.",builder:p(k),handler:async r=>{let c={cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
53
53
  - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
54
54
  - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
55
55
  returns results across all supported extensions. Extensions not in the supported
56
- set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`search`,describe:'Searches 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.',builder:j,handler:async r=>{let c={q:r.q,extensions:r.extensions,limit:r.limit};if(r.dryRun){o({command:`cf registrar-sandbox registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.search({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.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.
56
+ set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`search`,describe:'Searches 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.',builder:j,handler:async r=>{let c={q:r.query,extensions:r.extensions,limit:r.limit};if(r.dryRun){o({command:`cf registrar-sandbox registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.search({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.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.
57
57
  Setting this field to \`true\` authorizes Cloudflare to charge the
58
58
  account's default payment method up to 30 days before domain expiry
59
59
  to renew the domain automatically. Renewal pricing may change over
60
60
  time based on registry pricing.
61
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const P={command:`update <domain-name>`,describe:"Updates 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.",builder:N,handler:async d=>{let f={};if(d.prefer!==void 0&&(f.Prefer=String(d.prefer)),d.dryRun){o({command:`cf registrar-sandbox registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${d[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(d[`domain-name`]))}`,pathParams:{"domain-name":String(d[`domain-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({auto_renew:d[`auto-renew`]}):c(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=c(d.body);a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}let h={};d[`auto-renew`]!==void 0&&l(h,[`auto_renew`],d[`auto-renew`]),a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},F={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(b).command(S).command(O).command(w).command(E).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`registrar-sandbox`,describe:`registrar-sandbox`,builder:e=>e.command(v).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
61
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const P={command:`update <domain-name>`,describe:"Updates 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.",builder:N,handler:async d=>{let f={};if(d.prefer!==void 0&&(f.Prefer=String(d.prefer)),d.dryRun){o({command:`cf registrar-sandbox registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${d[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(d[`domain-name`]))}`,pathParams:{"domain-name":String(d[`domain-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({auto_renew:d[`auto-renew`]}):l(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=l(d.body);a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}let h={};d[`auto-renew`]!==void 0&&c(h,[`auto_renew`],d[`auto-renew`]),a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},F={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(b).command(S).command(O).command(w).command(E).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`registrar-sandbox`,describe:`registrar-sandbox`,builder:e=>e.command(v).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./cf-oSz9pud_.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-Ds4JFovl.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};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s}from"./body-parser-BshbixEq.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Gets the industry classification for an account.`,builder:c,handler:async s=>{if(s.dryRun){a({command:`cf reporting industry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.reporting.industry.get({account_id:l})),{successLabel:`Loaded`})}};function u(e){return e.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 d={command:`update`,describe:`Updates the industry classification for an account.`,builder:u,handler:async c=>{if(c.dryRun){a({command:`cf reporting industry update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.reporting.industry.update({...e,account_id:u})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},f={command:`industry`,describe:`Operations for industry`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`policy-id`,{type:`string`,description:`Unique identifier for the policy (UUID format)`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <policy-id>`,describe:`Gets a reporting policy by identifier.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf reporting policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.reporting.policies.get({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists all reporting policies for an account.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf reporting policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/policies`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.reporting.policies.list({account_id:l})),{successLabel:`Loaded`})}},_={command:`policies`,describe:`Operations for policies`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`report-id`,{type:`string`,description:`Unique report identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <report-id>`,describe:`Gets a generated report by identifier.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf reporting reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}`,pathParams:{"report-id":String(s[`report-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.reporting.reports.get({account_id:l,report_id:s[`report-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists all generated reports for an account.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf reporting reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/reports`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.reporting.reports.list({account_id:l})),{successLabel:`Loaded`})}},S={command:`reports`,describe:`Operations for reports`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`reporting`,describe:`reporting`,builder:e=>e.command(f).command(_).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{C as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,t as c}from"./body-parser-BshbixEq.mjs";import{n as l}from"./input-validation-QDIYu7Vb.mjs";import{a as u}from"./prompt-B0sWIs9c.mjs";function d(e){return e.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 f={command:`create`,describe:`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.`,builder:d,handler:async d=>{if(d.dryRun){a({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}d.method===void 0&&(d.method=await u(`method`,`HTTP Method of tracing request`)),d.url===void 0&&(d.url=await u(`url`,`URL to which perform tracing request`));let m=c({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)});i(await o(`Creating`,async()=>f.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})}},p={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s}from"./body-parser-CYD7PKFC.mjs";import{n as c}from"./prompt-CDtLWxNv.mjs";function l(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create <share-id>`,describe:`Excludes a single account from an organization-targeted share. The share continues to target the entire organization, but the excluded account is skipped during reconciliation.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.resourceSharing.excludedRecipients.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function d(e){return e.positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <excluded-recipient-id>`,describe:`Removes a single account from a share's excluded-recipient list. The account becomes eligible to receive the share again on the next reconciliation cycle.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf resource-sharing excluded-recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients/${s[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(s[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"excluded-recipient-id":String(s[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await c({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./prompt-B0sWIs9c.mjs";function l(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create <share-id>`,describe:`Excludes a single account from an organization-targeted share. The share continues to target the entire organization, but the excluded account is skipped during reconciliation.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.resourceSharing.excludedRecipients.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function d(e){return e.positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <excluded-recipient-id>`,describe:`Removes a single account from a share's excluded-recipient list. The account becomes eligible to receive the share again on the next reconciliation cycle.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf resource-sharing excluded-recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients/${s[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(s[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"excluded-recipient-id":String(s[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await c({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>l.resourceSharing.excludedRecipients.delete({account_id:u,share_id:s[`share-id`],excluded_recipient_id:s[`excluded-recipient-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <excluded-recipient-id>`,describe:`Gets a single excluded recipient of a share by its identifier tag.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf resource-sharing excluded-recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients/${s[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(s[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"excluded-recipient-id":String(s[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.resourceSharing.excludedRecipients.get({account_id:l,share_id:s[`share-id`],excluded_recipient_id:s[`excluded-recipient-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:"Lists the accounts excluded from an organization-targeted share. Only valid for shares with `target_type=organization`.",builder:h,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf resource-sharing excluded-recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);i(await o(`Loading`,async()=>n.resourceSharing.excludedRecipients.list({account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t})),{successLabel:`Loaded`})}};function _(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <share-id>`,describe:"Reconciles a share's excluded recipients to match the given list. Only valid for shares with `target_type=organization`.",builder:_,handler:async e=>{if(e.dryRun){a({command:`cf resource-sharing excluded-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`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Updating`,async()=>t.resourceSharing.excludedRecipients.update({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},y={command:`excluded-recipients`,describe:`Operations for excluded-recipients`,builder:e=>e.command(u).command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`resource-sharing`,describe:`Share Cloudflare resources (zones, accounts) across organizations with granular access controls`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";function s(e){return e.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 c={command:`get`,describe:`Lists all distinct tag keys and their distinct values across resources in an account.`,builder:s,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf resource-tagging summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/summary`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.resourceTagging.summary.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`summary`,describe:`Operations for summary`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},u={command:`resource-tagging`,describe:`resource-tagging`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{u as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{a as d,n as f}from"./prompt-B0sWIs9c.mjs";function p(e){return e.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 m={command:`get <operation-id>`,describe:"Gets 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.",builder:p,handler:async s=>{if(s.dryRun){a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/bulk_operations/${s[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(s[`operation-id`]))}`,pathParams:{"operation-id":String(s[`operation-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rules.lists.bulkOperations.get({account_id:l,operation_id:s[`operation-id`]})),{successLabel:`Loaded`})}},h={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.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 _={command:`create`,describe:`Creates a new list of the specified kind.`,builder:g,handler:async c=>{if(c.dryRun){a({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({description:u(c.description,`description`,`text`),name:u(c.name,`name`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.rules.lists.create({...e,account_id:p})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=l({description:u(c.description,`description`,`text`),name:u(c.name,`name`,`text`)});i(await o(`Creating`,async()=>f.rules.lists.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <list-id>`,describe:`Deletes a specific list and all its items.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}`,pathParams:{"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the custom list and every item it contains.`})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>c.rules.lists.delete({account_id:l,list_id:s[`list-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <list-id>`,describe:`Fetches the details of a list.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}`,pathParams:{"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rules.lists.get({account_id:l,list_id:s[`list-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 C={command:`create <list-id>`,describe:"Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:S,handler:async c=>{if(c.dryRun){a({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.rules.lists.items.create({body:e,account_id:u,list_id:c[`list-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function w(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`items`,{type:`string`,description:`The items 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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`delete <list-id>`,describe:"Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:w,handler:async u=>{if(u.dryRun){a({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${u[`list-id`]==null?`<list-id>`:encodeURIComponent(String(u[`list-id`]))}/items`,pathParams:{"list-id":String(u[`list-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({items:c(u.items,`items`)}):s(u.body)});return}let d=await r(u),p=u.local?e:await t();if(u.accountId=p,!await f({force:!!u.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
4
+ `);return}if(u.body){let e=s(u.body);i(await o(`Deleting`,async()=>d.rules.lists.items.delete({...e,account_id:p,list_id:u[`list-id`]})),{successLabel:`Deleted`});return}let m=l({items:c(u.items,`items`)});i(await o(`Deleting`,async()=>d.rules.lists.items.delete({...m,account_id:p,list_id:u[`list-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`item-id`,{type:`string`,description:`Defines the unique ID of the item in the List.`,demandOption:!0}).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <item-id>`,describe:`Fetches a list item in the list.`,builder:E,handler:async s=>{if(s.dryRun){a({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}/items/${s[`item-id`]==null?`<item-id>`:encodeURIComponent(String(s[`item-id`]))}`,pathParams:{"item-id":String(s[`item-id`]??``),"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rules.lists.items.get({account_id:l,list_id:s[`list-id`],item_id:s[`item-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Fetches all the items in the list.`,builder:O,handler:async s=>{let c={cursor:s.cursor,per_page:s[`per-page`],search:s.search};if(s.dryRun){a({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}/items`,pathParams:{"list-id":String(s[`list-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.rules.lists.items.list({account_id:u,list_id:s[`list-id`],...c})),{successLabel:`Loaded`})}};function A(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <list-id>`,describe:"Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:A,handler:async c=>{if(c.dryRun){a({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.rules.lists.items.update({body:e,account_id:u,list_id:c[`list-id`]})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},M={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Fetches all lists in the account.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rules.lists.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <list-id>`,describe:`Updates the description of a list.`,builder:F,handler:async c=>{if(c.dryRun){a({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({description:u(c.description,`description`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.rules.lists.update({...e,account_id:f,list_id:c[`list-id`]})),{successLabel:`Updated`});return}let p=l({description:u(c.description,`description`,`text`)});i(await o(`Updating`,async()=>d.rules.lists.update({...p,account_id:f,list_id:c[`list-id`]})),{successLabel:`Updated`})}},L={command:`lists`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(_).command(y).command(x).command(P).command(I).command(h).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`rules`,describe:`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n,h as r}from"./oauth-DuEONNgC.mjs";import{r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{n as c,r as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d}from"./input-validation-QDIYu7Vb.mjs";import{a as f,i as p,n as m}from"./prompt-B0sWIs9c.mjs";function h(e){return e.option(`dry-run`,{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 name field`}).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 g={command:`create`,describe:`Creates a ruleset.`,builder:h,handler:async m=>{let h={dry_run:m[`dry-run`]};if(m.dryRun){let e=m.zone===void 0?await n():void 0,t=m.zone===void 0?`accounts`:`zones`,r=m.zone??e??`<account-id>`;o({command:`cf rulesets account-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:h,bodyKind:`json`,body:m.body===void 0?u({description:d(m.description,`description`,`text`),name:d(m.name,`name`,`text`),kind:d(m.kind,`kind`,`text`),phase:d(m.phase,`phase`,`text`),rules:l(m.rules,`rules`)}):c(m.body)});return}let g=await i(m),_=m.zone===void 0?`accounts`:`zones`,v=_===`zones`?await r({zone:m.zone},g,{quiet:m.quiet}):m.local?e:await t();if(_===`zones`?m.zoneId=v:m.accountId=v,m.body){let e=c(m.body);new URLSearchParams(Object.entries(h).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...e,account_or_zone:_,account_or_zone_id:v,...h})),{successLabel:`Created`});return}m.name===void 0&&(m.name=await f(`name`,`The name field`)),m.kind===void 0&&(m.kind=await p(`kind`,`The kind of the ruleset.`,[`managed`,`custom`,`root`,`zone`])),m.phase===void 0&&(m.phase=await p(`phase`,`The phase of the ruleset.`,[`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`]));let y=u({description:d(m.description,`description`,`text`),name:d(m.name,`name`,`text`),kind:d(m.kind,`kind`,`text`),phase:d(m.phase,`phase`,`text`),rules:l(m.rules,`rules`)});new URLSearchParams(Object.entries(h).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...y,account_or_zone:_,account_or_zone_id:v,...h})),{successLabel:`Created`})}};function _(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{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 v={command:`delete <ruleset-id>`,describe:`Deletes all versions of an existing account or zone ruleset.`,builder:_,handler:async c=>{let l={dry_run:c[`dry-run`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();if(d===`zones`?c.zoneId=f:c.accountId=f,!await m({force:!!c.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:c[`ruleset-id`],...l})),{successLabel:`Deleted`})}};function y(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <ruleset-id>`,describe:`Fetches the latest version of an account or zone ruleset.`,builder:y,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:c[`ruleset-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Fetches all rulesets.`,builder:x,handler:async c=>{let l={cursor:c.cursor,per_page:c[`per-page`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.rulesets.accountRulesets.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function C(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <ruleset-phase>`,describe:`Fetches the latest version of the account or zone entry point ruleset for a given phase.`,builder:C,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${c[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(c[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(c[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.phases.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:c[`ruleset-phase`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{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(`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 E={command:`update <ruleset-phase>`,describe:`Updates an account or zone entry point ruleset, creating a new version.`,builder:T,handler:async f=>{let p={dry_run:f[`dry-run`]};if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${f[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(f[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(f[`ruleset-phase`]??``),"account-or-zone-id":String(r)},query:p,bodyKind:`json`,body:f.body===void 0?u({description:d(f.description,`description`,`text`),name:d(f.name,`name`,`text`),rules:l(f.rules,`rules`)}):c(f.body)});return}let m=await i(f),h=f.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:f.zone},m,{quiet:f.quiet}):f.local?e:await t();if(h===`zones`?f.zoneId=g:f.accountId=g,f.body){let e=c(f.body);new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_phase:f[`ruleset-phase`],...p})),{successLabel:`Updated`});return}let _=u({description:d(f.description,`description`,`text`),name:d(f.name,`name`,`text`),rules:l(f.rules,`rules`)});new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_phase:f[`ruleset-phase`],...p})),{successLabel:`Updated`})}};function D(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account or zone entry point ruleset.`,builder:D,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${c[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(c[`ruleset-phase`]))}/entrypoint/versions/${c[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(c[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(c[`ruleset-version`]??``),"ruleset-phase":String(c[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.phases.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:c[`ruleset-phase`],ruleset_version:c[`ruleset-version`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Fetches the versions of an account or zone entry point ruleset.`,builder:k,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${c[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(c[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(c[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.phases.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_phase:c[`ruleset-phase`]})),{successLabel:`Loaded`})}},j={command:`versions`,describe:`Operations for account-rulesets.phases.versions`,builder:e=>e.command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`phases`,describe:`Operations for account-rulesets.phases`,builder:e=>e.command(w).command(E).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{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 P={command:`create <ruleset-id>`,describe:`Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`,builder:N,handler:async l=>{let f={dry_run:l[`dry-run`]};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 account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:f,bodyKind:`json`,body:l.body===void 0?u({position:{before:d(l[`position-before`],`position-before`,`text`),after:d(l[`position-after`],`position-after`,`text`),index:l[`position-index`]}}):c(l.body)});return}let p=await i(l),m=l.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:l.zone},p,{quiet:l.quiet}):l.local?e:await t();if(m===`zones`?l.zoneId=h:l.accountId=h,l.body){let e=c(l.body);new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:l[`ruleset-id`],...f})),{successLabel:`Created`});return}let g=u({position:{before:d(l[`position-before`],`position-before`,`text`),after:d(l[`position-after`],`position-after`,`text`),index:l[`position-index`]}});new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:l[`ruleset-id`],...f})),{successLabel:`Created`})}};function F(e){return e.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(`dry-run`,{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 I={command:`delete <rule-id>`,describe:`Deletes an existing rule from an account or zone ruleset.`,builder:F,handler:async c=>{let l={dry_run:c[`dry-run`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rules/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(c[`rule-id`]??``),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();if(d===`zones`?c.zoneId=f:c.accountId=f,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`],...l})),{successLabel:`Deleted`})}};function L(e){return e.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(`dry-run`,{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 R={command:`update <rule-id>`,describe:`Updates an existing rule in an account or zone ruleset.`,builder:L,handler:async l=>{let f={dry_run:l[`dry-run`]};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 account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:f,bodyKind:`json`,body:l.body===void 0?u({position:{before:d(l[`position-before`],`position-before`,`text`),after:d(l[`position-after`],`position-after`,`text`),index:l[`position-index`]}}):c(l.body)});return}let p=await i(l),m=l.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:l.zone},p,{quiet:l.quiet}):l.local?e:await t();if(m===`zones`?l.zoneId=h:l.accountId=h,l.body){let e=c(l.body);new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...f})),{successLabel:`Updated`});return}let g=u({position:{before:d(l[`position-before`],`position-before`,`text`),after:d(l[`position-after`],`position-after`,`text`),index:l[`position-index`]}});new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...f})),{successLabel:`Updated`})}},z={command:`rules`,describe:`Operations for account-rulesets.rules`,builder:e=>e.command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{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 V={command:`update <ruleset-id>`,describe:`Updates an account or zone ruleset, creating a new version.`,builder:B,handler:async f=>{let p={dry_run:f[`dry-run`]};if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${f[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(f[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(f[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:p,bodyKind:`json`,body:f.body===void 0?u({description:d(f.description,`description`,`text`),name:d(f.name,`name`,`text`),kind:d(f.kind,`kind`,`text`),phase:d(f.phase,`phase`,`text`),rules:l(f.rules,`rules`)}):c(f.body)});return}let m=await i(f),h=f.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:f.zone},m,{quiet:f.quiet}):f.local?e:await t();if(h===`zones`?f.zoneId=g:f.accountId=g,f.body){let e=c(f.body);new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:f[`ruleset-id`],...p})),{successLabel:`Updated`});return}let _=u({description:d(f.description,`description`,`text`),name:d(f.name,`name`,`text`),kind:d(f.kind,`kind`,`text`),phase:d(f.phase,`phase`,`text`),rules:l(f.rules,`rules`)});new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:f[`ruleset-id`],...p})),{successLabel:`Updated`})}};function H(e){return e.option(`ruleset-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(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Fetches the rules of a managed account or zone ruleset version for a given tag.`,builder:H,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions by-tag list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/versions/${c[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(c[`ruleset-version`]))}/by_tag/${c[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(c[`rule-tag`]))}`,pathParams:{"account-or-zone":String(t),"rule-tag":String(c[`rule-tag`]??``),"ruleset-version":String(c[`ruleset-version`]??``),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.versions.byTag.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:c[`ruleset-id`],ruleset_version:c[`ruleset-version`],rule_tag:c[`rule-tag`]})),{successLabel:`Loaded`})}},W={command:`by-tag`,describe:`Operations for account-rulesets.versions.by-tag`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{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 K={command:`delete <ruleset-version>`,describe:`Deletes an existing version of an account or zone ruleset.`,builder:G,handler:async c=>{let l={dry_run:c[`dry-run`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/versions/${c[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(c[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(c[`ruleset-version`]??``),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();if(d===`zones`?c.zoneId=f:c.accountId=f,!await m({force:!!c.force})){process.stderr.write(`Aborted.
5
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:c[`ruleset-id`],ruleset_version:c[`ruleset-version`],...l})),{successLabel:`Deleted`})}};function q(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account or zone ruleset.`,builder:q,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/versions/${c[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(c[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(c[`ruleset-version`]??``),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:c[`ruleset-id`],ruleset_version:c[`ruleset-version`]})),{successLabel:`Loaded`})}};function Y(e){return e.option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`Fetches the versions of an account or zone ruleset.`,builder:Y,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/versions`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(c[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.rulesets.accountRulesets.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:c[`ruleset-id`]})),{successLabel:`Loaded`})}},Z={command:`versions`,describe:`Operations for account-rulesets.versions`,builder:e=>e.command(K).command(J).command(X).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`account-rulesets`,describe:`Operations for account-rulesets`,builder:e=>e.command(g).command(v).command(b).command(S).command(V).command(M).command(z).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{n as d}from"./prompt-B0sWIs9c.mjs";import{t as f}from"./cli-types-DAYeL_Mj.mjs";function p(e){return e.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 m={command:`bulk-create`,describe:`Modifies one or more rules in a Web Analytics ruleset with a single request.`,builder:p,handler:async u=>{if(u.dryRun){a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(u[`ruleset-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({delete_rules:u[`delete-rules`],rules:c(u.rules,`rules`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:u[`ruleset-id`]})),{successLabel:`Created`});return}let p=l({delete_rules:u[`delete-rules`],rules:c(u.rules,`rules`)});i(await o(`Creating`,async()=>d.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:u[`ruleset-id`]})),{successLabel:`Created`})}};function h(e){return e.positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create <ruleset-id>`,describe:`Creates a new rule in a Web Analytics ruleset.`,builder:h,handler:async c=>{if(c.dryRun){a({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({host:u(c.host,`host`,`text`),inclusive:c.inclusive,is_paused:c[`is-paused`],paths:c.paths}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Creating`,async()=>d.rum.rules.create({body:e,account_id:f,ruleset_id:c[`ruleset-id`]})),{successLabel:`Created`});return}let p=l({host:u(c.host,`host`,`text`),inclusive:c.inclusive,is_paused:c[`is-paused`],paths:c.paths});i(await o(`Creating`,async()=>d.rum.rules.create({body:p,account_id:f,ruleset_id:c[`ruleset-id`]})),{successLabel:`Created`})}};function _(e){return e.positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <rule-id>`,describe:`Deletes an existing rule from a Web Analytics ruleset.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${s[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(s[`ruleset-id`]))}/rule/${s[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(s[`rule-id`]))}`,pathParams:{"ruleset-id":String(s[`ruleset-id`]??``),"rule-id":String(s[`rule-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>c.rum.rules.delete({account_id:l,ruleset_id:s[`ruleset-id`],rule_id:s[`rule-id`]})),{successLabel:`Deleted`})}};function y(e){return e.option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists all the rules in a Web Analytics ruleset.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${s[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(s[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(s[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rum.rules.list({account_id:l,ruleset_id:s[`ruleset-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <rule-id>`,describe:`Updates a rule in a Web Analytics ruleset.`,builder:x,handler:async c=>{if(c.dryRun){a({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``),"rule-id":String(c[`rule-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({host:u(c.host,`host`,`text`),inclusive:c.inclusive,is_paused:c[`is-paused`],paths:c.paths}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.rum.rules.update({body:e,account_id:f,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`]})),{successLabel:`Updated`});return}let p=l({host:u(c.host,`host`,`text`),inclusive:c.inclusive,is_paused:c[`is-paused`],paths:c.paths});i(await o(`Updating`,async()=>d.rum.rules.update({body:p,account_id:f,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`]})),{successLabel:`Updated`})}},C={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Creates a new Web Analytics site.`,builder:w,handler:async c=>{if(c.dryRun){a({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({auto_install:c[`auto-install`],host:u(c.host,`host`,`text`),zone_tag:u(c[`zone-tag`],`zone-tag`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Creating`,async()=>d.rum.siteInfo.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({auto_install:c[`auto-install`],host:u(c.host,`host`,`text`),zone_tag:u(c[`zone-tag`],`zone-tag`,`text`)});i(await o(`Creating`,async()=>d.rum.siteInfo.create({...p,account_id:f})),{successLabel:`Created`})}};function E(e){return e.positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <site-id>`,describe:`Deletes an existing Web Analytics site.`,builder:E,handler:async s=>{if(s.dryRun){a({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${s[`site-id`]==null?`<site-id>`:encodeURIComponent(String(s[`site-id`]))}`,pathParams:{"site-id":String(s[`site-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
4
+ `);return}i(await o(`Deleting`,async()=>c.rum.siteInfo.delete({account_id:l,site_id:s[`site-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <site-id>`,describe:`Retrieves a Web Analytics site.`,builder:O,handler:async s=>{if(s.dryRun){a({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${s[`site-id`]==null?`<site-id>`:encodeURIComponent(String(s[`site-id`]))}`,pathParams:{"site-id":String(s[`site-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rum.siteInfo.get({account_id:l,site_id:s[`site-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list-site-tags`,describe:`Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`,builder:A,handler:async s=>{let c={all:s.all};if(s.dryRun){a({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.listSiteTags({account_id:u,...c})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list-zone-tags`,describe:`Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rum.siteInfo.listZoneTags({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all Web Analytics sites of an account.`,builder:f(P),handler:async s=>{let c={per_page:s[`per-page`],page:s.page,order_by:s[`order-by`]};if(s.dryRun){a({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.list({account_id:u,...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`update <site-id>`,describe:`Updates an existing Web Analytics site.`,builder:I,handler:async c=>{if(c.dryRun){a({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({auto_install:c[`auto-install`],enabled:c.enabled,host:u(c.host,`host`,`text`),lite:c.lite,zone_tag:u(c[`zone-tag`],`zone-tag`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.rum.siteInfo.update({...e,account_id:f,site_id:c[`site-id`]})),{successLabel:`Updated`});return}let p=l({auto_install:c[`auto-install`],enabled:c.enabled,host:u(c.host,`host`,`text`),lite:c.lite,zone_tag:u(c[`zone-tag`],`zone-tag`,`text`)});i(await o(`Updating`,async()=>d.rum.siteInfo.update({...p,account_id:f,site_id:c[`site-id`]})),{successLabel:`Updated`})}};function R(e){return e.positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`validate-hostname <hostname>`,describe:`Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`,builder:R,handler:async s=>{if(s.dryRun){a({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/validate/${s.hostname==null?`<hostname>`:encodeURIComponent(String(s.hostname))}`,pathParams:{hostname:String(s.hostname??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.rum.siteInfo.validateHostname({account_id:l,hostname:s.hostname})),{successLabel:`Loaded`})}},B={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(T).command(D).command(k).command(F).command(j).command(N).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(C).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./output-DgW1hQGX.mjs";import{n as t}from"./metadata-8AkOftcB.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const r={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async r=>{let i=t(import.meta.url,`schemas.json`,n);if(i||(console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.entries(i.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}r.command.length===0&&(console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),process.exit(1));let a=r.command.join(` `),o=i.schemas[a];if(!o){let e=Object.keys(i.schemas).filter(e=>e.includes(a)||a.includes(e));if(e.length>0){console.error(`Schema not found for "${a}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${a}". Use --list to see available schemas.`);process.exit(1)}e(o)}};export{r as default};
2
+ import{t as e}from"./output-Ccqw2WOb.mjs";import{n as t}from"./metadata-B5yfL0ln.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const r={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async r=>{let i=t(import.meta.url,`schemas.json`,n);if(i||(console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.entries(i.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}r.command.length===0&&(console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),process.exit(1));let a=r.command.join(` `),o=i.schemas[a];if(!o){let e=Object.keys(i.schemas).filter(e=>e.includes(a)||a.includes(e));if(e.length>0){console.error(`Schema not found for "${a}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${a}". Use --list to see available schemas.`);process.exit(1)}e(o)}};export{r as default};