cf 0.5.0 → 0.7.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 (317) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/api-gateway-D4AIEtUq.mjs +33 -0
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/cache-DVhkiIGK.mjs +5 -0
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-B7hsuvbF.mjs +57 -0
  63. package/dist/dist-BH-4NQOV.mjs +134 -0
  64. package/dist/dns-D7VAaCyO.mjs +29 -0
  65. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  66. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  67. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  68. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  69. package/dist/email-routing-CiDbivcN.mjs +10 -0
  70. package/dist/email-security-BYeAuSc6.mjs +12 -0
  71. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  72. package/dist/filters-DZ8YnQ90.mjs +4 -0
  73. package/dist/firewall-DEd1hs_I.mjs +11 -0
  74. package/dist/flagship-DVw7xGoP.mjs +4 -0
  75. package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
  76. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  77. package/dist/healthchecks-Da9N3ix4.mjs +4 -0
  78. package/dist/hostnames-mimZu2tB.mjs +3 -0
  79. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  80. package/dist/iam-DGQ-OgRl.mjs +6 -0
  81. package/dist/images-CI6Iy9ho.mjs +7 -0
  82. package/dist/index.mjs +1 -1
  83. package/dist/intel-BDB-aRtU.mjs +3 -0
  84. package/dist/internal-Czlp5Ekb.mjs +2 -0
  85. package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
  86. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  87. package/dist/kv-BHerx4dZ.mjs +5 -0
  88. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  89. package/dist/live-Ce7dZW7p.mjs +2 -0
  90. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  91. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  92. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  93. package/dist/logos-CJLhx1go.mjs +3 -0
  94. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  95. package/dist/logs-DMvtchc6.mjs +3 -0
  96. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  97. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  98. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  99. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  100. package/dist/matches-B0yHbQ2I.mjs +2 -0
  101. package/dist/moq-UgBawOXe.mjs +13 -0
  102. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  103. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  104. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  105. package/dist/observability-B-1y36QS.mjs +4 -0
  106. package/dist/organization-Dq3PClZ7.mjs +41 -0
  107. package/dist/organizations-AhsQkHyX.mjs +2 -0
  108. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  109. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  110. package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
  111. package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  112. package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  113. package/dist/pages-BsXF11Kv.mjs +11 -0
  114. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  115. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  116. package/dist/progress-O88q63Bk.mjs +2 -0
  117. package/dist/prompt-DTAWiEm2.mjs +3 -0
  118. package/dist/queries-CAE95-OH.mjs +3 -0
  119. package/dist/queues-BBz35Mqd.mjs +6 -0
  120. package/dist/r2-Zp99S5xF.mjs +21 -0
  121. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  122. package/dist/radar-Cij-XVQJ.mjs +2 -0
  123. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  124. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  125. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  126. package/dist/ready-DMpJvyaz.mjs +2 -0
  127. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  128. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  129. package/dist/refute-BGTpr5sy.mjs +2 -0
  130. package/dist/registrar-CXViZlah.mjs +83 -0
  131. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  132. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  133. package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  134. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  135. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  136. package/dist/rules-ens3OHme.mjs +4 -0
  137. package/dist/rulesets-bkreZRao.mjs +8 -0
  138. package/dist/rum-CpgXFcwl.mjs +4 -0
  139. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  140. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  141. package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
  142. package/dist/schema-validation-Ca6o94ts.mjs +24 -0
  143. package/dist/scim-C4oT8TMc.mjs +4 -0
  144. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  145. package/dist/search-C4T5riPh.mjs +2 -0
  146. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  147. package/dist/security-center-BOvm7xy6.mjs +2 -0
  148. package/dist/security-txt-BCAUBctN.mjs +3 -0
  149. package/dist/session-B1ARgLG7.mjs +2 -0
  150. package/dist/share-DhmVspmL.mjs +5 -0
  151. package/dist/shared-Bod3-Exx.mjs +990 -0
  152. package/dist/signed-url-DA509wgp.mjs +2 -0
  153. package/dist/smart-shield-DZm4fn6z.mjs +3 -0
  154. package/dist/snippets-oQ0u26-z.mjs +4 -0
  155. package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  156. package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  157. package/dist/speed-DqNnvLBD.mjs +4 -0
  158. package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
  159. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  160. package/dist/state-OsdDJvdj.mjs +2 -0
  161. package/dist/stream-Bud9Os5V.mjs +14 -0
  162. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  163. package/dist/submit-BtP8she2.mjs +2 -0
  164. package/dist/tenant-CMwHa-tU.mjs +2 -0
  165. package/dist/token-validation-BYC7HTok.mjs +10 -0
  166. package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
  167. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  168. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  169. package/dist/turnstile-CP4nScaL.mjs +23 -0
  170. package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
  171. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  172. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  173. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  174. package/dist/user-DtefniLc.mjs +11 -0
  175. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  176. package/dist/verify-D7J3F_NZ.mjs +2 -0
  177. package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
  178. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  179. package/dist/web3-Dhw79l4S.mjs +4 -0
  180. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  181. package/dist/workers-l3zMNOU6.mjs +20 -0
  182. package/dist/workflows-rb7RYBKP.mjs +6 -0
  183. package/dist/zaraz-CHecMYuo.mjs +2 -0
  184. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  185. package/dist/zone-BnnqJwW-.mjs +2 -0
  186. package/dist/zones-DpI2YikF.mjs +21 -0
  187. package/package.json +3 -1
  188. package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
  189. package/dist/accounts-B_joQcMi.mjs +0 -22
  190. package/dist/acm-_kIHqYME.mjs +0 -3
  191. package/dist/addressing-CaFlw8y1.mjs +0 -12
  192. package/dist/ai-CqnhNb_c.mjs +0 -2
  193. package/dist/ai-gateway-pgYGI519.mjs +0 -8
  194. package/dist/ai-search-eqQMPQol.mjs +0 -7
  195. package/dist/ai_gateway--vuVLnOm.mjs +0 -4
  196. package/dist/alerting-CPxHiYHb.mjs +0 -6
  197. package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
  198. package/dist/api-gateway-BXXGFCVR.mjs +0 -33
  199. package/dist/argo-aC6A3JyX.mjs +0 -2
  200. package/dist/artifacts-HD4V2xpK.mjs +0 -4
  201. package/dist/auth-D5hNsOFq.mjs +0 -5
  202. package/dist/billing-COaghyxl.mjs +0 -2
  203. package/dist/bot-management-DmEzeV1Y.mjs +0 -5
  204. package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
  205. package/dist/brand-protection-dPrGe8sL.mjs +0 -3
  206. package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
  207. package/dist/build-HuS9-R0V.mjs +0 -1054
  208. package/dist/cache-CY-7Lt71.mjs +0 -5
  209. package/dist/calls-wOQGDWPl.mjs +0 -4
  210. package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
  211. package/dist/client-certificates-CRf41xLe.mjs +0 -3
  212. package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
  213. package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
  214. package/dist/config-B5k-XbwS.mjs +0 -2
  215. package/dist/connectivity-Bx3MgTHX.mjs +0 -3
  216. package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
  217. package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
  218. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
  219. package/dist/connectors-DRt4e6d_.mjs +0 -3
  220. package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
  221. package/dist/context-jpewmual.mjs +0 -2
  222. package/dist/custom-certificates-DYE-9epx.mjs +0 -5
  223. package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
  224. package/dist/custom-nameservers-CWqA51in.mjs +0 -3
  225. package/dist/custom-pages-DeUKEFGe.mjs +0 -4
  226. package/dist/d1-DvWY9Gp4.mjs +0 -4
  227. package/dist/data-security-BPo6dIWu.mjs +0 -6
  228. package/dist/diagnostics-6nKPmVgz.mjs +0 -3
  229. package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
  230. package/dist/dist-C6zxsVdY.mjs +0 -306
  231. package/dist/dist-t_YrL25p.mjs +0 -82
  232. package/dist/dns-ClciFGxx.mjs +0 -29
  233. package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
  234. package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
  235. package/dist/email-routing-CGXhFqF5.mjs +0 -10
  236. package/dist/email-security-D5viPq8S.mjs +0 -8
  237. package/dist/email-sending-C2jpc3gh.mjs +0 -3
  238. package/dist/filters-bzsFcWt0.mjs +0 -4
  239. package/dist/firewall-DYZcTtIC.mjs +0 -11
  240. package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
  241. package/dist/healthchecks-DRoAlWgr.mjs +0 -4
  242. package/dist/hostnames-CFgIVI3s.mjs +0 -3
  243. package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
  244. package/dist/iam-DqVPzGrb.mjs +0 -6
  245. package/dist/images-BYfl4YgR.mjs +0 -7
  246. package/dist/intel-duTEPIHc.mjs +0 -3
  247. package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
  248. package/dist/kv-CZoV4tiv.mjs +0 -5
  249. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
  250. package/dist/load-balancers--OMg0HNt.mjs +0 -6
  251. package/dist/logpush-C0_lZTyY.mjs +0 -4
  252. package/dist/logs-BtpWZQfV.mjs +0 -3
  253. package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
  254. package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
  255. package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
  256. package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
  257. package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
  258. package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
  259. package/dist/oauth-Bk-F-tIO.mjs +0 -52
  260. package/dist/observability-BynRbTF4.mjs +0 -4
  261. package/dist/organizations-BqJHyvMK.mjs +0 -41
  262. package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
  263. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
  264. package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
  265. package/dist/pages-D4aYteKk.mjs +0 -11
  266. package/dist/pipelines-G8Iusxq-.mjs +0 -6
  267. package/dist/progress-DrDErV9w.mjs +0 -2
  268. package/dist/queues-DEkbKqZX.mjs +0 -6
  269. package/dist/r2-CV0IkCAW.mjs +0 -21
  270. package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
  271. package/dist/radar-D986zPJr.mjs +0 -2
  272. package/dist/rate-limits-B2wRsUX1.mjs +0 -5
  273. package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
  274. package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
  275. package/dist/registrar-CDIwTz3G.mjs +0 -46
  276. package/dist/request-tracers-D7SFMDik.mjs +0 -2
  277. package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
  278. package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
  279. package/dist/rules-DHjLP5Kx.mjs +0 -4
  280. package/dist/rulesets-q4QABpKs.mjs +0 -8
  281. package/dist/rum-SmT4HZmM.mjs +0 -4
  282. package/dist/schema-validation-vVetgC_P.mjs +0 -24
  283. package/dist/scim-ChOkZpNx.mjs +0 -3
  284. package/dist/sdk-DhIhH6GB.mjs +0 -5
  285. package/dist/secrets-store-BAK9G12O.mjs +0 -25
  286. package/dist/security-center-eScuYDKP.mjs +0 -2
  287. package/dist/security-txt-x7R4gmQu.mjs +0 -3
  288. package/dist/session-DHYCE-PM.mjs +0 -93
  289. package/dist/shared-BAjo72Lz.mjs +0 -2
  290. package/dist/smart-shield-CWlSsNi8.mjs +0 -3
  291. package/dist/snippets-DrlgYJYp.mjs +0 -4
  292. package/dist/speed-ZFrMWDgd.mjs +0 -4
  293. package/dist/ssl-9JY05sYt.mjs +0 -15
  294. package/dist/stream-tRU39b8K.mjs +0 -14
  295. package/dist/tenants-HLGUazms.mjs +0 -2
  296. package/dist/token-validation-_VdamKpz.mjs +0 -10
  297. package/dist/turnstile-BRzXd28B.mjs +0 -23
  298. package/dist/url-normalization-D-NxuLtN.mjs +0 -3
  299. package/dist/url-scanner-BzzR6iDx.mjs +0 -2
  300. package/dist/user-C4omq__w.mjs +0 -10
  301. package/dist/vectorize-By6EqcNR.mjs +0 -4
  302. package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
  303. package/dist/web3-DQ5dmE9W.mjs +0 -4
  304. package/dist/workers-D8Be7_as.mjs +0 -18
  305. package/dist/workers-builds-BE3W3qNk.mjs +0 -7
  306. package/dist/workflows-BWWufqFA.mjs +0 -4
  307. package/dist/zaraz-Bsa9AvVL.mjs +0 -2
  308. package/dist/zero-trust-UNVZFnKu.mjs +0 -118
  309. package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
  310. package/dist/zones-BXtdwt6E.mjs +0 -21
  311. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  312. /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  313. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  314. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  315. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  316. /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
  317. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{r as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
3
+ - Minimum: 1 domain
4
+ - Maximum: 20 domains per request
5
+ - Domains on unsupported extensions are returned with \`registrable: false\` and a \`reason\` field
6
+ - Malformed domain names (e.g., missing extension) may be omitted from the response
7
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const h={command:`domain-check`,describe:"Performs real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.",builder:m,handler:async n=>{if(n.dryRun){a({command:`cf registrar domain-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({domains:n.domains}):c(n.body)});return}let l=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.registrar.domainCheck({...e,account_id:d})),{successLabel:`Created`});return}if(n.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let f=u({domains:n.domains});i(await o(`Creating`,async()=>l.registrar.domainCheck({...f,account_id:d})),{successLabel:`Created`})}};function g(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
8
+ - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
9
+ - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
10
+ returns results across all supported extensions. Extensions not in the supported
11
+ set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`domain-search`,describe:'Searches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.',builder:g,handler:async n=>{let c={q:n.q,extensions:n.extensions,limit:n.limit};if(n.dryRun){a({command:`cf registrar domain-search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrar.domainSearch({account_id:u,...c})),{successLabel:`Loaded`})}};function v(e){return e.positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:v,handler:async n=>{if(n.dryRun){a({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/extensions/${n.extension==null?`<extension>`:encodeURIComponent(String(n.extension))}`,pathParams:{extension:String(n.extension??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrar.extensions.get({account_id:l,extension:n.extension})),{successLabel:`Loaded`})}};function b(e){return e.option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
12
+ Pass this value to fetch the next page of results. Omit (or
13
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:p(b),handler:async n=>{let c={name:n.name,cursor:n.cursor,per_page:n[`per-page`],direction:n.direction,sort_by:n[`sort-by`]};if(n.dryRun){a({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrar.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})}},S={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
14
+ waiting for the operation to complete (RFC 7240).
15
+
16
+ The header may be combined with other preferences using standard
17
+ comma-separated syntax.`}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal. Defaults to \`false\` if omitted.
18
+ Setting this field to \`true\` is an explicit opt-in authorizing
19
+ Cloudflare to charge the account's default payment method up to 30
20
+ days before domain expiry to renew the domain automatically.
21
+ Renewal pricing may change over time based on registry pricing.
22
+ `,default:!1}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
23
+ communications from the registry, including ownership verification
24
+ and renewal notices.
25
+ `}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
26
+ Most registrations do not require a fax number.
27
+ `}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
28
+ for an individual or authorized representative. Some registries require
29
+ a complete personal name that includes a family or last name where
30
+ applicable. Provide the complete name in this single field, for example
31
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
32
+ `}).option(`contacts-administrator-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-billing-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
33
+ communications from the registry, including ownership verification
34
+ and renewal notices.
35
+ `}).option(`contacts-billing-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
36
+ Most registrations do not require a fax number.
37
+ `}).option(`contacts-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-billing-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
38
+ for an individual or authorized representative. Some registries require
39
+ a complete personal name that includes a family or last name where
40
+ applicable. Provide the complete name in this single field, for example
41
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
42
+ `}).option(`contacts-billing-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-registrant-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
43
+ communications from the registry, including ownership verification
44
+ and renewal notices.
45
+ `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
46
+ Most registrations do not require a fax number.
47
+ `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
48
+ for an individual or authorized representative. Some registries require
49
+ a complete personal name that includes a family or last name where
50
+ applicable. Provide the complete name in this single field, for example
51
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
52
+ `}).option(`contacts-registrant-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-technical-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
53
+ communications from the registry, including ownership verification
54
+ and renewal notices.
55
+ `}).option(`contacts-technical-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
56
+ Most registrations do not require a fax number.
57
+ `}).option(`contacts-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-technical-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
58
+ for an individual or authorized representative. Some registries require
59
+ a complete personal name that includes a family or last name where
60
+ applicable. Provide the complete name in this single field, for example
61
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
62
+ `}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`domain-name`,{type:`string`,description:`Fully qualified domain name (FQDN) including the extension
63
+ (e.g., \`example.com\`, \`mybrand.app\`). The domain name uniquely
64
+ identifies a registration — the same domain cannot be registered
65
+ twice, making it a natural idempotency key for registration requests.
66
+ `}).option(`privacy-mode`,{type:`string`,description:"WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Do not request WHOIS privacy.\n- `redaction`: Request WHOIS redaction where supported by the extension.\n Some extensions do not support privacy/redaction.\n",choices:[`redaction`],default:`redaction`}).option(`years`,{type:`number`,description:`Number of years to register (1–10). If omitted, defaults to the
67
+ minimum registration period required by the registry for this
68
+ extension. For most extensions this is 1 year, but some extensions
69
+ require longer minimum terms (e.g., \`.ai\` requires a minimum of
70
+ 2 years).
71
+
72
+ The registry for each extension may also enforce its own maximum
73
+ registration term. If the requested value exceeds the registry's
74
+ maximum, the registration will be rejected. When in doubt, use the
75
+ default by omitting this field.
76
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`,`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`,`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`,`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --contacts-* flag is set`)}return!0})}const w={command:`create`,describe:"Starts a domain registration workflow. This is a billable operation — successful registration charges the account's default payment method. All successful domain registrations are non-refundable — once the workflow completes with `state: succeeded`, the charge cannot be reversed. ### Prerequisites - The account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The account must not already be at the maximum supported domain limit. A single account may own up to 100 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Express mode The only required field is `domain_name`. If `contacts` is omitted, the system uses the account's default address book entry as the registrant. If no default exists and no contact is provided, the request fails. Set up a default address book entry and accept the required agreement at `https://dash.cloudflare.com/{account_id}/domains/registrations`. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:C,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){a({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({auto_renew:p[`auto-renew`],contacts:{administrator:{email:d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:d(p[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:d(p[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):c(p.body)});return}let h=await r(p),g=p.local?s:await t();if(p.accountId=g,p.body){let e=c(p.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await f(`domain-name`,"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests. "));let _={};p[`auto-renew`]!==void 0&&l(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),p[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),p[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),p[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),p[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),p[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],d(p[`contacts-billing-email`],`contacts-billing-email`,`text`)),p[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),p[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),p[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),p[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),p[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],d(p[`contacts-technical-email`],`contacts-technical-email`,`text`)),p[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),p[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),p[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),p[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&l(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&l(_,[`years`],p.years),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function T(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get-status <domain-name>`,describe:"Returns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```",builder:T,handler:async n=>{if(n.dryRun){a({command:`cf registrar registrations get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrar.registrations.getStatus({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get-update-status <domain-name>`,describe:"Returns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.",builder:D,handler:async n=>{if(n.dryRun){a({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrar.registrations.getUpdateStatus({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function k(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <domain-name>`,describe:"Returns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.",builder:k,handler:async n=>{if(n.dryRun){a({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrar.registrations.get({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
77
+ Pass this value to fetch the next page of results. Omit (or
78
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date\n(`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:"Returns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.",builder:p(j),handler:async n=>{let c={cursor:n.cursor,per_page:n[`per-page`],direction:n.direction,sort_by:n[`sort-by`]};if(n.dryRun){a({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrar.registrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to update.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to receive an immediate `202 Accepted` without\nwaiting for the operation to complete (RFC 7240)."}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal.
79
+ Setting this field to \`true\` authorizes Cloudflare to charge the
80
+ account's default payment method up to 30 days before domain expiry
81
+ to renew the domain automatically. Renewal pricing may change over
82
+ time based on registry pricing.
83
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const P={command:`update <domain-name>`,describe:"Updates an existing domain registration. By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return `200 OK` with a completed workflow status. If the update is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`. This endpoint currently supports updating `auto_renew` only.",builder:N,handler:async d=>{let f={};if(d.prefer!==void 0&&(f.Prefer=String(d.prefer)),d.dryRun){a({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar/registrations/${d[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(d[`domain-name`]))}`,pathParams:{"domain-name":String(d[`domain-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({auto_renew:d[`auto-renew`]}):c(d.body)});return}let p=await r(d),m=d.local?s:await t();if(d.accountId=m,d.body){let e=c(d.body);i(await o(`Updating`,async()=>n(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}let h={};d[`auto-renew`]!==void 0&&l(h,[`auto_renew`],d[`auto-renew`]),i(await o(`Updating`,async()=>n(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},F={command:`registrations`,describe:`Domain registrations — purchase, view, update, and inspect registration status`,builder:e=>e.command(w).command(A).command(E).command(O).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`registrar`,describe:`Domain registration and transfer management through Cloudflare Registrar`,builder:e=>e.command(h).command(_).command(S).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{r as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:m,handler:async n=>{if(n.dryRun){a({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/extensions/${n.extension==null?`<extension>`:encodeURIComponent(String(n.extension))}`,pathParams:{extension:String(n.extension??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:n.extension})),{successLabel:`Loaded`})}};function g(e){return e.option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
3
+ Pass this value to fetch the next page of results. Omit (or
4
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:p(g),handler:async n=>{let c={name:n.name,cursor:n.cursor,per_page:n[`per-page`],direction:n.direction,sort_by:n[`sort-by`]};if(n.dryRun){a({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})}},v={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
5
+ - Minimum: 1 domain
6
+ - Maximum: 20 domains per request
7
+ - Domains on unsupported extensions are returned with \`registrable: false\` and a \`reason\` field
8
+ - Malformed domain names (e.g., missing extension) may be omitted from the response
9
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const b={command:`check`,describe:"Performs real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.",builder:y,handler:async n=>{if(n.dryRun){a({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({domains:n.domains}):c(n.body)});return}let l=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.registrarSandbox.registrations.check({...e,account_id:d})),{successLabel:`Created`});return}if(n.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let f=u({domains:n.domains});i(await o(`Creating`,async()=>l.registrarSandbox.registrations.check({...f,account_id:d})),{successLabel:`Created`})}};function x(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
10
+ waiting for the operation to complete (RFC 7240).
11
+
12
+ The header may be combined with other preferences using standard
13
+ comma-separated syntax.`}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal. Defaults to \`false\` if omitted.
14
+ Setting this field to \`true\` is an explicit opt-in authorizing
15
+ Cloudflare to charge the account's default payment method up to 30
16
+ days before domain expiry to renew the domain automatically.
17
+ Renewal pricing may change over time based on registry pricing.
18
+ `,default:!1}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
19
+ communications from the registry, including ownership verification
20
+ and renewal notices.
21
+ `}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
22
+ Most registrations do not require a fax number.
23
+ `}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
24
+ for an individual or authorized representative. Some registries require
25
+ a complete personal name that includes a family or last name where
26
+ applicable. Provide the complete name in this single field, for example
27
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
28
+ `}).option(`contacts-administrator-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-billing-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
29
+ communications from the registry, including ownership verification
30
+ and renewal notices.
31
+ `}).option(`contacts-billing-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
32
+ Most registrations do not require a fax number.
33
+ `}).option(`contacts-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-billing-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
34
+ for an individual or authorized representative. Some registries require
35
+ a complete personal name that includes a family or last name where
36
+ applicable. Provide the complete name in this single field, for example
37
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
38
+ `}).option(`contacts-billing-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-registrant-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
39
+ communications from the registry, including ownership verification
40
+ and renewal notices.
41
+ `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
42
+ Most registrations do not require a fax number.
43
+ `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
44
+ for an individual or authorized representative. Some registries require
45
+ a complete personal name that includes a family or last name where
46
+ applicable. Provide the complete name in this single field, for example
47
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
48
+ `}).option(`contacts-registrant-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-technical-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
49
+ communications from the registry, including ownership verification
50
+ and renewal notices.
51
+ `}).option(`contacts-technical-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
52
+ Most registrations do not require a fax number.
53
+ `}).option(`contacts-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-technical-postal-info-name`,{type:`string`,description:`Full legal name of the contact, including all required name components
54
+ for an individual or authorized representative. Some registries require
55
+ a complete personal name that includes a family or last name where
56
+ applicable. Provide the complete name in this single field, for example
57
+ \`Ada Lovelace\`; do not send separate first-name or last-name fields.
58
+ `}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`domain-name`,{type:`string`,description:`Fully qualified domain name (FQDN) including the extension
59
+ (e.g., \`example.com\`, \`mybrand.app\`). The domain name uniquely
60
+ identifies a registration — the same domain cannot be registered
61
+ twice, making it a natural idempotency key for registration requests.
62
+ `}).option(`privacy-mode`,{type:`string`,description:"WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Do not request WHOIS privacy.\n- `redaction`: Request WHOIS redaction where supported by the extension.\n Some extensions do not support privacy/redaction.\n",choices:[`redaction`],default:`redaction`}).option(`years`,{type:`number`,description:`Number of years to register (1–10). If omitted, defaults to the
63
+ minimum registration period required by the registry for this
64
+ extension. For most extensions this is 1 year, but some extensions
65
+ require longer minimum terms (e.g., \`.ai\` requires a minimum of
66
+ 2 years).
67
+
68
+ The registry for each extension may also enforce its own maximum
69
+ registration term. If the requested value exceeds the registry's
70
+ maximum, the registration will be rejected. When in doubt, use the
71
+ default by omitting this field.
72
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`,`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`,`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`,`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --contacts-* flag is set`)}return!0})}const S={command:`create`,describe:"Starts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 100 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:x,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){a({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({auto_renew:p[`auto-renew`],contacts:{administrator:{email:d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:d(p[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:d(p[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):c(p.body)});return}let h=await r(p),g=p.local?s:await t();if(p.accountId=g,p.body){let e=c(p.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await f(`domain-name`,"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests. "));let _={};p[`auto-renew`]!==void 0&&l(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],d(p[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),p[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],d(p[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),p[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],d(p[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),p[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],d(p[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),p[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],d(p[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),p[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],d(p[`contacts-billing-email`],`contacts-billing-email`,`text`)),p[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],d(p[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),p[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],d(p[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),p[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],d(p[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),p[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],d(p[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),p[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],d(p[`contacts-technical-email`],`contacts-technical-email`,`text`)),p[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],d(p[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),p[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],d(p[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),p[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],d(p[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),p[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],d(p[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&l(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&l(_,[`years`],p.years),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function C(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get-registration-status <domain-name>`,describe:"Returns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```",builder:C,handler:async n=>{if(n.dryRun){a({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get-update-status <domain-name>`,describe:"Returns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.",builder:T,handler:async n=>{if(n.dryRun){a({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <domain-name>`,describe:"Returns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.",builder:D,handler:async n=>{if(n.dryRun){a({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
73
+ Pass this value to fetch the next page of results. Omit (or
74
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date\n(`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:"Returns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.",builder:p(k),handler:async n=>{let c={cursor:n.cursor,per_page:n[`per-page`],direction:n.direction,sort_by:n[`sort-by`]};if(n.dryRun){a({command:`cf registrar-sandbox registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrarSandbox.registrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
75
+ - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
76
+ - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
77
+ returns results across all supported extensions. Extensions not in the supported
78
+ set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`search`,describe:'Searches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.',builder:j,handler:async n=>{let c={q:n.q,extensions:n.extensions,limit:n.limit};if(n.dryRun){a({command:`cf registrar-sandbox registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/domain-search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.registrarSandbox.registrations.search({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to update.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to receive an immediate `202 Accepted` without\nwaiting for the operation to complete (RFC 7240)."}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal.
79
+ Setting this field to \`true\` authorizes Cloudflare to charge the
80
+ account's default payment method up to 30 days before domain expiry
81
+ to renew the domain automatically. Renewal pricing may change over
82
+ time based on registry pricing.
83
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const P={command:`update <domain-name>`,describe:"Updates an existing domain registration. By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return `200 OK` with a completed workflow status. If the update is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`. This endpoint currently supports updating `auto_renew` only.",builder:N,handler:async d=>{let f={};if(d.prefer!==void 0&&(f.Prefer=String(d.prefer)),d.dryRun){a({command:`cf registrar-sandbox registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/registrar-sandbox/registrations/${d[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(d[`domain-name`]))}`,pathParams:{"domain-name":String(d[`domain-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({auto_renew:d[`auto-renew`]}):c(d.body)});return}let p=await r(d),m=d.local?s:await t();if(d.accountId=m,d.body){let e=c(d.body);i(await o(`Updating`,async()=>n(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}let h={};d[`auto-renew`]!==void 0&&l(h,[`auto_renew`],d[`auto-renew`]),i(await o(`Updating`,async()=>n(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(d[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},F={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(b).command(S).command(O).command(w).command(E).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`registrar-sandbox`,describe:`registrar-sandbox`,builder:e=>e.command(v).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u}from"./prompt-DTAWiEm2.mjs";function d(e){return e.option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`,builder:d,handler:async d=>{if(d.dryRun){i({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}d.method===void 0&&(d.method=await u(`method`,`HTTP Method of tracing request`)),d.url===void 0&&(d.url=await u(`url`,`URL to which perform tracing request`));let m=c({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)});r(await a(`Creating`,async()=>f.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})}},p={command:`traces`,describe:`Operations for traces`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`request-tracers`,describe:`request-tracers`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./chunk-DH-VkVmc.mjs";var t=e({isCloudflareId:()=>a,isId:()=>o,isUUID:()=>i,isValidDomainName:()=>s,resolveZoneId:()=>c});const n=new Map;async function r(e,t,r=6e4){let i=n.get(e),a=Date.now();if(i&&i.expires>a)return i.data;let o=await t();return n.set(e,{data:o,expires:a+r}),o}function i(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function a(e){return/^[0-9a-f]{32}$/i.test(e)}function o(e){return i(e)||a(e)}function s(e){if(!e||e.length>253||!e.includes(`.`))return!1;let t=e.split(`.`);for(let e of t)if(e.length===0||e.length>63||!/^[a-zA-Z0-9]/.test(e)||!/[a-zA-Z0-9]$/.test(e)||!/^[a-zA-Z0-9-]+$/.test(e))return!1;return!0}async function c(e,t,n){if(o(n))return n;if(!s(n))throw Error(`Invalid zone identifier: "${n}". Must be a zone ID or valid domain name.`);let i=(await r(`zones:${t}`,async()=>(await e.zones.list({"account.id":t})).result)).find(e=>e.name===n||e.name===n.toLowerCase());if(!i)throw Error(`Zone not found: ${n}`);return i.id}export{s as n,t as r,o as t};
2
+ import{r as e}from"./chunk-DH-VkVmc.mjs";var t=e({isCloudflareId:()=>a,isId:()=>o,isUUID:()=>i,isValidDomainName:()=>s,resolveZoneId:()=>c});const n=new Map;async function r(e,t,r=6e4){let i=n.get(e),a=Date.now();if(i&&i.expires>a)return i.data;let o=await t();return n.set(e,{data:o,expires:a+r}),o}function i(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function a(e){return/^[0-9a-f]{32}$/i.test(e)}function o(e){return i(e)||a(e)}function s(e){if(!e||e.length>253||!e.includes(`.`))return!1;let t=e.split(`.`);for(let e of t)if(e.length===0||e.length>63||!/^[a-zA-Z0-9]/.test(e)||!/[a-zA-Z0-9]$/.test(e)||!/^[a-zA-Z0-9-]+$/.test(e))return!1;return!0}async function c(e,t,n){if(o(n))return n;if(!s(n))throw Error(`Invalid zone identifier: "${n}". Must be a zone ID or valid domain name.`);let i=(await r(`zones:${t}`,async()=>(await e.zones.list({"account.id":t})).result)).find(e=>e.name===n||e.name===n.toLowerCase());if(!i)throw Error(`Zone not found: ${n}`);return i.id}export{t as n,o as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s}from"./body-parser-BO6mfo_W.mjs";import{t as c}from"./prompt-DTAWiEm2.mjs";function l(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create <share-id>`,describe:`Excludes a single account from an organization-targeted share. The share continues to target the entire organization, but the excluded account is skipped during reconciliation.`,builder:l,handler:async c=>{if(c.dryRun){i({command:`cf resource-sharing excluded_recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(c[`share-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.resourceSharing.excludedRecipients.create({body:e,account_id:u,share_id:c[`share-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function d(e){return e.positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <excluded-recipient-id>`,describe:`Removes a single account from a share's excluded-recipient list. The account becomes eligible to receive the share again on the next reconciliation cycle.`,builder:d,handler:async s=>{if(s.dryRun){i({command:`cf resource-sharing excluded_recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients/${s[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(s[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"excluded-recipient-id":String(s[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await c({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}r(await a(`Deleting`,async()=>l.resourceSharing.excludedRecipients.delete({account_id:u,share_id:s[`share-id`],excluded_recipient_id:s[`excluded-recipient-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <excluded-recipient-id>`,describe:`Gets a single excluded recipient of a share by its identifier tag.`,builder:p,handler:async s=>{if(s.dryRun){i({command:`cf resource-sharing excluded_recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients/${s[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(s[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(s[`share-id`]??``),"excluded-recipient-id":String(s[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.resourceSharing.excludedRecipients.get({account_id:l,share_id:s[`share-id`],excluded_recipient_id:s[`excluded-recipient-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:"Lists the accounts excluded from an organization-targeted share. Only valid for shares with `target_type=organization`.",builder:h,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf resource-sharing excluded_recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/shares/${s[`share-id`]==null?`<share-id>`:encodeURIComponent(String(s[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(s[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.resourceSharing.excludedRecipients.list({account_id:u,share_id:s[`share-id`],...c})),{successLabel:`Loaded`})}};function _(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <share-id>`,describe:"Reconciles a share's excluded recipients to match the given list. Only valid for shares with `target_type=organization`.",builder:_,handler:async c=>{if(c.dryRun){i({command:`cf resource-sharing excluded_recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(c[`share-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Updating`,async()=>l.resourceSharing.excludedRecipients.update({body:e,account_id:u,share_id:c[`share-id`]})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},y={command:`excluded_recipients`,describe:`Operations for excluded_recipients`,builder:e=>e.command(u).command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`resource-sharing`,describe:`resource-sharing`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{i as r,n as i}from"./auth-CZ0E51rF.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-O88q63Bk.mjs";import{t as c}from"./local-C6TLPAT6.mjs";import{n as l,r as u,t as d}from"./body-parser-BO6mfo_W.mjs";import{n as f}from"./input-validation-BwUR9z8e.mjs";import{n as p,r as m,t as h}from"./prompt-DTAWiEm2.mjs";import{t as g}from"./cli-types-CFw6Xygp.mjs";function _(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
3
+ verify the current resource ETag matches before applying the write. Returns
4
+ 412 Precondition Failed if the resource has been modified since the ETag was
5
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).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:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const v={command:`delete`,describe:`Removes all tags from a specific account-level resource.`,builder:_,handler:async e=>{let g={};if(e[`if-match`]!==void 0&&(g[`If-Match`]=String(e[`if-match`])),e.dryRun){o({command:`cf resource-tagging account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({resource_id:f(e[`resource-id`],`resource-id`,`text`),resource_type:f(e[`resource-type`],`resource-type`,`text`),worker_id:f(e[`worker-id`],`worker-id`,`text`)}):l(e.body)});return}let _=await i(e),v=e.local?c:await n();if(e.accountId=v,!await h({force:!!e.force})){process.stderr.write(`Aborted.
6
+ `);return}if(e.body){let t=l(e.body);a(await s(`Deleting`,async()=>r(_,`DELETE`,`/accounts/${v}/tags`,{body:t,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`});return}e[`resource-id`]===void 0&&(e[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await p(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let y={};e[`resource-id`]!==void 0&&u(y,[`resource_id`],f(e[`resource-id`],`resource-id`,`text`)),e[`resource-type`]!==void 0&&u(y,[`resource_type`],f(e[`resource-type`],`resource-type`,`text`)),e[`worker-id`]!==void 0&&u(y,[`worker_id`],f(e[`worker-id`],`worker-id`,`text`)),a(await s(`Deleting`,async()=>r(_,`DELETE`,`/accounts/${v}/tags`,{body:Object.keys(y).length>0?y:void 0,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`})}};function y(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:`access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker.worker_version`.split(`.`),demandOption:!0}).option(`worker-id`,{type:`string`,description:`Worker identifier. Required for worker_version resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves tags for a specific account-level resource.`,builder:g(y),handler:async e=>{let r={resource_id:e[`resource-id`],resource_type:e[`resource-type`],worker_id:e[`worker-id`]};if(e.dryRun){o({command:`cf resource-tagging account-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags`,pathParams:{},query:r,bodyKind:`none`});return}let l=await i(e),u=e.local?c:await n();e.accountId=u,a(await s(`Loading`,async()=>l.resourceTagging.accountTags.get({account_id:u,...r})),{successLabel:`Loaded`})}};function x(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
7
+ verify the current resource ETag matches before applying the write. Returns
8
+ 412 Precondition Failed if the resource has been modified since the ETag was
9
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on account-level resources.`})}const S={command:`update`,describe:`Creates or updates tags for a specific account-level resource.`,builder:x,handler:async e=>{let h={};if(e[`if-match`]!==void 0&&(h[`If-Match`]=String(e[`if-match`])),e.dryRun){o({command:`cf resource-tagging account-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({resource_id:f(e[`resource-id`],`resource-id`,`text`),resource_type:f(e[`resource-type`],`resource-type`,`text`),worker_id:f(e[`worker-id`],`worker-id`,`text`)}):l(e.body)});return}let g=await i(e),_=e.local?c:await n();if(e.accountId=_,e.body){let t=l(e.body);a(await s(`Updating`,async()=>r(g,`PUT`,`/accounts/${_}/tags`,{body:t,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`});return}e[`resource-id`]===void 0&&(e[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await p(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let v={};e[`resource-id`]!==void 0&&u(v,[`resource_id`],f(e[`resource-id`],`resource-id`,`text`)),e[`resource-type`]!==void 0&&u(v,[`resource_type`],f(e[`resource-type`],`resource-type`,`text`)),e[`worker-id`]!==void 0&&u(v,[`worker_id`],f(e[`worker-id`],`worker-id`,`text`)),a(await s(`Updating`,async()=>r(g,`PUT`,`/accounts/${_}/tags`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}},C={command:`account-tags`,describe:`Tags applied to the account for organizational grouping and policy targeting`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:w,handler:async e=>{let r={cursor:e.cursor};if(e.dryRun){o({command:`cf resource-tagging keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags/keys`,pathParams:{},query:r,bodyKind:`none`});return}let l=await i(e),u=e.local?c:await n();e.accountId=u,a(await s(`Loading`,async()=>l.resourceTagging.keys.list({account_id:u,...r})),{successLabel:`Loaded`})}},E={command:`keys`,describe:`Tag key definitions that establish the vocabulary for tagging resources`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`name`,{type:`string`,description:`Filter by resource name. Performs a case-insensitive substring match. Example: ?name=my-zone`}).option(`id`,{type:`string`,description:`Filter by resource ID. Can be repeated up to 50 times to filter by multiple IDs. Example: ?id=abc&id=def`}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists all tagged resources for an account.`,builder:g(D),handler:async e=>{let r={type:e.type,name:e.name,id:e.id,tag:e.tag,cursor:e.cursor};if(e.dryRun){o({command:`cf resource-tagging list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags/resources`,pathParams:{},query:r,bodyKind:`none`});return}let l=await i(e),u=e.local?c:await n();e.accountId=u,a(await s(`Loading`,async()=>l.resourceTagging.list({account_id:u,...r})),{successLabel:`Loaded`})}};function k(e){return e.option(`tag-key`,{type:`string`,description:`The tag key to retrieve values for.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter by resource type.`,choices:`access_application.access_application_policy.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.api_gateway_operation.cloudflared_tunnel.custom_certificate.custom_hostname.d1_database.dns_record.durable_object_namespace.gateway_list.gateway_rule.healthcheck.image.infrastructure_target.kv_namespace.load_balancer.load_balancer_monitor.load_balancer_pool.managed_client_certificate.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker.worker_route.worker_version.zone.zone_ruleset`.split(`.`)}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all distinct values for a given tag key, optionally filtered by resource type.`,builder:g(k),handler:async e=>{let r={type:e.type,cursor:e.cursor};if(e.dryRun){o({command:`cf resource-tagging values list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags/values/${e[`tag-key`]==null?`<tag-key>`:encodeURIComponent(String(e[`tag-key`]))}`,pathParams:{"tag-key":String(e[`tag-key`]??``)},query:r,bodyKind:`none`});return}let l=await i(e),u=e.local?c:await n();e.accountId=u,a(await s(`Loading`,async()=>l.resourceTagging.values.list({account_id:u,tag_key:e[`tag-key`],...r})),{successLabel:`Loaded`})}},j={command:`values`,describe:`Allowed values for tag keys — constrain tagging to a defined set of options`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
10
+ verify the current resource ETag matches before applying the write. Returns
11
+ 412 Precondition Failed if the resource has been modified since the ETag was
12
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`healthcheck`,`load_balancer`,`managed_client_certificate`,`worker_route`,`zone`,`zone_ruleset`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).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:`Request body schema for deleting tags from zone-level resources.`})}const N={command:`delete`,describe:`Removes all tags from a specific zone-level resource.`,builder:M,handler:async t=>{let n={};if(t[`if-match`]!==void 0&&(n[`If-Match`]=String(t[`if-match`])),t.dryRun){o({command:`cf resource-tagging zone-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({resource_id:f(t[`resource-id`],`resource-id`,`text`),resource_type:f(t[`resource-type`],`resource-type`,`text`),access_application_id:f(t[`access-application-id`],`access-application-id`,`text`)}):l(t.body)});return}let c=await i(t);if(t.zoneId=await e({zone:t.zone},c,{quiet:t.quiet}),!await h({force:!!t.force})){process.stderr.write(`Aborted.
13
+ `);return}if(t.body){let e=l(t.body);a(await s(`Deleting`,async()=>r(c,`DELETE`,`/zones/${t.zoneId}/tags`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Deleted`});return}t[`resource-id`]===void 0&&(t[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),t[`resource-type`]===void 0&&(t[`resource-type`]=await p(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`healthcheck`,`load_balancer`,`managed_client_certificate`,`worker_route`,`zone`,`zone_ruleset`]));let g={};t[`resource-id`]!==void 0&&u(g,[`resource_id`],f(t[`resource-id`],`resource-id`,`text`)),t[`resource-type`]!==void 0&&u(g,[`resource_type`],f(t[`resource-type`],`resource-type`,`text`)),t[`access-application-id`]!==void 0&&u(g,[`access_application_id`],f(t[`access-application-id`],`access-application-id`,`text`)),a(await s(`Deleting`,async()=>r(c,`DELETE`,`/zones/${t.zoneId}/tags`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Deleted`})}};function P(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:[`access_application_policy`,`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`healthcheck`,`load_balancer`,`managed_client_certificate`,`worker_route`,`zone`,`zone_ruleset`],demandOption:!0}).option(`access-application-id`,{type:`string`,description:`Access application ID identifier. Required for access_application_policy resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Retrieves tags for a specific zone-level resource.`,builder:g(P),handler:async t=>{let n={resource_id:t[`resource-id`],resource_type:t[`resource-type`],access_application_id:t[`access-application-id`]};if(t.dryRun){o({command:`cf resource-tagging zone-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),c=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=c,a(await s(`Loading`,async()=>r.resourceTagging.zoneTags.get({zone_id:c,...n})),{successLabel:`Loaded`})}};function I(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
14
+ verify the current resource ETag matches before applying the write. Returns
15
+ 412 Precondition Failed if the resource has been modified since the ETag was
16
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`healthcheck`,`load_balancer`,`managed_client_certificate`,`worker_route`,`zone`,`zone_ruleset`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on zone-level resources.`})}const L={command:`update`,describe:`Creates or updates tags for a specific zone-level resource. Replaces all existing tags for the resource.`,builder:I,handler:async t=>{let n={};if(t[`if-match`]!==void 0&&(n[`If-Match`]=String(t[`if-match`])),t.dryRun){o({command:`cf resource-tagging zone-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({resource_id:f(t[`resource-id`],`resource-id`,`text`),resource_type:f(t[`resource-type`],`resource-type`,`text`),access_application_id:f(t[`access-application-id`],`access-application-id`,`text`)}):l(t.body)});return}let c=await i(t);if(t.zoneId=await e({zone:t.zone},c,{quiet:t.quiet}),t.body){let e=l(t.body);a(await s(`Updating`,async()=>r(c,`PUT`,`/zones/${t.zoneId}/tags`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}t[`resource-id`]===void 0&&(t[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),t[`resource-type`]===void 0&&(t[`resource-type`]=await p(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`healthcheck`,`load_balancer`,`managed_client_certificate`,`worker_route`,`zone`,`zone_ruleset`]));let h={};t[`resource-id`]!==void 0&&u(h,[`resource_id`],f(t[`resource-id`],`resource-id`,`text`)),t[`resource-type`]!==void 0&&u(h,[`resource_type`],f(t[`resource-type`],`resource-type`,`text`)),t[`access-application-id`]!==void 0&&u(h,[`access_application_id`],f(t[`access-application-id`],`access-application-id`,`text`)),a(await s(`Updating`,async()=>r(c,`PUT`,`/zones/${t.zoneId}/tags`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},R={command:`zone-tags`,describe:`Tags applied to individual zones for categorization and bulk management`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`resource-tagging`,describe:`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,builder:e=>e.command(O).command(C).command(E).command(j).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <operation-id>`,describe:"Gets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.",builder:f,handler:async s=>{if(s.dryRun){i({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/bulk_operations/${s[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(s[`operation-id`]))}`,pathParams:{"operation-id":String(s[`operation-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.rules.lists.bulkOperations.get({account_id:l,operation_id:s[`operation-id`]})),{successLabel:`Loaded`})}},m={command:`bulk-operations`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Creates a new list of the specified kind.`,builder:h,handler:async d=>{if(d.dryRun){i({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.rules.lists.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.rules.lists.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <list-id>`,describe:`Deletes a specific list and all its items.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}`,pathParams:{"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation deletes the custom list and every item it contains.`})){process.stderr.write(`Aborted.
3
+ `);return}r(await a(`Deleting`,async()=>c.rules.lists.delete({account_id:l,list_id:s[`list-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <list-id>`,describe:`Fetches the details of a list.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}`,pathParams:{"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.rules.lists.get({account_id:l,list_id:s[`list-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create <list-id>`,describe:"Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:x,handler:async c=>{if(c.dryRun){i({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.rules.lists.items.create({body:e,account_id:u,list_id:c[`list-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function C(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`delete <list-id>`,describe:"Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:C,handler:async c=>{if(c.dryRun){i({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,!await d({force:!!c.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
4
+ `);return}if(c.body){let e=s(c.body);r(await a(`Deleting`,async()=>l.rules.lists.items.delete({...e,account_id:u,list_id:c[`list-id`]})),{successLabel:`Deleted`});return}r(await a(`Deleting`,async()=>l.rules.lists.items.delete({account_id:u,list_id:c[`list-id`]})),{successLabel:`Deleted`})}};function T(e){return e.positional(`item-id`,{type:`string`,description:`Defines the unique ID of the item in the List.`,demandOption:!0}).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <item-id>`,describe:`Fetches a list item in the list.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}/items/${s[`item-id`]==null?`<item-id>`:encodeURIComponent(String(s[`item-id`]))}`,pathParams:{"item-id":String(s[`item-id`]??``),"list-id":String(s[`list-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.rules.lists.items.get({account_id:l,list_id:s[`list-id`],item_id:s[`item-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Fetches all the items in the list.`,builder:D,handler:async s=>{let c={cursor:s.cursor,per_page:s[`per-page`],search:s.search};if(s.dryRun){i({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${s[`list-id`]==null?`<list-id>`:encodeURIComponent(String(s[`list-id`]))}/items`,pathParams:{"list-id":String(s[`list-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.rules.lists.items.list({account_id:u,list_id:s[`list-id`],...c})),{successLabel:`Loaded`})}};function k(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`update <list-id>`,describe:"Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:k,handler:async c=>{if(c.dryRun){i({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Updating`,async()=>l.rules.lists.items.update({body:e,account_id:u,list_id:c[`list-id`]})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},j={command:`items`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(S).command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Fetches all lists in the account.`,builder:M,handler:async s=>{if(s.dryRun){i({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.rules.lists.list({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update <list-id>`,describe:`Updates the description of a list.`,builder:P,handler:async u=>{if(u.dryRun){i({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/rules/lists/${u[`list-id`]==null?`<list-id>`:encodeURIComponent(String(u[`list-id`]))}`,pathParams:{"list-id":String(u[`list-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({description:l(u.description,`description`,`text`)}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Updating`,async()=>d.rules.lists.update({...e,account_id:f,list_id:u[`list-id`]})),{successLabel:`Updated`});return}let p=c({description:l(u.description,`description`,`text`)});r(await a(`Updating`,async()=>d.rules.lists.update({...p,account_id:f,list_id:u[`list-id`]})),{successLabel:`Updated`})}},I={command:`lists`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(g).command(v).command(b).command(N).command(F).command(m).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`rules`,describe:`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{L as default};