cf 0.10.0 → 0.12.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 (352) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +13 -5
  3. package/dist/_meta/commands.json +2393 -262
  4. package/dist/_meta/hand-written-commands.json +960 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
  8. package/dist/account-CPbieCZ4.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
  14. package/dist/agent-memory-BrHMIU0E.mjs +6 -0
  15. package/dist/ai-audit-BoZuL84i.mjs +2 -0
  16. package/dist/ai-gateway-DE50Jem1.mjs +13 -0
  17. package/dist/ai-search-Fx7NHCHB.mjs +7 -0
  18. package/dist/ai-security-DyLbY9kv.mjs +4 -0
  19. package/dist/ai-v2fP1r0s.mjs +5 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
  21. package/dist/analytics-BygTfozw.mjs +3 -0
  22. package/dist/analytics_engine-4L-q362P.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
  24. package/dist/argo-TzXPN7tz.mjs +2 -0
  25. package/dist/args-CDgWUP4J.mjs +2 -0
  26. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
  27. package/dist/audit-logs-CqY7zzwv.mjs +2 -0
  28. package/dist/auth-CPLdkOC7.mjs +5 -0
  29. package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
  30. package/dist/billing-DHQuRT8S.mjs +3 -0
  31. package/dist/body-parser-BGVbwPeM.mjs +2 -0
  32. package/dist/bot-management-CfqG79hF.mjs +5 -0
  33. package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
  34. package/dist/brand-protection-DYttrKIM.mjs +3 -0
  35. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
  36. package/dist/browser-run-373D4e1i.mjs +4 -0
  37. package/dist/build-D0ir_S70.mjs +2 -0
  38. package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
  39. package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
  40. package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
  41. package/dist/cf-yPz_IqW6.mjs +18 -0
  42. package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
  44. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
  45. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
  46. package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
  47. package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
  48. package/dist/command-BV87D4tR.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
  50. package/dist/config.d.mts +1451 -1366
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
  53. package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
  54. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
  55. package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
  56. package/dist/containers-BDBsEs7-.mjs +58 -0
  57. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
  58. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
  59. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
  60. package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
  61. package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
  62. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
  63. package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
  64. package/dist/custom-pages-Buki_Cb8.mjs +3 -0
  65. package/dist/d1-n2in0cSF.mjs +20 -0
  66. package/dist/data-security-DzOQMkv3.mjs +7 -0
  67. package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
  68. package/dist/delegate.mjs +1 -1
  69. package/dist/deploy-BUSz35vq.mjs +2 -0
  70. package/dist/deploy-input-BvD9aRP1.mjs +2 -0
  71. package/dist/dev-DY_DquQx.mjs +4 -0
  72. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
  73. package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
  74. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
  75. package/dist/dist-BBx1io2f.mjs +2 -0
  76. package/dist/dist-Cb9TJ2VV.mjs +9 -0
  77. package/dist/dist-DV7LR38l.mjs +387 -0
  78. package/dist/dist-DvizctjW.mjs +48 -0
  79. package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
  80. package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
  81. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-ILZRVpnp.mjs +2 -0
  84. package/dist/durable-objects-DhDL3San.mjs +2 -0
  85. package/dist/email-auth-BROqK6-C.mjs +2 -0
  86. package/dist/email-routing-BZXHDAOO.mjs +6 -0
  87. package/dist/email-security-DVumybrk.mjs +18 -0
  88. package/dist/email-sending-CDQ3_wyz.mjs +7 -0
  89. package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
  90. package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
  91. package/dist/flagship-fFBiZUz-.mjs +4 -0
  92. package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
  93. package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
  94. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
  95. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
  96. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
  97. package/dist/iam-Bk7K_PPO.mjs +6 -0
  98. package/dist/images-BAEFb9q1.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
  101. package/dist/interactive-CRnq-B5I.mjs +11 -0
  102. package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
  103. package/dist/ips-DU0ti0i0.mjs +2 -0
  104. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
  105. package/dist/keys-DqldTZqH.mjs +2 -0
  106. package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
  107. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
  108. package/dist/load-balancers-Dg4pDad1.mjs +6 -0
  109. package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
  110. package/dist/local-runtime--IQr44qq.mjs +2 -0
  111. package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
  112. package/dist/logo-matches-CWUzxY7G.mjs +2 -0
  113. package/dist/logos-BTfdkDPi.mjs +3 -0
  114. package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
  115. package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
  116. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
  117. package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
  118. package/dist/magic-transit-B5skt0G7.mjs +111 -0
  119. package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
  120. package/dist/matches-DeYaB4I0.mjs +2 -0
  121. package/dist/mcp-ChjBiMx2.mjs +4 -0
  122. package/dist/mesh-DRVAFLBX.mjs +4 -0
  123. package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
  124. package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
  125. package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
  126. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
  127. package/dist/oauth-DAa7SwkM.mjs +14 -0
  128. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
  129. package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
  130. package/dist/observability-DnyI8rPJ.mjs +4 -0
  131. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
  132. package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
  133. package/dist/organizations-B3aU-RCG.mjs +2 -0
  134. package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
  135. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
  136. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
  137. package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
  138. package/dist/page-rules-CzbyXbt6.mjs +27 -0
  139. package/dist/pages-CX8yefTI.mjs +14 -0
  140. package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
  141. package/dist/pipelines-BZ1KGupx.mjs +6 -0
  142. package/dist/precursor-D42A9ay5.mjs +4 -0
  143. package/dist/progress-jYW64HY7.mjs +2 -0
  144. package/dist/project-settings-BN7tL0c7.mjs +3 -0
  145. package/dist/prompt-CyATfGUu.mjs +3 -0
  146. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
  147. package/dist/queries-xvETUjUE.mjs +3 -0
  148. package/dist/queues-CpqHDtxF.mjs +6 -0
  149. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
  150. package/dist/r2-jhmLvD1z.mjs +24 -0
  151. package/dist/radar-C2J16wpX.mjs +2 -0
  152. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
  153. package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
  154. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
  155. package/dist/registrar-BI5ewTAk.mjs +23 -0
  156. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
  157. package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
  158. package/dist/reporting-CxsdHAH3.mjs +2 -0
  159. package/dist/request-tracers-DJJCncft.mjs +2 -0
  160. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
  161. package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
  162. package/dist/rules-PpsDU89Q.mjs +4 -0
  163. package/dist/rulesets-DP12Aqik.mjs +5 -0
  164. package/dist/rum-DxvpzJYc.mjs +4 -0
  165. package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
  166. package/dist/schema-flags-CTfQVGCs.mjs +5 -0
  167. package/dist/schemas-BFCBlp_W.mjs +65 -0
  168. package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
  169. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
  170. package/dist/security-center-008FMs_z.mjs +2 -0
  171. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
  172. package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
  173. package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
  174. package/dist/smart-shield-DpFscIk8.mjs +4 -0
  175. package/dist/snippets-CCKgI2ZX.mjs +4 -0
  176. package/dist/spawn-C3_tJ3RB.mjs +526 -0
  177. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
  178. package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
  179. package/dist/src-CEb2fgtT.mjs +108 -0
  180. package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
  181. package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
  182. package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
  183. package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
  184. package/dist/submit-DF2G5CIz.mjs +2 -0
  185. package/dist/tags-nFJJHlLJ.mjs +2 -0
  186. package/dist/tenant-CRLw1oRU.mjs +2 -0
  187. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
  188. package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
  189. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
  190. package/dist/tunnels-iVA3MrdS.mjs +2 -0
  191. package/dist/turnstile-DQHP6-_b.mjs +23 -0
  192. package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
  193. package/dist/url-info-BVgdb_pf.mjs +2 -0
  194. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
  195. package/dist/url-scanner-DwuDZLPk.mjs +2 -0
  196. package/dist/user-I_MbB_KX.mjs +12 -0
  197. package/dist/values-S-Q7-5o8.mjs +2 -0
  198. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
  199. package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
  200. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
  201. package/dist/web3-CdbfoZ2x.mjs +4 -0
  202. package/dist/workers-DQ9Q7czn.mjs +28 -0
  203. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
  204. package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
  205. package/dist/zaraz-DbKvA_8C.mjs +2 -0
  206. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
  207. package/dist/zone-D2zrbJI2.mjs +2 -0
  208. package/dist/zones-DrpxQ_-A.mjs +21 -0
  209. package/package.json +12 -8
  210. package/dist/account-CYRm3yoN.mjs +0 -2
  211. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  212. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  213. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  214. package/dist/ai-search-BmdskMjR.mjs +0 -7
  215. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  216. package/dist/ai-viHB1tgI.mjs +0 -5
  217. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  218. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  219. package/dist/argo-CQfCgazW.mjs +0 -2
  220. package/dist/args-DlUhyGU0.mjs +0 -2
  221. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  222. package/dist/auth-D0xZxAEa.mjs +0 -5
  223. package/dist/billing-aJgapeRm.mjs +0 -3
  224. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  225. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  226. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  227. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  228. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  229. package/dist/build-DcflwvqN.mjs +0 -2
  230. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  231. package/dist/cf-C7DU4819.mjs +0 -18
  232. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  233. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  234. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  235. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  236. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  237. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  238. package/dist/containers-CKW081JA.mjs +0 -54
  239. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  240. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  241. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  242. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  243. package/dist/d1-BFvMd6-S.mjs +0 -20
  244. package/dist/data-security-Bji4Or_j.mjs +0 -7
  245. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  246. package/dist/deploy-CZ7bgNDu.mjs +0 -2
  247. package/dist/dev-V10MG-Bg.mjs +0 -4
  248. package/dist/dist-CgrMkXFx.mjs +0 -72
  249. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  250. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  251. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  252. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  253. package/dist/email-sending-dn-353Nx.mjs +0 -7
  254. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  255. package/dist/flagship-BusjRNIb.mjs +0 -4
  256. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  257. package/dist/iam-Cj63Kjc6.mjs +0 -6
  258. package/dist/images-CBWXCDhy.mjs +0 -8
  259. package/dist/ips-qs9eGJnI.mjs +0 -2
  260. package/dist/keys-D7N0j4-x.mjs +0 -2
  261. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  262. package/dist/local-runtime-Dh3keC5v.mjs +0 -2
  263. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  264. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  265. package/dist/logos-BS65zN8q.mjs +0 -3
  266. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  267. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  268. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  269. package/dist/matches-InA1hwII.mjs +0 -2
  270. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  271. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  272. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  273. package/dist/oauth-B0ETkNcX.mjs +0 -15
  274. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  275. package/dist/observability-BWE0Gg3V.mjs +0 -4
  276. package/dist/organizations-DLhiRt8g.mjs +0 -2
  277. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  278. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  279. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  280. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  281. package/dist/pages-DVDogxPs.mjs +0 -14
  282. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  283. package/dist/pipelines-BszRk4sM.mjs +0 -6
  284. package/dist/precursor-BPNjQr76.mjs +0 -4
  285. package/dist/progress-CsHIt3Tp.mjs +0 -2
  286. package/dist/prompt-DdegNPpg.mjs +0 -3
  287. package/dist/queries-JL1H1Biz.mjs +0 -3
  288. package/dist/queues-DpkYdRUE.mjs +0 -6
  289. package/dist/r2-CKozthw_.mjs +0 -24
  290. package/dist/radar-C-92vggG.mjs +0 -2
  291. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  292. package/dist/registrar-DKKN0M29.mjs +0 -21
  293. package/dist/reporting-fg_GKXe1.mjs +0 -2
  294. package/dist/request-tracers-CkMya96z.mjs +0 -2
  295. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  296. package/dist/rules-BTmNjDN-.mjs +0 -4
  297. package/dist/rulesets-CsoSM-17.mjs +0 -5
  298. package/dist/rum-DB4iO2q5.mjs +0 -4
  299. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  300. package/dist/security-center-DFKeHq5c.mjs +0 -2
  301. package/dist/session-D6KHthHf.mjs +0 -2
  302. package/dist/shared-VppSAQf4.mjs +0 -2
  303. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  304. package/dist/snippets-DIpc9pb_.mjs +0 -4
  305. package/dist/spawn-O1RS01vr.mjs +0 -523
  306. package/dist/src-D_HETJNy.mjs +0 -108
  307. package/dist/submit--xTzyNPy.mjs +0 -2
  308. package/dist/tags-efICDkah.mjs +0 -2
  309. package/dist/tenant-CerHuToJ.mjs +0 -2
  310. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  311. package/dist/triggers-BEsiiKAf.mjs +0 -2
  312. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  313. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  314. package/dist/url-info-DBCeRWwb.mjs +0 -2
  315. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  316. package/dist/user-bifVEQq5.mjs +0 -12
  317. package/dist/values-OxkdP1tV.mjs +0 -2
  318. package/dist/versions-BVL-Ludh.mjs +0 -2
  319. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  320. package/dist/web3-y_cY91V_.mjs +0 -4
  321. package/dist/workers-jDcq14GH.mjs +0 -24
  322. package/dist/zaraz-27zwjLvv.mjs +0 -2
  323. package/dist/zone-BJix2KQ9.mjs +0 -2
  324. package/dist/zones-Bkj5i92c.mjs +0 -21
  325. /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
  326. /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
  327. /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
  328. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  329. /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
  330. /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
  331. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
  332. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
  333. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
  334. /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
  335. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
  336. /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
  337. /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
  338. /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
  339. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
  340. /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
  341. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
  342. /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
  343. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
  344. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
  345. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
  346. /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
  347. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
  348. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
  349. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  350. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
  351. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
  352. /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,r as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d}from"./input-validation-Bav2M9F-.mjs";import{a as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.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,7 +47,7 @@ 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
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.
@@ -58,4 +58,4 @@ 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-C7DU4819.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-yPz_IqW6.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s}from"./body-parser-BGVbwPeM.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u}from"./prompt-CyATfGUu.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-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s}from"./body-parser-C-c9gfH1.mjs";import{n as c}from"./prompt-DdegNPpg.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s}from"./body-parser-BGVbwPeM.mjs";import{n as c}from"./prompt-CyATfGUu.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,n as f}from"./prompt-CyATfGUu.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-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,i as p,n as m}from"./prompt-CyATfGUu.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-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{n as d}from"./prompt-CyATfGUu.mjs";import{t as f}from"./cli-types-C3nVfpSG.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-DrpYYfnB.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-BqDR9h74.mjs";import{n as t}from"./metadata-DEqBUaSv.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};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{c as e}from"./project-settings-BN7tL0c7.mjs";import{a as t}from"./theme-CrIBazAF.mjs";import{i as n}from"./cf-yPz_IqW6.mjs";import{i as r}from"./body-parser-BGVbwPeM.mjs";import{n as i}from"./input-validation-1esLElok.mjs";import{o as a}from"./prompt-CyATfGUu.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{isDeepStrictEqual as l}from"node:util";import{dirname as u,join as d}from"node:path";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(t,r){let i=f(`sha256`).update([e,...r].join(` `)).digest(`hex`).slice(0,32);return d(n(),`cache`,t,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(u(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
3
+ `)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=new Set(`$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>l(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>l(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0?!0:A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
4
+ `)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[...new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:l(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=new Map,i=new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,u=s.then?O(s.then):void 0,d=u?.required;if(!c||!d?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>l(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(!(!_||g.length===0))for(let s of d){let c=[...t,s].join(`.`);if(n.has(c))continue;let d={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(u?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>l(e,d))&&(f.requiredIf=[...f.requiredIf??[],d])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(e,n){if(e.length===0)return`${t.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=e.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=e.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[t.brand(a(n)),...s].join(`
5
+ `)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>l(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>l(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`?!0:t===`false`?!1:r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!l(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>l(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${r} must be greater than ${u}`:`--${r} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${r} must be less than ${d}`:`--${r} must be at most ${d}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!l(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>l(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>l(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`))if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`))if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=new Set([...ve,...t]),r=new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};