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,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d,t as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,n as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";import{n as ee,t as te}from"./raw-fetch-CteyTOM2.mjs";function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete`,describe:`Delete DNSSEC.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>t.dns.dnssec.delete({zone_id:n})),{successLabel:`Deleted`})}};function v(e){return e.option(`dnssec-multi-signer`,{type:`boolean`,description:`If true, multi-signer DNSSEC is enabled on the zone, allowing multiple
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,n as h}from"./prompt-CyATfGUu.mjs";import{t as g}from"./cli-types-C3nVfpSG.mjs";import{n as ee,t as te}from"./raw-fetch-CNKIypJ7.mjs";function _(e){return e.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`,describe:`Delete DNSSEC.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>t.dns.dnssec.delete({zone_id:n})),{successLabel:`Deleted`})}};function y(e){return e.option(`dnssec-multi-signer`,{type:`boolean`,description:`If true, multi-signer DNSSEC is enabled on the zone, allowing multiple
4
4
  providers to serve a DNSSEC-signed zone at the same time.
5
5
  This is required for DNSKEY records (except those automatically
6
6
  generated by Cloudflare) to be added to the zone.
@@ -16,14 +16,14 @@ NSEC3 records when transferring in from an external provider.
16
16
  If dnssec_presigned is instead set to false (default), NSEC3 records will be
17
17
  generated and signed at request time.
18
18
 
19
- See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details.`}).option(`status`,{type:`string`,description:`Status of DNSSEC, based on user-desired state and presence of necessary records.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`edit`,describe:`Enable or disable DNSSEC.`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:d(e.status,`status`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.dnssec.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let i=u({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:d(e.status,`status`,`text`)});o(await c(`Updating`,async()=>t.dns.dnssec.edit({...i,zone_id:n})),{successLabel:`Updated`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Details about DNSSEC status and configuration.`,builder:b,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.dnssec.get({zone_id:n})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`zsks`,describe:`List the Zone Signing Keys (ZSKs) that DNSSEC uses for the zone.`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec list zsks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec/zsk`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.dnssec.list.zsks({zone_id:n})),{successLabel:`Loaded`})}},w={command:`list`,describe:`Operations for dnssec.list`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`dnssec`,describe:`Operations for dnssec`,builder:e=>e.command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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:`batch`,describe:`Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records") for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts`,builder:E,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>n.dns.records.batch({...r,zone_id:i,...t})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n.dns.records.batch({zone_id:i,...t})),{successLabel:`Created`})}};function O(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Create a new DNS record for a zone. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:O,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>n.dns.records.create({body:r,zone_id:i,...t})),{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 A(e){return e.positional(`dns-record-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 j={command:`delete <dns-record-id>`,describe:`Permanently removes a DNS record from the zone.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf dns records delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
20
- `);return}o(await c(`Deleting`,async()=>t.dns.records.delete({zone_id:n,dns_record_id:e[`dns-record-id`]})),{successLabel:`Deleted`})}};function M(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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 N={command:`edit <dns-record-id>`,describe:`Update an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:M,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Updating`,async()=>n.dns.records.edit({body:r,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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.`)}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`export`,describe:`You can export your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:P,handler:async e=>{if(e.dryRun){s({command:`cf dns records export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/export`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e);e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),ee((await c(`Loading`,async()=>te(`/zones/${e.zoneId}/dns_records/export`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}))).toString(`utf-8`))}};function I(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <dns-record-id>`,describe:`Retrieves details for a specific DNS record in the zone.`,builder:I,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.dns.records.get({zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{successLabel:`Loaded`})}};function R(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`proxied`,{type:`string`,description:"Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`."})}const z={command:`import`,describe:`You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:R,handler:async e=>{if(e.dryRun){s({command:`cf dns records import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/import`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,proxied:e.proxied}});return}let t=await a(e);if(e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),e.file!==void 0||e.body!==void 0||e.proxied!==void 0){let n=new FormData;if(e.file){let t=f(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e.proxied!==void 0&&n.append(`proxied`,String(d(e.proxied,`proxied`,`text`)??``)),o(await c(`Creating`,async()=>i(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=d(e.body,`body`,`binary`);o(await c(`Creating`,async()=>i(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{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 B(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS record name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS record name. Name filters are case-insensitive.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS record name. Name filters are case-insensitive.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS record name. Name filters are case-insensitive.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS record name. Name filters are case-insensitive.`}).option(`type`,{type:`string`,description:`Record type.`,choices:[`A`,`AAAA`,`CAA`,`CERT`,`CNAME`,`DNSKEY`,`DS`,`HTTPS`,`LOC`,`MX`,`NAPTR`,`NS`,`OPENPGPKEY`,`PTR`,`SMIMEA`,`SRV`,`SSHFP`,`SVCB`,`TLSA`,`TXT`,`URI`]}).option(`content`,{type:`string`,description:"Exact value of the DNS record content. This is a convenience alias for `content.exact`."}).option(`content-exact`,{type:`string`,description:`Exact value of the DNS record content. Content filters are case-insensitive.`}).option(`content-contains`,{type:`string`,description:`Substring of the DNS record content. Content filters are case-insensitive.`}).option(`content-startswith`,{type:`string`,description:`Prefix of the DNS record content. Content filters are case-insensitive.`}).option(`content-endswith`,{type:`string`,description:`Suffix of the DNS record content. Content filters are case-insensitive.`}).option(`proxied`,{type:`boolean`,description:`Whether the record is receiving the performance and security benefits of Cloudflare.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.",choices:[`any`,`all`]}).option(`comment`,{type:`string`,description:"Exact value of the DNS record comment. This is a convenience alias for `comment.exact`."}).option(`comment-present`,{type:`string`,description:`If this parameter is present, only records *with* a comment are returned.`}).option(`comment-absent`,{type:`string`,description:`If this parameter is present, only records *without* a comment are returned.`}).option(`comment-exact`,{type:`string`,description:`Exact value of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-contains`,{type:`string`,description:`Substring of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-startswith`,{type:`string`,description:`Prefix of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-endswith`,{type:`string`,description:`Suffix of the DNS record comment. Comment filters are case-insensitive.`}).option(`tag`,{type:`string`,description:"Condition on the DNS record tag.\n\nParameter values can be of the form `<tag-name>:<tag-value>` to search for an exact `name:value` pair, or just `<tag-name>` to search for records with a specific tag name regardless of its value.\n\nThis is a convenience shorthand for the more powerful `tag.<predicate>` parameters.\nExamples:\n- `tag=important` is equivalent to `tag.present=important`\n- `tag=team:DNS` is equivalent to `tag.exact=team:DNS`"}).option(`tag-present`,{type:`string`,description:`Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-absent`,{type:`string`,description:`Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-exact`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value is `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-contains`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value contains `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-startswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value starts with `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-endswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value ends with `<tag-value>`. Tag filters are case-insensitive."}).option(`search`,{type:`string`,description:"Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters."}).option(`tag-match`,{type:`string`,description:"Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS records per page.`}).option(`order`,{type:`string`,description:`Field to order DNS records by.`,choices:[`type`,`name`,`content`,`ttl`,`proxied`]}).option(`direction`,{type:`string`,description:`Direction to order DNS records in.`,choices:[`asc`,`desc`]}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowed-by-name`,{type:`string`,description:"Filters to records at or below the given NS delegation name, excluding the NS records that form the delegation itself. The value must be a subdomain of the zone; the zone apex is not accepted. Requires `include_shadow_metadata=true`. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowing-name`,{type:`string`,description:`Returns NS records that shadow the given name, searching at the name itself and each of its ancestor names within the zone, excluding the zone apex. The value must be a subdomain of the zone; the zone apex is not accepted. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`List, search, sort, and filter a zones' DNS records.`,builder:h(B),handler:async e=>{let t={name:e.name,"name.exact":e[`name-exact`],"name.contains":e[`name-contains`],"name.startswith":e[`name-startswith`],"name.endswith":e[`name-endswith`],type:e.type,content:e.content,"content.exact":e[`content-exact`],"content.contains":e[`content-contains`],"content.startswith":e[`content-startswith`],"content.endswith":e[`content-endswith`],proxied:e.proxied,match:e.match,comment:e.comment,"comment.present":e[`comment-present`],"comment.absent":e[`comment-absent`],"comment.exact":e[`comment-exact`],"comment.contains":e[`comment-contains`],"comment.startswith":e[`comment-startswith`],"comment.endswith":e[`comment-endswith`],tag:e.tag,"tag.present":e[`tag-present`],"tag.absent":e[`tag-absent`],"tag.exact":e[`tag-exact`],"tag.contains":e[`tag-contains`],"tag.startswith":e[`tag-startswith`],"tag.endswith":e[`tag-endswith`],search:e.search,tag_match:e[`tag-match`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,include_shadow_metadata:e[`include-shadow-metadata`],shadowed_by_name:e[`shadowed-by-name`],shadowing_name:e[`shadowing-name`]};if(e.dryRun){s({command:`cf dns records list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.dns.records.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`scan-list`,describe:"Retrieves the list of DNS records discovered up to this point by the asynchronous scan. These records are temporary until explicitly accepted or rejected via `POST /scan/review`. Additional records may be discovered by the scan later.",builder:H,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.records.scanList({zone_id:n})),{successLabel:`Loaded`})}};function W(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 G={command:`scan-review`,describe:`Accept or reject DNS records found by the DNS records scan. Accepted records will be permanently added to the zone, while rejected records will be permanently deleted.`,builder:W,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.records.scanReview({...r,zone_id:n})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>t.dns.records.scanReview({zone_id:n})),{successLabel:`Created`})}};function K(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`scan-trigger`,describe:"Initiates an asynchronous scan for common DNS records on your domain. Note that this **does not** automatically add records to your zone. The scan runs in the background, and results can be reviewed later using the `/scan/review` endpoints. Useful if you haven't updated your nameservers yet.",builder:K,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-trigger`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/trigger`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.records.scanTrigger({zone_id:n})),{successLabel:`Created`})}};function J(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`scan`,describe:`Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.`,builder:J,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.records.scan({zone_id:n})),{successLabel:`Created`})}};function X(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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 Z={command:`update <dns-record-id>`,describe:`Overwrite an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:X,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Updating`,async()=>n.dns.records.update({body:r,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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.`)}},Q={command:`records`,describe:`Operations for records`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).command(L).command(z).command(V).command(Y).command(U).command(G).command(q).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`enforce-dns-only`,{type:`boolean`,description:`When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record's individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on [Enforce DNS-only](https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only).`}).option(`zone-defaults-flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`zone-defaults-foundation-dns`,{type:`boolean`,description:`Deprecated. Use nameservers.type to configure Advanced Nameservers.`}).option(`zone-defaults-internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`zone-defaults-multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`zone-defaults-ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`zone-defaults-secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`zone-defaults-soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`zone-defaults-soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`zone-defaults-soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`zone-defaults-soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`zone-defaults-soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`zone-defaults-soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`zone-defaults-soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-defaults-zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`zone-defaults-nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`cloudflare.advanced`,`cloudflare.standard.random`,`custom.account`,`custom.tenant`]}).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 re={command:`edit`,describe:`Update DNS settings for an account or zone`,builder:ne,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns settings account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?u({enforce_dns_only:i[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:i[`zone-defaults-flatten-all-cnames`],foundation_dns:i[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:d(i[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:i[`zone-defaults-multi-provider`],ns_ttl:i[`zone-defaults-ns-ttl`],secondary_overrides:i[`zone-defaults-secondary-overrides`],soa:{expire:i[`zone-defaults-soa-expire`],min_ttl:i[`zone-defaults-soa-min-ttl`],mname:d(i[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:i[`zone-defaults-soa-refresh`],retry:i[`zone-defaults-soa-retry`],rname:d(i[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:i[`zone-defaults-soa-ttl`]},zone_mode:d(i[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:d(i[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}}):l(i.body)});return}let f=await a(i),p=i.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:i.zone},f,{quiet:i.quiet}):i.local?e:await t();if(p===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>f.dns.settings.account.edit({...e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Updated`});return}let h=u({enforce_dns_only:i[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:i[`zone-defaults-flatten-all-cnames`],foundation_dns:i[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:d(i[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:i[`zone-defaults-multi-provider`],ns_ttl:i[`zone-defaults-ns-ttl`],secondary_overrides:i[`zone-defaults-secondary-overrides`],soa:{expire:i[`zone-defaults-soa-expire`],min_ttl:i[`zone-defaults-soa-min-ttl`],mname:d(i[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:i[`zone-defaults-soa-refresh`],retry:i[`zone-defaults-soa-retry`],rname:d(i[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:i[`zone-defaults-soa-ttl`]},zone_mode:d(i[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:d(i[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}});o(await c(`Updating`,async()=>f.dns.settings.account.edit({...h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get`,describe:`Show DNS settings for an account or zone`,builder:ie,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns settings account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.dns.settings.account.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function oe(e){return e.option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).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 se={command:`create`,describe:`Create Internal DNS View for an account`,builder:oe,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({name:d(r.name,`name`,`text`),zones:r.zones}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.settings.account.views.create({...e,account_id:f})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await p(`name`,`The name of the view.`)),r.zones===void 0)throw Error(`--zones is required (or pass --body with this field set).`);let m=u({name:d(r.name,`name`,`text`),zones:r.zones});o(await c(`Creating`,async()=>i.dns.settings.account.views.create({...m,account_id:f})),{successLabel:`Created`})}};function ce(e){return e.positional(`view-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 le={command:`delete <view-id>`,describe:`Delete an existing Internal DNS View`,builder:ce,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
21
- `);return}o(await c(`Deleting`,async()=>i.dns.settings.account.views.delete({account_id:l,view_id:r[`view-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).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 de={command:`edit <view-id>`,describe:`Update an existing Internal DNS View`,builder:ue,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({name:d(r.name,`name`,`text`),zones:r.zones}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.settings.account.views.edit({...e,account_id:f,view_id:r[`view-id`]})),{successLabel:`Updated`});return}let p=u({name:d(r.name,`name`,`text`),zones:r.zones});o(await c(`Updating`,async()=>i.dns.settings.account.views.edit({...p,account_id:f,view_id:r[`view-id`]})),{successLabel:`Updated`})}};function fe(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`get <view-id>`,describe:`Get DNS Internal View`,builder:fe,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.settings.account.views.get({account_id:l,view_id:r[`view-id`]})),{successLabel:`Loaded`})}};function me(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS view name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS view name.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS view name.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS view name.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS view name.`}).option(`zone-id`,{type:`string`,description:`A zone ID that exists in the zones list for the view.`}).option(`zone-name`,{type:`string`,description:`A zone name that exists in the zones list for the view.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS views per page.`}).option(`order`,{type:`string`,description:`Field to order DNS views by.`,choices:[`name`,`created_on`,`modified_on`]}).option(`direction`,{type:`string`,description:`Direction to order DNS views in.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`List DNS Internal Views for an Account`,builder:h(me),handler:async r=>{let i={name:r.name,"name.exact":r[`name-exact`],"name.contains":r[`name-contains`],"name.startswith":r[`name-startswith`],"name.endswith":r[`name-endswith`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],match:r.match,page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){s({command:`cf dns settings account views list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.dns.settings.account.views.list({account_id:u,...i})),{successLabel:`Loaded`})}},ge={command:`views`,describe:`Operations for settings.account.views`,builder:e=>e.command(se).command(le).command(de).command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`account`,describe:`Operations for settings.account`,builder:e=>e.command(re).command(ae).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ve={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get`,describe:`Get the current DNS record usage and quota for an account or zone. May include internal DNS usage and quota.`,builder:ye,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns usage account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_records/usage`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.dns.usage.account.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},xe={command:`account`,describe:`Operations for usage.account`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 we={command:`create`,describe:`Create ACL.`,builder:Ce,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({ip_range:d(r[`ip-range`],`ip-range`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.acls.create({...e,account_id:f})),{successLabel:`Created`});return}r[`ip-range`]===void 0&&(r[`ip-range`]=await p(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),r.name===void 0&&(r.name=await p(`name`,`The name of the acl.`));let m=u({ip_range:d(r[`ip-range`],`ip-range`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.acls.create({...m,account_id:f})),{successLabel:`Created`})}};function Te(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,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 Ee={command:`delete <acl-id>`,describe:`Delete ACL.`,builder:Te,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
22
- `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.acls.delete({account_id:l,acl_id:r[`acl-id`]})),{successLabel:`Deleted`})}};function De(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`get <acl-id>`,describe:`Get ACL.`,builder:De,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.acls.get({account_id:l,acl_id:r[`acl-id`]})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`list`,describe:`List ACLs.`,builder:ke,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.acls.list({account_id:l})),{successLabel:`Loaded`})}};function je(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 Me={command:`update <acl-id>`,describe:`Modify ACL.`,builder:je,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({ip_range:d(r[`ip-range`],`ip-range`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.acls.update({body:e,account_id:f,acl_id:r[`acl-id`]})),{successLabel:`Updated`});return}r[`ip-range`]===void 0&&(r[`ip-range`]=await p(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),r.name===void 0&&(r.name=await p(`name`,`The name of the acl.`));let m=u({ip_range:d(r[`ip-range`],`ip-range`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.acls.update({body:m,account_id:f,acl_id:r[`acl-id`]})),{successLabel:`Updated`})}},Ne={command:`acls`,describe:`Operations for zone-transfers.acls`,builder:e=>e.command(we).command(Ee).command(Oe).command(Ae).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`create`,describe:`Sends AXFR zone transfer request to primary nameserver(s).`,builder:Pe,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers force-axfr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/force_axfr`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.forceAxfr.create({zone_id:n})),{successLabel:`Created`})}},Ie={command:`force-axfr`,describe:`Operations for zone-transfers.force-axfr`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
23
- Not applicable for primary zones.`,default:86400}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 Re={command:`create`,describe:`Create secondary zone configuration for incoming zone transfers.`,builder:Le,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({auto_refresh_seconds:e[`auto-refresh-seconds`],name:d(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.zoneTransfers.incoming.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await p(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=u({auto_refresh_seconds:e[`auto-refresh-seconds`],name:d(e.name,`name`,`text`),peers:e.peers});o(await c(`Creating`,async()=>t.dns.zoneTransfers.incoming.create({body:i,zone_id:n})),{successLabel:`Created`})}};function ze(e){return e.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 Be={command:`delete`,describe:`Delete secondary zone configuration for incoming zone transfers.`,builder:ze,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
24
- `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.incoming.delete({zone_id:n})),{successLabel:`Deleted`})}};function Ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`get`,describe:`Get secondary zone configuration for incoming zone transfers.`,builder:Ve,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.incoming.get({zone_id:n})),{successLabel:`Loaded`})}};function Ue(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
25
- Not applicable for primary zones.`}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 We={command:`update`,describe:`Update secondary zone configuration for incoming zone transfers.`,builder:Ue,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({auto_refresh_seconds:e[`auto-refresh-seconds`],name:d(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.zoneTransfers.incoming.update({body:r,zone_id:n})),{successLabel:`Updated`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await p(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=u({auto_refresh_seconds:e[`auto-refresh-seconds`],name:d(e.name,`name`,`text`),peers:e.peers});o(await c(`Updating`,async()=>t.dns.zoneTransfers.incoming.update({body:i,zone_id:n})),{successLabel:`Updated`})}},Ge={command:`incoming`,describe:`Operations for zone-transfers.incoming`,builder:e=>e.command(Re).command(Be).command(He).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ke(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 qe={command:`create`,describe:`Create primary zone configuration for outgoing zone transfers.`,builder:Ke,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await p(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=u({name:d(e.name,`name`,`text`),peers:e.peers});o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.create({body:i,zone_id:n})),{successLabel:`Created`})}};function Je(e){return e.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 Ye={command:`delete`,describe:`Delete primary zone configuration for outgoing zone transfers.`,builder:Je,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
26
- `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.delete({zone_id:n})),{successLabel:`Deleted`})}};function Xe(e){return e.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 Ze={command:`disable`,describe:`Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.`,builder:Xe,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force,message:`This operation turns off outgoing zone transfers for the primary zone, which means secondary zones will stop receiving updates.`})){process.stderr.write(`Aborted.
27
- `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.disable({zone_id:n})),{successLabel:`Deleted`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`enable`,describe:`Enable outgoing zone transfers for primary zone.`,builder:Qe,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.enable({zone_id:n})),{successLabel:`Created`})}};function et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`force-notify`,describe:`Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.`,builder:et,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing force-notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/force_notify`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.forceNotify({zone_id:n})),{successLabel:`Created`})}};function nt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`get`,describe:`Get primary zone configuration for outgoing zone transfers.`,builder:nt,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.outgoing.get({zone_id:n})),{successLabel:`Loaded`})}};function it(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const at={command:`get`,describe:`Get primary zone transfer status.`,builder:it,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/status`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.outgoing.status.get({zone_id:n})),{successLabel:`Loaded`})}},ot={command:`status`,describe:`Operations for zone-transfers.outgoing.status`,builder:e=>e.command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 ct={command:`update`,describe:`Update primary zone configuration for outgoing zone transfers.`,builder:st,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.zoneTransfers.outgoing.update({body:r,zone_id:n})),{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await p(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=u({name:d(e.name,`name`,`text`),peers:e.peers});o(await c(`Updating`,async()=>t.dns.zoneTransfers.outgoing.update({body:i,zone_id:n})),{successLabel:`Updated`})}},lt={command:`outgoing`,describe:`Operations for zone-transfers.outgoing`,builder:e=>e.command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).command(ct).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ut(e){return e.option(`name`,{type:`string`,description:`The name of the peer.`}).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 dt={command:`create`,describe:`Create Peer.`,builder:ut,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.peers.create({...e,account_id:f})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await p(`name`,`The name of the peer.`));let m=u({name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.peers.create({...m,account_id:f})),{successLabel:`Created`})}};function ft(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,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 pt={command:`delete <peer-id>`,describe:`Delete Peer.`,builder:ft,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
28
- `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.peers.delete({account_id:l,peer_id:r[`peer-id`]})),{successLabel:`Deleted`})}};function mt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`get <peer-id>`,describe:`Get Peer.`,builder:mt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.peers.get({account_id:l,peer_id:r[`peer-id`]})),{successLabel:`Loaded`})}};function gt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _t={command:`list`,describe:`List Peers.`,builder:gt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.peers.list({account_id:l})),{successLabel:`Loaded`})}};function vt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`ip`,{type:`string`,description:`IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to.`}).option(`ixfr-enable`,{type:`boolean`,description:`Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones.`}).option(`name`,{type:`string`,description:`The name of the peer.`}).option(`port`,{type:`number`,description:`DNS port of primary or secondary nameserver, depending on what zone this peer is linked to.`}).option(`tsig-id`,{type:`string`,description:`TSIG authentication will be used for zone transfer if configured.`}).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 yt={command:`update <peer-id>`,describe:`Modify Peer.`,builder:vt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({ip:d(r.ip,`ip`,`text`),ixfr_enable:r[`ixfr-enable`],name:d(r.name,`name`,`text`),port:r.port,tsig_id:d(r[`tsig-id`],`tsig-id`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.peers.update({body:e,account_id:f,peer_id:r[`peer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await p(`name`,`The name of the peer.`));let m=u({ip:d(r.ip,`ip`,`text`),ixfr_enable:r[`ixfr-enable`],name:d(r.name,`name`,`text`),port:r.port,tsig_id:d(r[`tsig-id`],`tsig-id`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.peers.update({body:m,account_id:f,peer_id:r[`peer-id`]})),{successLabel:`Updated`})}},$={command:`peers`,describe:`Operations for zone-transfers.peers`,builder:e=>e.command(dt).command(pt).command(ht).command(_t).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bt(e){return e.option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).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 xt={command:`create`,describe:`Create TSIG.`,builder:bt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({algo:d(r.algo,`algo`,`text`),name:d(r.name,`name`,`text`),secret:d(r.secret,`secret`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.tsigs.create({body:e,account_id:f})),{successLabel:`Created`});return}r.algo===void 0&&(r.algo=await p(`algo`,`TSIG algorithm.`)),r.name===void 0&&(r.name=await p(`name`,`TSIG key name.`)),r.secret===void 0&&(r.secret=await p(`secret`,`TSIG secret.`,{kind:`secret`}));let m=u({algo:d(r.algo,`algo`,`text`),name:d(r.name,`name`,`text`),secret:d(r.secret,`secret`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.tsigs.create({body:m,account_id:f})),{successLabel:`Created`})}};function St(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,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 Ct={command:`delete <tsig-id>`,describe:`Delete TSIG.`,builder:St,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
29
- `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.tsigs.delete({account_id:l,tsig_id:r[`tsig-id`]})),{successLabel:`Deleted`})}};function wt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tt={command:`get <tsig-id>`,describe:`Get TSIG.`,builder:wt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.tsigs.get({account_id:l,tsig_id:r[`tsig-id`]})),{successLabel:`Loaded`})}};function Et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dt={command:`list`,describe:`List TSIGs.`,builder:Et,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.tsigs.list({account_id:l})),{successLabel:`Loaded`})}};function Ot(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).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 kt={command:`update <tsig-id>`,describe:`Modify TSIG.`,builder:Ot,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({algo:d(r.algo,`algo`,`text`),name:d(r.name,`name`,`text`),secret:d(r.secret,`secret`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.tsigs.update({body:e,account_id:f,tsig_id:r[`tsig-id`]})),{successLabel:`Updated`});return}r.algo===void 0&&(r.algo=await p(`algo`,`TSIG algorithm.`)),r.name===void 0&&(r.name=await p(`name`,`TSIG key name.`)),r.secret===void 0&&(r.secret=await p(`secret`,`TSIG secret.`,{kind:`secret`}));let m=u({algo:d(r.algo,`algo`,`text`),name:d(r.name,`name`,`text`),secret:d(r.secret,`secret`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.tsigs.update({body:m,account_id:f,tsig_id:r[`tsig-id`]})),{successLabel:`Updated`})}},At={command:`tsigs`,describe:`Operations for zone-transfers.tsigs`,builder:e=>e.command(xt).command(Ct).command(Tt).command(Dt).command(kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jt={command:`zone-transfers`,describe:`Operations for zone-transfers`,builder:e=>e.command(Ne).command(Ie).command(Ge).command(lt).command($).command(At).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Mt={command:`dns`,describe:`dns`,builder:e=>e.command(T).command(Q).command(ve).command(Se).command(jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Mt as default};
19
+ See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details.`}).option(`status`,{type:`string`,description:`Status of DNSSEC, based on user-desired state and presence of necessary records.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`edit`,describe:`Enable or disable DNSSEC.`,builder:y,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:f(e.status,`status`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.dnssec.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let i=d({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:f(e.status,`status`,`text`)});o(await c(`Updating`,async()=>t.dns.dnssec.edit({...i,zone_id:n})),{successLabel:`Updated`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Details about DNSSEC status and configuration.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.dnssec.get({zone_id:n})),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`zsks`,describe:`List the Zone Signing Keys (ZSKs) that DNSSEC uses for the zone.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec list zsks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec/zsk`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.dnssec.list.zsks({zone_id:n})),{successLabel:`Loaded`})}},T={command:`list`,describe:`Operations for dnssec.list`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`dnssec`,describe:`Operations for dnssec`,builder:e=>e.command(v).command(b).command(S).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`deletes`,{type:`string`,description:`The deletes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`The patches field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`The posts field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`The puts field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`batch`,describe:`Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records") for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts`,builder:D,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?d({deletes:u(e.deletes,`deletes`),patches:u(e.patches,`patches`),posts:u(e.posts,`posts`),puts:u(e.puts,`puts`)}):l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>n.dns.records.batch({...r,zone_id:i,...t})),{successLabel:`Created`});return}let f=d({deletes:u(e.deletes,`deletes`),patches:u(e.patches,`patches`),posts:u(e.posts,`posts`),puts:u(e.puts,`puts`)});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>n.dns.records.batch({...f,zone_id:i,...t})),{successLabel:`Created`})}};function k(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Create a new DNS record for a zone. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:k,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>n.dns.records.create({body:r,zone_id:i,...t})),{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 j(e){return e.positional(`dns-record-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 M={command:`delete <dns-record-id>`,describe:`Permanently removes a DNS record from the zone.`,builder:j,handler:async e=>{if(e.dryRun){s({command:`cf dns records delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
20
+ `);return}o(await c(`Deleting`,async()=>t.dns.records.delete({zone_id:n,dns_record_id:e[`dns-record-id`]})),{successLabel:`Deleted`})}};function N(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`edit <dns-record-id>`,describe:`Update an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:N,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Updating`,async()=>n.dns.records.edit({body:r,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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.`)}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`export`,describe:`You can export your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf dns records export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/export`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e);e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),ee((await c(`Loading`,async()=>te(`/zones/${e.zoneId}/dns_records/export`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}))).toString(`utf-8`))}};function L(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <dns-record-id>`,describe:`Retrieves details for a specific DNS record in the zone.`,builder:L,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.dns.records.get({zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{successLabel:`Loaded`})}};function z(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`proxied`,{type:`string`,description:"Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`."})}const B={command:`import`,describe:`You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:z,handler:async e=>{if(e.dryRun){s({command:`cf dns records import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/import`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,proxied:e.proxied}});return}let t=await a(e);if(e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),e.file!==void 0||e.body!==void 0||e.proxied!==void 0){let n=new FormData;if(e.file){let t=p(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e.proxied!==void 0&&n.append(`proxied`,String(f(e.proxied,`proxied`,`text`)??``)),o(await c(`Creating`,async()=>i(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=f(e.body,`body`,`binary`);o(await c(`Creating`,async()=>i(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{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 V(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS record name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS record name. Name filters are case-insensitive.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS record name. Name filters are case-insensitive.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS record name. Name filters are case-insensitive.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS record name. Name filters are case-insensitive.`}).option(`type`,{type:`string`,description:`Record type.`,choices:[`A`,`AAAA`,`CAA`,`CERT`,`CNAME`,`DNSKEY`,`DS`,`HTTPS`,`LOC`,`MX`,`NAPTR`,`NS`,`OPENPGPKEY`,`PTR`,`SMIMEA`,`SRV`,`SSHFP`,`SVCB`,`TLSA`,`TXT`,`URI`]}).option(`content`,{type:`string`,description:"Exact value of the DNS record content. This is a convenience alias for `content.exact`."}).option(`content-exact`,{type:`string`,description:`Exact value of the DNS record content. Content filters are case-insensitive.`}).option(`content-contains`,{type:`string`,description:`Substring of the DNS record content. Content filters are case-insensitive.`}).option(`content-startswith`,{type:`string`,description:`Prefix of the DNS record content. Content filters are case-insensitive.`}).option(`content-endswith`,{type:`string`,description:`Suffix of the DNS record content. Content filters are case-insensitive.`}).option(`proxied`,{type:`boolean`,description:`Whether the record is receiving the performance and security benefits of Cloudflare.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.",choices:[`any`,`all`]}).option(`comment`,{type:`string`,description:"Exact value of the DNS record comment. This is a convenience alias for `comment.exact`."}).option(`comment-present`,{type:`string`,description:`If this parameter is present, only records *with* a comment are returned.`}).option(`comment-absent`,{type:`string`,description:`If this parameter is present, only records *without* a comment are returned.`}).option(`comment-exact`,{type:`string`,description:`Exact value of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-contains`,{type:`string`,description:`Substring of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-startswith`,{type:`string`,description:`Prefix of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-endswith`,{type:`string`,description:`Suffix of the DNS record comment. Comment filters are case-insensitive.`}).option(`tag`,{type:`string`,description:"Condition on the DNS record tag.\n\nParameter values can be of the form `<tag-name>:<tag-value>` to search for an exact `name:value` pair, or just `<tag-name>` to search for records with a specific tag name regardless of its value.\n\nThis is a convenience shorthand for the more powerful `tag.<predicate>` parameters.\nExamples:\n- `tag=important` is equivalent to `tag.present=important`\n- `tag=team:DNS` is equivalent to `tag.exact=team:DNS`"}).option(`tag-present`,{type:`string`,description:`Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-absent`,{type:`string`,description:`Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-exact`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value is `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-contains`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value contains `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-startswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value starts with `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-endswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value ends with `<tag-value>`. Tag filters are case-insensitive."}).option(`search`,{type:`string`,description:"Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters."}).option(`tag-match`,{type:`string`,description:"Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS records per page.`}).option(`order`,{type:`string`,description:`Field to order DNS records by.`,choices:[`type`,`name`,`content`,`ttl`,`proxied`]}).option(`direction`,{type:`string`,description:`Direction to order DNS records in.`,choices:[`asc`,`desc`]}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowed-by-name`,{type:`string`,description:"Filters to records at or below the given NS delegation name, excluding the NS records that form the delegation itself. The value must be a subdomain of the zone; the zone apex is not accepted. Requires `include_shadow_metadata=true`. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowing-name`,{type:`string`,description:`Returns NS records that shadow the given name, searching at the name itself and each of its ancestor names within the zone, excluding the zone apex. The value must be a subdomain of the zone; the zone apex is not accepted. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List, search, sort, and filter a zones' DNS records.`,builder:g(V),handler:async e=>{let t={name:e.name,"name.exact":e[`name-exact`],"name.contains":e[`name-contains`],"name.startswith":e[`name-startswith`],"name.endswith":e[`name-endswith`],type:e.type,content:e.content,"content.exact":e[`content-exact`],"content.contains":e[`content-contains`],"content.startswith":e[`content-startswith`],"content.endswith":e[`content-endswith`],proxied:e.proxied,match:e.match,comment:e.comment,"comment.present":e[`comment-present`],"comment.absent":e[`comment-absent`],"comment.exact":e[`comment-exact`],"comment.contains":e[`comment-contains`],"comment.startswith":e[`comment-startswith`],"comment.endswith":e[`comment-endswith`],tag:e.tag,"tag.present":e[`tag-present`],"tag.absent":e[`tag-absent`],"tag.exact":e[`tag-exact`],"tag.contains":e[`tag-contains`],"tag.startswith":e[`tag-startswith`],"tag.endswith":e[`tag-endswith`],search:e.search,tag_match:e[`tag-match`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,include_shadow_metadata:e[`include-shadow-metadata`],shadowed_by_name:e[`shadowed-by-name`],shadowing_name:e[`shadowing-name`]};if(e.dryRun){s({command:`cf dns records list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.dns.records.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`scan-list`,describe:"Retrieves the list of DNS records discovered up to this point by the asynchronous scan. These records are temporary until explicitly accepted or rejected via `POST /scan/review`. Additional records may be discovered by the scan later.",builder:U,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.records.scanList({zone_id:n})),{successLabel:`Loaded`})}};function G(e){return e.option(`accepts`,{type:`string`,description:`The accepts field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rejects`,{type:`string`,description:`The rejects field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`scan-review`,describe:`Accept or reject DNS records found by the DNS records scan. Accepted records will be permanently added to the zone, while rejected records will be permanently deleted.`,builder:G,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({accepts:u(e.accepts,`accepts`),rejects:u(e.rejects,`rejects`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.records.scanReview({...r,zone_id:n})),{successLabel:`Created`});return}let i=d({accepts:u(e.accepts,`accepts`),rejects:u(e.rejects,`rejects`)});o(await c(`Creating`,async()=>t.dns.records.scanReview({...i,zone_id:n})),{successLabel:`Created`})}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`scan-trigger`,describe:"Initiates an asynchronous scan for common DNS records on your domain. Note that this **does not** automatically add records to your zone. The scan runs in the background, and results can be reviewed later using the `/scan/review` endpoints. Useful if you haven't updated your nameservers yet.",builder:q,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan-trigger`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/trigger`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.records.scanTrigger({zone_id:n})),{successLabel:`Created`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`scan`,describe:`Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.`,builder:Y,handler:async e=>{if(e.dryRun){s({command:`cf dns records scan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.records.scan({zone_id:n})),{successLabel:`Created`})}};function Z(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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 Q={command:`update <dns-record-id>`,describe:`Overwrite an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:Z,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){s({command:`cf dns records update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let r=l(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Updating`,async()=>n.dns.records.update({body:r,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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.`)}},ne={command:`records`,describe:`Operations for records`,builder:e=>e.command(O).command(A).command(M).command(P).command(I).command(R).command(B).command(H).command(X).command(W).command(K).command(J).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`enforce-dns-only`,{type:`boolean`,description:`When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record's individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on [Enforce DNS-only](https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only).`}).option(`zone-defaults-flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`zone-defaults-foundation-dns`,{type:`boolean`,description:`Deprecated. Use nameservers.type to configure Advanced Nameservers.`}).option(`zone-defaults-internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`zone-defaults-multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`zone-defaults-ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`zone-defaults-secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`zone-defaults-soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`zone-defaults-soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`zone-defaults-soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`zone-defaults-soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`zone-defaults-soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`zone-defaults-soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`zone-defaults-soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-defaults-zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`zone-defaults-nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`cloudflare.advanced`,`cloudflare.standard.random`,`custom.account`,`custom.tenant`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`edit`,describe:`Update DNS settings for an account or zone`,builder:re,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns settings account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?d({enforce_dns_only:i[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:i[`zone-defaults-flatten-all-cnames`],foundation_dns:i[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:f(i[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:i[`zone-defaults-multi-provider`],ns_ttl:i[`zone-defaults-ns-ttl`],secondary_overrides:i[`zone-defaults-secondary-overrides`],soa:{expire:i[`zone-defaults-soa-expire`],min_ttl:i[`zone-defaults-soa-min-ttl`],mname:f(i[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:i[`zone-defaults-soa-refresh`],retry:i[`zone-defaults-soa-retry`],rname:f(i[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:i[`zone-defaults-soa-ttl`]},zone_mode:f(i[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:f(i[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}}):l(i.body)});return}let u=await a(i),p=i.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();if(p===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>u.dns.settings.account.edit({...e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Updated`});return}let h=d({enforce_dns_only:i[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:i[`zone-defaults-flatten-all-cnames`],foundation_dns:i[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:f(i[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:i[`zone-defaults-multi-provider`],ns_ttl:i[`zone-defaults-ns-ttl`],secondary_overrides:i[`zone-defaults-secondary-overrides`],soa:{expire:i[`zone-defaults-soa-expire`],min_ttl:i[`zone-defaults-soa-min-ttl`],mname:f(i[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:i[`zone-defaults-soa-refresh`],retry:i[`zone-defaults-soa-retry`],rname:f(i[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:i[`zone-defaults-soa-ttl`]},zone_mode:f(i[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:f(i[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}});o(await c(`Updating`,async()=>u.dns.settings.account.edit({...h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Updated`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get`,describe:`Show DNS settings for an account or zone`,builder:ae,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns settings account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.dns.settings.account.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function se(e){return e.option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).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 ce={command:`create`,describe:`Create Internal DNS View for an account`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`),zones:r.zones}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.settings.account.views.create({...e,account_id:u})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await m(`name`,`The name of the view.`)),r.zones===void 0)throw Error(`--zones is required (or pass --body with this field set).`);let p=d({name:f(r.name,`name`,`text`),zones:r.zones});o(await c(`Creating`,async()=>i.dns.settings.account.views.create({...p,account_id:u})),{successLabel:`Created`})}};function le(e){return e.positional(`view-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 ue={command:`delete <view-id>`,describe:`Delete an existing Internal DNS View`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
21
+ `);return}o(await c(`Deleting`,async()=>i.dns.settings.account.views.delete({account_id:l,view_id:r[`view-id`]})),{successLabel:`Deleted`})}};function de(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).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 fe={command:`edit <view-id>`,describe:`Update an existing Internal DNS View`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`),zones:r.zones}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.settings.account.views.edit({...e,account_id:u,view_id:r[`view-id`]})),{successLabel:`Updated`});return}let p=d({name:f(r.name,`name`,`text`),zones:r.zones});o(await c(`Updating`,async()=>i.dns.settings.account.views.edit({...p,account_id:u,view_id:r[`view-id`]})),{successLabel:`Updated`})}};function pe(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <view-id>`,describe:`Get DNS Internal View`,builder:pe,handler:async r=>{if(r.dryRun){s({command:`cf dns settings account views get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views/${r[`view-id`]==null?`<view-id>`:encodeURIComponent(String(r[`view-id`]))}`,pathParams:{"view-id":String(r[`view-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.settings.account.views.get({account_id:l,view_id:r[`view-id`]})),{successLabel:`Loaded`})}};function he(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS view name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS view name.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS view name.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS view name.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS view name.`}).option(`zone-id`,{type:`string`,description:`A zone ID that exists in the zones list for the view.`}).option(`zone-name`,{type:`string`,description:`A zone name that exists in the zones list for the view.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS views per page.`}).option(`order`,{type:`string`,description:`Field to order DNS views by.`,choices:[`name`,`created_on`,`modified_on`]}).option(`direction`,{type:`string`,description:`Direction to order DNS views in.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`List DNS Internal Views for an Account`,builder:g(he),handler:async r=>{let i={name:r.name,"name.exact":r[`name-exact`],"name.contains":r[`name-contains`],"name.startswith":r[`name-startswith`],"name.endswith":r[`name-endswith`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],match:r.match,page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){s({command:`cf dns settings account views list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dns_settings/views`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.dns.settings.account.views.list({account_id:u,...i})),{successLabel:`Loaded`})}},_e={command:`views`,describe:`Operations for settings.account.views`,builder:e=>e.command(ce).command(ue).command(fe).command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ve={command:`account`,describe:`Operations for settings.account`,builder:e=>e.command(ie).command(oe).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ye={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get`,describe:`Get the current DNS record usage and quota for an account or zone. May include internal DNS usage and quota.`,builder:be,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf dns usage account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/dns_records/usage`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.dns.usage.account.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},Se={command:`account`,describe:`Operations for usage.account`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ce={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 Te={command:`create`,describe:`Create ACL.`,builder:we,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({ip_range:f(r[`ip-range`],`ip-range`,`text`),name:f(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.acls.create({...e,account_id:u})),{successLabel:`Created`});return}r[`ip-range`]===void 0&&(r[`ip-range`]=await m(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),r.name===void 0&&(r.name=await m(`name`,`The name of the acl.`));let p=d({ip_range:f(r[`ip-range`],`ip-range`,`text`),name:f(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.acls.create({...p,account_id:u})),{successLabel:`Created`})}};function Ee(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,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 De={command:`delete <acl-id>`,describe:`Delete ACL.`,builder:Ee,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
22
+ `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.acls.delete({account_id:l,acl_id:r[`acl-id`]})),{successLabel:`Deleted`})}};function Oe(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get <acl-id>`,describe:`Get ACL.`,builder:Oe,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.acls.get({account_id:l,acl_id:r[`acl-id`]})),{successLabel:`Loaded`})}};function Ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`List ACLs.`,builder:Ae,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.acls.list({account_id:l})),{successLabel:`Loaded`})}};function Me(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 Ne={command:`update <acl-id>`,describe:`Modify ACL.`,builder:Me,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"acl-id":String(r[`acl-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({ip_range:f(r[`ip-range`],`ip-range`,`text`),name:f(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.acls.update({body:e,account_id:u,acl_id:r[`acl-id`]})),{successLabel:`Updated`});return}r[`ip-range`]===void 0&&(r[`ip-range`]=await m(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),r.name===void 0&&(r.name=await m(`name`,`The name of the acl.`));let p=d({ip_range:f(r[`ip-range`],`ip-range`,`text`),name:f(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.acls.update({body:p,account_id:u,acl_id:r[`acl-id`]})),{successLabel:`Updated`})}},Pe={command:`acls`,describe:`Operations for zone-transfers.acls`,builder:e=>e.command(Te).command(De).command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`create`,describe:`Sends AXFR zone transfer request to primary nameserver(s).`,builder:Fe,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers force-axfr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/force_axfr`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.forceAxfr.create({zone_id:n})),{successLabel:`Created`})}},Le={command:`force-axfr`,describe:`Operations for zone-transfers.force-axfr`,builder:e=>e.command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Re(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
23
+ Not applicable for primary zones.`,default:86400}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 ze={command:`create`,describe:`Create secondary zone configuration for incoming zone transfers.`,builder:Re,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.zoneTransfers.incoming.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await m(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=d({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers});o(await c(`Creating`,async()=>t.dns.zoneTransfers.incoming.create({body:i,zone_id:n})),{successLabel:`Created`})}};function Be(e){return e.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 Ve={command:`delete`,describe:`Delete secondary zone configuration for incoming zone transfers.`,builder:Be,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
24
+ `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.incoming.delete({zone_id:n})),{successLabel:`Deleted`})}};function He(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`get`,describe:`Get secondary zone configuration for incoming zone transfers.`,builder:He,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.incoming.get({zone_id:n})),{successLabel:`Loaded`})}};function We(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
25
+ Not applicable for primary zones.`}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 Ge={command:`update`,describe:`Update secondary zone configuration for incoming zone transfers.`,builder:We,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers incoming update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.zoneTransfers.incoming.update({body:r,zone_id:n})),{successLabel:`Updated`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await m(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=d({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers});o(await c(`Updating`,async()=>t.dns.zoneTransfers.incoming.update({body:i,zone_id:n})),{successLabel:`Updated`})}},Ke={command:`incoming`,describe:`Operations for zone-transfers.incoming`,builder:e=>e.command(ze).command(Ve).command(Ue).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 Je={command:`create`,describe:`Create primary zone configuration for outgoing zone transfers.`,builder:qe,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({name:f(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await m(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=d({name:f(e.name,`name`,`text`),peers:e.peers});o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.create({body:i,zone_id:n})),{successLabel:`Created`})}};function Ye(e){return e.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 Xe={command:`delete`,describe:`Delete primary zone configuration for outgoing zone transfers.`,builder:Ye,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
26
+ `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.delete({zone_id:n})),{successLabel:`Deleted`})}};function Ze(e){return e.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 Qe={command:`disable`,describe:`Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.`,builder:Ze,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force,message:`This operation turns off outgoing zone transfers for the primary zone, which means secondary zones will stop receiving updates.`})){process.stderr.write(`Aborted.
27
+ `);return}o(await c(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.disable({zone_id:n})),{successLabel:`Deleted`})}};function $e(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`enable`,describe:`Enable outgoing zone transfers for primary zone.`,builder:$e,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.enable({zone_id:n})),{successLabel:`Created`})}};function tt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nt={command:`force-notify`,describe:`Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.`,builder:tt,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing force-notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/force_notify`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.dns.zoneTransfers.outgoing.forceNotify({zone_id:n})),{successLabel:`Created`})}};function rt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`get`,describe:`Get primary zone configuration for outgoing zone transfers.`,builder:rt,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.outgoing.get({zone_id:n})),{successLabel:`Loaded`})}};function at(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`get`,describe:`Get primary zone transfer status.`,builder:at,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/status`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.dns.zoneTransfers.outgoing.status.get({zone_id:n})),{successLabel:`Loaded`})}},st={command:`status`,describe:`Operations for zone-transfers.outgoing.status`,builder:e=>e.command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ct(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 lt={command:`update`,describe:`Update primary zone configuration for outgoing zone transfers.`,builder:ct,handler:async e=>{if(e.dryRun){s({command:`cf dns zone-transfers outgoing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({name:f(e.name,`name`,`text`),peers:e.peers}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.dns.zoneTransfers.outgoing.update({body:r,zone_id:n})),{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await m(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let i=d({name:f(e.name,`name`,`text`),peers:e.peers});o(await c(`Updating`,async()=>t.dns.zoneTransfers.outgoing.update({body:i,zone_id:n})),{successLabel:`Updated`})}},ut={command:`outgoing`,describe:`Operations for zone-transfers.outgoing`,builder:e=>e.command(Je).command(Xe).command(Qe).command(et).command(nt).command(it).command(lt).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dt(e){return e.option(`name`,{type:`string`,description:`The name of the peer.`}).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 ft={command:`create`,describe:`Create Peer.`,builder:dt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.peers.create({...e,account_id:u})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await m(`name`,`The name of the peer.`));let p=d({name:f(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.peers.create({...p,account_id:u})),{successLabel:`Created`})}};function pt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,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 mt={command:`delete <peer-id>`,describe:`Delete Peer.`,builder:pt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
28
+ `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.peers.delete({account_id:l,peer_id:r[`peer-id`]})),{successLabel:`Deleted`})}};function ht(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gt={command:`get <peer-id>`,describe:`Get Peer.`,builder:ht,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.peers.get({account_id:l,peer_id:r[`peer-id`]})),{successLabel:`Loaded`})}};function _t(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`list`,describe:`List Peers.`,builder:_t,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.peers.list({account_id:l})),{successLabel:`Loaded`})}};function yt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`ip`,{type:`string`,description:`IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to.`}).option(`ixfr-enable`,{type:`boolean`,description:`Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones.`}).option(`name`,{type:`string`,description:`The name of the peer.`}).option(`port`,{type:`number`,description:`DNS port of primary or secondary nameserver, depending on what zone this peer is linked to.`}).option(`tsig-id`,{type:`string`,description:`TSIG authentication will be used for zone transfer if configured.`}).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:`update <peer-id>`,describe:`Modify Peer.`,builder:yt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers peers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/peers/${r[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(r[`peer-id`]))}`,pathParams:{"peer-id":String(r[`peer-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({ip:f(r.ip,`ip`,`text`),ixfr_enable:r[`ixfr-enable`],name:f(r.name,`name`,`text`),port:r.port,tsig_id:f(r[`tsig-id`],`tsig-id`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.peers.update({body:e,account_id:u,peer_id:r[`peer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await m(`name`,`The name of the peer.`));let p=d({ip:f(r.ip,`ip`,`text`),ixfr_enable:r[`ixfr-enable`],name:f(r.name,`name`,`text`),port:r.port,tsig_id:f(r[`tsig-id`],`tsig-id`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.peers.update({body:p,account_id:u,peer_id:r[`peer-id`]})),{successLabel:`Updated`})}},bt={command:`peers`,describe:`Operations for zone-transfers.peers`,builder:e=>e.command(ft).command(mt).command(gt).command(vt).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xt(e){return e.option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).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 St={command:`create`,describe:`Create TSIG.`,builder:xt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({algo:f(r.algo,`algo`,`text`),name:f(r.name,`name`,`text`),secret:f(r.secret,`secret`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.dns.zoneTransfers.tsigs.create({body:e,account_id:u})),{successLabel:`Created`});return}r.algo===void 0&&(r.algo=await m(`algo`,`TSIG algorithm.`)),r.name===void 0&&(r.name=await m(`name`,`TSIG key name.`)),r.secret===void 0&&(r.secret=await m(`secret`,`TSIG secret.`,{kind:`secret`}));let p=d({algo:f(r.algo,`algo`,`text`),name:f(r.name,`name`,`text`),secret:f(r.secret,`secret`,`text`)});o(await c(`Creating`,async()=>i.dns.zoneTransfers.tsigs.create({body:p,account_id:u})),{successLabel:`Created`})}};function Ct(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,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 wt={command:`delete <tsig-id>`,describe:`Delete TSIG.`,builder:Ct,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
29
+ `);return}o(await c(`Deleting`,async()=>i.dns.zoneTransfers.tsigs.delete({account_id:l,tsig_id:r[`tsig-id`]})),{successLabel:`Deleted`})}};function Tt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Et={command:`get <tsig-id>`,describe:`Get TSIG.`,builder:Tt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.tsigs.get({account_id:l,tsig_id:r[`tsig-id`]})),{successLabel:`Loaded`})}};function Dt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ot={command:`list`,describe:`List TSIGs.`,builder:Dt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.dns.zoneTransfers.tsigs.list({account_id:l})),{successLabel:`Loaded`})}};function kt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).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 At={command:`update <tsig-id>`,describe:`Modify TSIG.`,builder:kt,handler:async r=>{if(r.dryRun){s({command:`cf dns zone-transfers tsigs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/secondary_dns/tsigs/${r[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(r[`tsig-id`]))}`,pathParams:{"tsig-id":String(r[`tsig-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({algo:f(r.algo,`algo`,`text`),name:f(r.name,`name`,`text`),secret:f(r.secret,`secret`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.dns.zoneTransfers.tsigs.update({body:e,account_id:u,tsig_id:r[`tsig-id`]})),{successLabel:`Updated`});return}r.algo===void 0&&(r.algo=await m(`algo`,`TSIG algorithm.`)),r.name===void 0&&(r.name=await m(`name`,`TSIG key name.`)),r.secret===void 0&&(r.secret=await m(`secret`,`TSIG secret.`,{kind:`secret`}));let p=d({algo:f(r.algo,`algo`,`text`),name:f(r.name,`name`,`text`),secret:f(r.secret,`secret`,`text`)});o(await c(`Updating`,async()=>i.dns.zoneTransfers.tsigs.update({body:p,account_id:u,tsig_id:r[`tsig-id`]})),{successLabel:`Updated`})}},jt={command:`tsigs`,describe:`Operations for zone-transfers.tsigs`,builder:e=>e.command(St).command(wt).command(Et).command(Ot).command(At).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Mt={command:`zone-transfers`,describe:`Operations for zone-transfers`,builder:e=>e.command(Pe).command(Le).command(Ke).command(ut).command(bt).command(jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Nt={command:`dns`,describe:`dns`,builder:e=>e.command(E).command(ne).command(ye).command(Ce).command(Mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Nt as default};
@@ -1,5 +1,5 @@
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,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";function f(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
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,n as d}from"./prompt-CyATfGUu.mjs";function f(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
3
3
  indicated by the TTL received from upstream nameservers. This setting
4
4
  sets an upper bound on this duration. For caching purposes, higher TTLs
5
5
  will be decreased to the maximum value defined by this setting.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./chunk-6EUZQHAF-B7bSMYLe.mjs";var t=e(e=>{let t=typeof e;return e!==null&&(t===`object`||t===`function`)},`isObject`),n=e(e=>t(e)&&Object.keys(e).length===0,`isEmptyObject`),r=new Set([`__proto__`,`prototype`,`constructor`]),i=new Set(`0123456789`);function a(e){let t=[],n=``,a=`start`,o=!1;for(let s of e)switch(s){case`\\`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`)throw Error(`Invalid character after an index`);o&&(n+=s),a=`property`,o=!o;break;case`.`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`){a=`property`;break}if(o){o=!1,n+=s;break}if(r.has(n))return[];t.push(n),n=``,a=`property`;break;case`[`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`){a=`index`;break}if(o){o=!1,n+=s;break}if(a===`property`){if(r.has(n))return[];t.push(n),n=``}a=`index`;break;case`]`:if(a===`index`){t.push(Number.parseInt(n,10)),n=``,a=`indexEnd`;break}if(a===`indexEnd`)throw Error(`Invalid character after an index`);default:if(a===`index`&&!i.has(s))throw Error(`Invalid character in an index`);if(a===`indexEnd`)throw Error(`Invalid character after an index`);a===`start`&&(a=`property`),o&&(o=!1,n+=`\\`),n+=s}switch(o&&(n+=`\\`),a){case`property`:if(r.has(n))return[];t.push(n);break;case`index`:throw Error(`Index was not closed`);case`start`:t.push(``);break}return t}e(a,`getPathSegments`);function o(e,t){if(typeof t!=`number`&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}e(o,`isStringIndex`);function s(e,t){if(o(e,t))throw Error(`Cannot use string index`)}e(s,`assertNotStringIndex`);function c(e,n,r){if(!t(e)||typeof n!=`string`)return r===void 0?e:r;let i=a(n);if(i.length===0)return r;for(let t=0;t<i.length;t++){let n=i[t];if(e=o(e,n)?t===i.length-1?void 0:null:e[n],e==null){if(t!==i.length-1)return r;break}}return e===void 0?r:e}e(c,`getProperty`);function l(e,n,r){if(!t(e)||typeof n!=`string`)return e;let i=e,o=a(n);for(let n=0;n<o.length;n++){let i=o[n];s(e,i),n===o.length-1?e[i]=r:t(e[i])||(e[i]=typeof o[n+1]==`number`?[]:{}),e=e[i]}return i}e(l,`setProperty`);function u(e,n){if(!t(e)||typeof n!=`string`)return!1;let r=a(n);for(let n=0;n<r.length;n++){let i=r[n];if(s(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!t(e))return!1}}e(u,`deleteProperty`);function d(e,n){if(!t(e)||typeof n!=`string`)return!1;let r=a(n);if(r.length===0)return!1;for(let n of r){if(!t(e)||!(n in e)||o(e,n))return!1;e=e[n]}return!0}e(d,`hasProperty`);function f(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replaceAll(/[\\.[]/g,`\\$&`)}e(f,`escapePath`);function p(e){let t=Object.entries(e);return Array.isArray(e)?t.map(([e,t])=>[Number(e),t]):t}e(p,`entries`);function m(e){let t=``;for(let[n,r]of p(e))typeof r==`number`?t+=`[${r}]`:(r=f(r),t+=n===0?r:`.${r}`);return t}e(m,`stringifyPath`);function*h(e,r=[]){if(!t(e)||n(e)){r.length>0&&(yield m(r));return}for(let[t,n]of p(e))yield*h(n,[...r,t])}e(h,`deepKeysIterator`);function g(e){return[...h(e)]}e(g,`deepKeys`);export{c as getProperty};
2
+ import{i as e}from"./chunk-6EUZQHAF-C3w62dek.mjs";var t=e(e=>{let t=typeof e;return e!==null&&(t===`object`||t===`function`)},`isObject`),n=e(e=>t(e)&&Object.keys(e).length===0,`isEmptyObject`),r=new Set([`__proto__`,`prototype`,`constructor`]),i=new Set(`0123456789`);function a(e){let t=[],n=``,a=`start`,o=!1;for(let s of e)switch(s){case`\\`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`)throw Error(`Invalid character after an index`);o&&(n+=s),a=`property`,o=!o;break;case`.`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`){a=`property`;break}if(o){o=!1,n+=s;break}if(r.has(n))return[];t.push(n),n=``,a=`property`;break;case`[`:if(a===`index`)throw Error(`Invalid character in an index`);if(a===`indexEnd`){a=`index`;break}if(o){o=!1,n+=s;break}if(a===`property`){if(r.has(n))return[];t.push(n),n=``}a=`index`;break;case`]`:if(a===`index`){t.push(Number.parseInt(n,10)),n=``,a=`indexEnd`;break}if(a===`indexEnd`)throw Error(`Invalid character after an index`);default:if(a===`index`&&!i.has(s))throw Error(`Invalid character in an index`);if(a===`indexEnd`)throw Error(`Invalid character after an index`);a===`start`&&(a=`property`),o&&(o=!1,n+=`\\`),n+=s}switch(o&&(n+=`\\`),a){case`property`:if(r.has(n))return[];t.push(n);break;case`index`:throw Error(`Index was not closed`);case`start`:t.push(``);break}return t}e(a,`getPathSegments`);function o(e,t){if(typeof t!=`number`&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}e(o,`isStringIndex`);function s(e,t){if(o(e,t))throw Error(`Cannot use string index`)}e(s,`assertNotStringIndex`);function c(e,n,r){if(!t(e)||typeof n!=`string`)return r===void 0?e:r;let i=a(n);if(i.length===0)return r;for(let t=0;t<i.length;t++){let n=i[t];if(e=o(e,n)?t===i.length-1?void 0:null:e[n],e==null){if(t!==i.length-1)return r;break}}return e===void 0?r:e}e(c,`getProperty`);function l(e,n,r){if(!t(e)||typeof n!=`string`)return e;let i=e,o=a(n);for(let n=0;n<o.length;n++){let i=o[n];s(e,i),n===o.length-1?e[i]=r:t(e[i])||(e[i]=typeof o[n+1]==`number`?[]:{}),e=e[i]}return i}e(l,`setProperty`);function u(e,n){if(!t(e)||typeof n!=`string`)return!1;let r=a(n);for(let n=0;n<r.length;n++){let i=r[n];if(s(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!t(e))return!1}}e(u,`deleteProperty`);function d(e,n){if(!t(e)||typeof n!=`string`)return!1;let r=a(n);if(r.length===0)return!1;for(let n of r){if(!t(e)||!(n in e)||o(e,n))return!1;e=e[n]}return!0}e(d,`hasProperty`);function f(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replaceAll(/[\\.[]/g,`\\$&`)}e(f,`escapePath`);function p(e){let t=Object.entries(e);return Array.isArray(e)?t.map(([e,t])=>[Number(e),t]):t}e(p,`entries`);function m(e){let t=``;for(let[n,r]of p(e))typeof r==`number`?t+=`[${r}]`:(r=f(r),t+=n===0?r:`.${r}`);return t}e(m,`stringifyPath`);function*h(e,r=[]){if(!t(e)||n(e)){r.length>0&&(yield m(r));return}for(let[t,n]of p(e))yield*h(n,[...r,t])}e(h,`deepKeysIterator`);function g(e){return[...h(e)]}e(g,`deepKeys`);export{c as getProperty};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./output-BqDR9h74.mjs";function t(t){e(t)}export{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";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces`,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.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.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.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`durable-objects`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";function s(e){return e.option(`enabled`,{type:`boolean`,description:`Enable or disable DMARC reports for this zone`}).option(`skip-wizard`,{type:`boolean`,description:`Skip the DMARC setup wizard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for PATCH /dmarc-reports`})}const c={command:`edit`,describe:"Updates the DMARC report configuration for a zone. At least one of `enabled` or `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC RUA record exists in DNS.",builder:s,handler:async s=>{if(s.dryRun){r({command:`cf email-auth dmarc-reports edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]});n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Retrieves the current DMARC report configuration and status for a zone. Returns the RUA prefix, enabled status, approved sources, and DNS records.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf email-auth dmarc-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.emailAuth.dmarcReports.get({zone_id:s})),{successLabel:`Loaded`})}},d={command:`dmarc-reports`,describe:`Operations for dmarc-reports`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`id`,{type:`string`,description:`DNS record ID (rec_tag) to inspect`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`inspect`,describe:"Inspects a specific SPF TXT record and returns a parsed tree structure in the spflimit-worker format. The record ID must be provided via the `id` query parameter. Returns a recursive tree showing: - Parsed components with their qualifiers and types - Nested includes recursively resolved within components - Per-component and total lookup counts - Detailed error information with context",builder:f,handler:async a=>{let o={id:a.id};if(a.dryRun){r({command:`cf email-auth spf inspect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/spf/inspect`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.emailAuth.spf.inspect({zone_id:c,...o})),{successLabel:`Loaded`})}},m={command:`spf`,describe:`Operations for spf`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`email-auth`,describe:`email-auth`,builder:e=>e.command(d).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -0,0 +1,6 @@
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";import{t as h}from"./cli-types-C3nVfpSG.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).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:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({email:d(r.email,`email`,`text`)}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.emailRouting.addresses.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await f(`email`,`The contact email address of the user.`));let m=u({email:d(r.email,`email`,`text`)});a(await s(`Creating`,async()=>l.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address 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 <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>c.emailRouting.addresses.delete({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.emailRouting.addresses.get({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists existing destination addresses.`,builder:h(x),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,verified:r.verified};if(r.dryRun){o({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,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.emailRouting.addresses.list({account_id:u,...c})),{successLabel:`Loaded`})}};function C(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).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 w={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:C,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({status:d(r.status,`status`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.emailRouting.addresses.update({...e,account_id:f,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`});return}r.status===void 0&&(r.status=await p(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=u({status:d(r.status,`status`,`text`)});a(await s(`Updating`,async()=>l.emailRouting.addresses.update({...m,account_id:f,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`})}},T={command:`addresses`,describe:`Verified destination email addresses that can receive forwarded mail`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.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:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:E,handler:async e=>{if(e.dryRun){o({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
4
+ `);return}a(await s(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function O(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let l=u({name:d(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:l,zone_id:n})),{successLabel:`Created`})}};function A(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 j={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:A,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}if(e.body){let r=c(e.body);a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let l=u({name:d(e.name,`name`,`text`)});a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:l,zone_id:n})),{successLabel:`Deleted`})}};function M(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 N={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:M,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let l=u({name:d(e.name,`name`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:l,zone_id:n})),{successLabel:`Updated`})}};function P(e){return e.option(`subdomain`,{type:`string`,description:`Deprecated. When supplied, the response shape differs from the documented default and is not modeled in generated SDKs. Do not rely on this parameter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:P,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){o({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.emailRouting.dns.get({zone_id:c,...t})),{successLabel:`Loaded`})}},I={command:`dns`,describe:`DNS records required for email routing (MX, SPF, DKIM) — enable, lock, or disable`,builder:e=>e.command(k).command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).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 R={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:L,handler:async e=>{if(e.dryRun){o({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let l=u({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.edit({...l,zone_id:n})),{successLabel:`Updated`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:z,handler:async e=>{if(e.dryRun){o({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:B,handler:async e=>{if(e.dryRun){o({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:H,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function W(e){return e.option(`actions`,{type:`string`,description:`List actions for the catch-all routing rule. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`matchers`,{type:`string`,description:`List of matchers for the catch-all routing rule. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).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:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to a specific destination address. Forward actions require exactly one verified destination address.`,builder:W,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:d(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}if(e.actions===void 0)throw Error(`--actions is required (or pass --body with this field set).`);if(e.matchers===void 0)throw Error(`--matchers is required (or pass --body with this field set).`);let f=u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:d(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...f,zone_id:n})),{successLabel:`Updated`})}},K={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.option(`actions`,{type:`string`,description:`List actions patterns. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`matchers`,{type:`string`,description:`Matching patterns to forward to your actions. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).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:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require exactly one verified destination address.`,builder:q,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:d(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}if(e.actions===void 0)throw Error(`--actions is required (or pass --body with this field set).`);if(e.matchers===void 0)throw Error(`--matchers is required (or pass --body with this field set).`);let f=u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:d(e.source,`source`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.rules.create({...f,zone_id:n})),{successLabel:`Created`})}};function Y(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule 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 X={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:Y,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
6
+ `);return}a(await s(`Deleting`,async()=>t.emailRouting.rules.delete({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Deleted`})}};function Z(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:Z,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.get({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Loaded`})}};function ne(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`list-account`,describe:`Lists existing routing rules across all zones in the account or zone.`,builder:h(ne),handler:async c=>{let l={page:c.page,per_page:c[`per-page`],enabled:c.enabled};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 email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/email/routing/rules`,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.emailRouting.rules.listAccount({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function ie(e){return e.option(`catch-all-rules`,{type:`string`,description:`Desired catch-all Email Routing rules managed by the deploying Worker. Provide as a JSON array of objects or @path/to/file.json.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`rules`,{type:`string`,description:`Desired normal Email Routing rules managed by the deploying Worker. 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 ae={command:`plan`,describe:`Computes the Email Routing rule changes that would be needed to reconcile a Wrangler-managed desired ruleset. This endpoint is read-only and does not create, update, or delete rules.`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf email-routing rules plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/rules/plan`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({catch_all_rules:l(r[`catch-all-rules`],`catch-all-rules`),owner_worker_tag:d(r[`owner-worker-tag`],`owner-worker-tag`,`text`),rules:l(r.rules,`rules`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.emailRouting.rules.plan({...e,account_id:m})),{successLabel:`Created`});return}r[`owner-worker-tag`]===void 0&&(r[`owner-worker-tag`]=await f(`owner-worker-tag`,"Public tag (script_tag) of the Worker that owns this rule. Required when `source` is `wrangler`. "));let h=u({catch_all_rules:l(r[`catch-all-rules`],`catch-all-rules`),owner_worker_tag:d(r[`owner-worker-tag`],`owner-worker-tag`,`text`),rules:l(r.rules,`rules`)});a(await s(`Creating`,async()=>p.emailRouting.rules.plan({...h,account_id:m})),{successLabel:`Created`})}};function oe(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`actions`,{type:`string`,description:`List actions patterns. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`matchers`,{type:`string`,description:`Matching patterns to forward to your actions. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).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:`update <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require exactly one verified destination address.`,builder:oe,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:d(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`});return}if(e.actions===void 0)throw Error(`--actions is required (or pass --body with this field set).`);if(e.matchers===void 0)throw Error(`--matchers is required (or pass --body with this field set).`);let f=u({actions:l(e.actions,`actions`),enabled:e.enabled,matchers:l(e.matchers,`matchers`),name:d(e.name,`name`,`text`),owner_worker_tag:d(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:d(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.update({...f,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`})}},se={command:`rules`,describe:`Routing rules that match incoming email addresses and forward to destination mailboxes`,builder:e=>e.command(J).command(X).command(Q).command(re).command(ae).command($).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 le={command:`unlock`,describe:`Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead.`,builder:ce,handler:async e=>{if(e.dryRun){o({command:`cf email-routing unlock`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/unlock`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`});return}let l=u({name:d(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.unlock({body:l,zone_id:n})),{successLabel:`Created`})}};function ue(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).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 de={command:`update`,describe:`Update the settings for your Email Routing zone.`,builder:ue,handler:async e=>{if(e.dryRun){o({command:`cf email-routing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`});return}let l=u({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.update({...l,zone_id:n})),{successLabel:`Updated`})}},fe={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(D).command(R).command(te).command(V).command(le).command(de).command(T).command(I).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{fe as default};