cf 0.14.0 → 1.0.0-beta.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 (451) hide show
  1. package/LICENSE-APACHE +176 -0
  2. package/LICENSE-MIT +25 -0
  3. package/README.md +6 -7
  4. package/dist/_meta/commands.json +4040 -1629
  5. package/dist/_meta/hand-written-commands.json +16 -43
  6. package/dist/_meta/schemas.json +445 -756
  7. package/dist/abuse-reports-BwsJLiPN.mjs +26 -0
  8. package/dist/access-BVbIajYr.mjs +27 -0
  9. package/dist/account-DBLarar2.mjs +12 -0
  10. package/dist/account-tags-BNrSShjj.mjs +15 -0
  11. package/dist/accounts-CCAnDjFk.mjs +132 -0
  12. package/dist/acm-ZPYQbZQr.mjs +15 -0
  13. package/dist/addressing-BFpzLfTn.mjs +93 -0
  14. package/dist/agent-memory-DEvy2dLU.mjs +34 -0
  15. package/dist/ai-BF0_0NtS.mjs +31 -0
  16. package/dist/ai-audit-Dn03zntn.mjs +6 -0
  17. package/dist/ai-gateway-CVABbCjv.mjs +147 -0
  18. package/dist/ai-search-g0tR8Cut.mjs +79 -0
  19. package/dist/ai-security-BXXA0Jnk.mjs +10 -0
  20. package/dist/alerting-Bst10SOG.mjs +56 -0
  21. package/dist/analytics-DgEaxta8.mjs +21 -0
  22. package/dist/analytics_engine-B4DvcYmB.mjs +4 -0
  23. package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  24. package/dist/api-security-Dkx1Codr.mjs +154 -0
  25. package/dist/argo-BvswWPlP.mjs +10 -0
  26. package/dist/artifacts-D8kZKJq0.mjs +43 -0
  27. package/dist/audit-logs-Bp_yQpXJ.mjs +4 -0
  28. package/dist/auth-B9w55oRg.mjs +2 -0
  29. package/dist/auth-C80y97yu.mjs +8 -0
  30. package/dist/billing-Cqj64fqz.mjs +23 -0
  31. package/dist/bot-management-CzZx_aml.mjs +9 -0
  32. package/dist/botnet-feed-Co0c8Xdj.mjs +11 -0
  33. package/dist/brand-protection-CDsGaPIl.mjs +27 -0
  34. package/dist/browser-extension-BRHJm3Qf.mjs +15 -0
  35. package/dist/browser-run-DFrohJ1p.mjs +46 -0
  36. package/dist/build-BbjcJxKq.mjs +2 -0
  37. package/dist/build-DQh5-KK4.mjs +2 -0
  38. package/dist/builds-CamhClyb.mjs +71 -0
  39. package/dist/cache-BiTk4-Zc.mjs +45 -0
  40. package/dist/certificate-authorities-Dal9DNjW.mjs +6 -0
  41. package/dist/cf-oadujOtC.mjs +18 -0
  42. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  43. package/dist/chunk-DL5FNmn1.mjs +2 -0
  44. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  45. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  46. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  47. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  48. package/dist/client-certificates-DDisXoTE.mjs +13 -0
  49. package/dist/client-side-security-CIO_YPtN.mjs +63 -0
  50. package/dist/cloud-connector-vwdixea0.mjs +6 -0
  51. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  52. package/dist/cloudforce-one-C1cFVBGK.mjs +456 -0
  53. package/dist/command-BP7ldws1.mjs +2 -0
  54. package/dist/command-BtNRBTP6.mjs +2 -0
  55. package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
  56. package/dist/command-Ck9rbHA4.mjs +2 -0
  57. package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
  58. package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
  59. package/dist/connector-interrupts-DQ5T-HMN.mjs +6 -0
  60. package/dist/connector-telemetry-events-DWam38_9.mjs +6 -0
  61. package/dist/connector-telemetry-snapshots-DX6AJf9Q.mjs +6 -0
  62. package/dist/connectors-CBhLWVd-.mjs +15 -0
  63. package/dist/{dist-CFQREIRi.mjs → containers-Bx_44bmJ.mjs} +84 -83
  64. package/dist/containers-C7blN-pe.mjs +78 -0
  65. package/dist/content-scan-CC91dAlv.mjs +14 -0
  66. package/dist/cps-D9a4N_bH.mjs +6 -0
  67. package/dist/csamScanner-T7nbCnep.mjs +10 -0
  68. package/dist/ct-alerting-CkjNJlla.mjs +5 -0
  69. package/dist/custom-certificates-DnWnt9oJ.mjs +17 -0
  70. package/dist/custom-csrs-Db2pF9Ib.mjs +11 -0
  71. package/dist/custom-hostnames-B_N-uSIa.mjs +27 -0
  72. package/dist/custom-nameservers-DPA_sFY8.mjs +9 -0
  73. package/dist/custom-pages-D6fxEBoh.mjs +21 -0
  74. package/dist/d1-DXs1xVmH.mjs +45 -0
  75. package/dist/data-security-CVZAIzhe.mjs +71 -0
  76. package/dist/dcv-delegation-as1ue_wx.mjs +4 -0
  77. package/dist/delegate-GctF_lrq.mjs +2 -0
  78. package/dist/delegate.mjs +1 -1
  79. package/dist/{deploy-BtETDvDA.mjs → deploy-D2XXCkqk.mjs} +1 -1
  80. package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-BCYyKXpp.mjs} +1 -1
  81. package/dist/{dev-B5WcIpEr.mjs → dev-nsNxyg2D.mjs} +1 -1
  82. package/dist/diagnostics-BKH1Oh-C.mjs +15 -0
  83. package/dist/{dialog-Bud0hiYv.mjs → dialog-Dx4rRcKM.mjs} +1 -1
  84. package/dist/dist-BDOzKthe.mjs +48 -0
  85. package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
  86. package/dist/dist-dc4E1u01.mjs +272 -0
  87. package/dist/dls-C5kAQsN6.mjs +17 -0
  88. package/dist/dns-CYwXrdJO.mjs +135 -0
  89. package/dist/dns-firewall-BEw4QcXj.mjs +71 -0
  90. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  91. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  92. package/dist/durable-objects-3jvUgzKd.mjs +8 -0
  93. package/dist/email-auth-B3MD8FrJ.mjs +6 -0
  94. package/dist/email-routing-C4YhZGPw.mjs +45 -0
  95. package/dist/email-security-BcFyWNby.mjs +160 -0
  96. package/dist/email-sending-BO1GOAho.mjs +47 -0
  97. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  98. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  99. package/dist/fieldExtractors-BJDnzNCN.mjs +9 -0
  100. package/dist/firewall-BSMa9aH3.mjs +56 -0
  101. package/dist/flagship-BJYMb7hb.mjs +28 -0
  102. package/dist/fraud-C7kS7kP9.mjs +22 -0
  103. package/dist/google-tag-gateway-8VR-j0sa.mjs +6 -0
  104. package/dist/healthchecks-BJleItOD.mjs +22 -0
  105. package/dist/hostnames-CHajvoHa.mjs +11 -0
  106. package/dist/hyperdrive-DlxQrok-.mjs +37 -0
  107. package/dist/iam-B7oTr6vW.mjs +52 -0
  108. package/dist/images-xLAYe436.mjs +71 -0
  109. package/dist/index.mjs +1 -1
  110. package/dist/intel-DwZXY1YE.mjs +76 -0
  111. package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
  112. package/dist/interactive-DnUvQHjc.mjs +2 -0
  113. package/dist/ips-BC_9nKE7.mjs +4 -0
  114. package/dist/keyless-certificates-CtsCsbZ2.mjs +13 -0
  115. package/dist/keys-K-GFzhku.mjs +4 -0
  116. package/dist/kv-Bfwz_ULu.mjs +21 -0
  117. package/dist/leaked-credential-checks-D8UuxztO.mjs +18 -0
  118. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  119. package/dist/load-balancers-B0XeGLhT.mjs +76 -0
  120. package/dist/local-B6b2OIBW.mjs +2 -0
  121. package/dist/local-BrfySqnx.mjs +2 -0
  122. package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  123. package/dist/login-CAsRUF4c.mjs +2 -0
  124. package/dist/login-DaglE6WA.mjs +5 -0
  125. package/dist/logo-matches-DWg5ezsM.mjs +6 -0
  126. package/dist/logos-6A6gJC5C.mjs +7 -0
  127. package/dist/logpush-DwehajAw.mjs +46 -0
  128. package/dist/logs-BWg7YymF.mjs +48 -0
  129. package/dist/magic-cloud-networking--14hNj2F.mjs +71 -0
  130. package/dist/magic-network-monitoring-Dzo4L6kd.mjs +36 -0
  131. package/dist/magic-transit-DDO0A5v4.mjs +387 -0
  132. package/dist/managed-defense-DQ0iwWdG.mjs +18 -0
  133. package/dist/managed-transforms-DDIdcPG0.mjs +9 -0
  134. package/dist/matches-D6ahHNaP.mjs +6 -0
  135. package/dist/mcp-BcIrLbRv.mjs +32 -0
  136. package/dist/mesh-wLiPcWyN.mjs +26 -0
  137. package/dist/mtls-certificates-AEuNOERQ.mjs +13 -0
  138. package/dist/network-DZsrs_sw.mjs +50 -0
  139. package/dist/network-interconnects-Cjbu4EMv.mjs +73 -0
  140. package/dist/oauth-C-QCVfWz.mjs +14 -0
  141. package/dist/oauth-Cu1twz9z.mjs +2 -0
  142. package/dist/oauth-clients-DR0hzakz.mjs +16 -0
  143. package/dist/oauth-scopes-BDNpJJ32.mjs +4 -0
  144. package/dist/observability-BnHy2M6p.mjs +80 -0
  145. package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
  146. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  147. package/dist/organization-iasRm69J.mjs +75 -0
  148. package/dist/organizations-CUzCIKXV.mjs +4 -0
  149. package/dist/origin-ca-certificates-iQXSqBI0.mjs +11 -0
  150. package/dist/origin-post-quantum-encryption-DcMDK6Tz.mjs +6 -0
  151. package/dist/origin-tls-client-auth-D1X26X7y.mjs +30 -0
  152. package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
  153. package/dist/page-rules-CXa8EYcP.mjs +39 -0
  154. package/dist/pages-Cu0m9GSH.mjs +60 -0
  155. package/dist/pay-per-crawl-DmF8xlm_.mjs +65 -0
  156. package/dist/pay-per-use-DIp2fwJU.mjs +6 -0
  157. package/dist/pipelines-MmXlsxYO.mjs +44 -0
  158. package/dist/precursor-jqeEG_mJ.mjs +4 -0
  159. package/dist/previews-Cg6lc24N.mjs +4 -0
  160. package/dist/progress-Bpp73hIu.mjs +2 -0
  161. package/dist/{prompt-BP8XrQSj.mjs → prompt-CpZztV8c.mjs} +1 -1
  162. package/dist/queries-VzdcSR5H.mjs +9 -0
  163. package/dist/queues-BZYl2emH.mjs +63 -0
  164. package/dist/r2-data-catalog-DISnPFPY.mjs +44 -0
  165. package/dist/r2-omcKF8_A.mjs +127 -0
  166. package/dist/radar-JzBTD249.mjs +300 -0
  167. package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DxGs_eRm.mjs} +1 -1
  168. package/dist/realtime-yIdAJ0Yf.mjs +172 -0
  169. package/dist/registrar-D-Li9gNk.mjs +43 -0
  170. package/dist/registrar-sandbox-CKSSHAyv.mjs +56 -0
  171. package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
  172. package/dist/reporting-Cf-pnw6h.mjs +14 -0
  173. package/dist/request-headers-DaXBfmVn.mjs +2 -0
  174. package/dist/request-tracers-BegIQTzt.mjs +4 -0
  175. package/dist/resolve-BXemCSyA.mjs +2 -0
  176. package/dist/resolve-CUDKxUrW.mjs +2 -0
  177. package/dist/resource-sharing-DEVgiYzM.mjs +40 -0
  178. package/dist/resource-tagging-Cm2yJkU9.mjs +4 -0
  179. package/dist/rules-DDCa7cYF.mjs +18 -0
  180. package/dist/rulesets-BhS7Hvtu.mjs +37 -0
  181. package/dist/rum-EIj9ViSn.mjs +30 -0
  182. package/dist/run-CSFE1qVX.mjs +2 -0
  183. package/dist/run-ChM_YpZ0.mjs +2 -0
  184. package/dist/{schema-DmuJtMN5.mjs → schema-DCBb3Fcs.mjs} +1 -1
  185. package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags--GosoCMU.mjs} +1 -1
  186. package/dist/scim-DA83eNe-.mjs +18 -0
  187. package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
  188. package/dist/secrets-store-BTd3eGIB.mjs +24 -0
  189. package/dist/security-center-DbH_7h-T.mjs +30 -0
  190. package/dist/security-txt-DSrHhVEN.mjs +9 -0
  191. package/dist/shared-CtBkOWGN.mjs +2 -0
  192. package/dist/smart-shield-DnSTo-OI.mjs +24 -0
  193. package/dist/snippets-An5kQs33.mjs +20 -0
  194. package/dist/source-BR4_k2ad.mjs +6 -0
  195. package/dist/spawn-7IW1UyoH.mjs +523 -0
  196. package/dist/spectrum-Ci79n7fd.mjs +83 -0
  197. package/dist/speed-BBL7LrLn.mjs +24 -0
  198. package/dist/src-CNHNCZpy.mjs +108 -0
  199. package/dist/ssl-B2psFIRm.mjs +45 -0
  200. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  201. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  202. package/dist/state-BxCejn42.mjs +2 -0
  203. package/dist/state-DSzkxXML.mjs +2 -0
  204. package/dist/stream-Du0Q7UOh.mjs +102 -0
  205. package/dist/submit-CU8S2jBT.mjs +4 -0
  206. package/dist/tags-C3l5aZSi.mjs +4 -0
  207. package/dist/telemetry-CNt8H3aA.mjs +2 -0
  208. package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  209. package/dist/telemetry-PHe8XxA2.mjs +2 -0
  210. package/dist/tenant-BZ0ysR9L.mjs +12 -0
  211. package/dist/tenant-custom-nameservers-DtKeyM5J.mjs +9 -0
  212. package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
  213. package/dist/tunnels-D1tRWQQi.mjs +29 -0
  214. package/dist/turnstile-DBa4_Vyz.mjs +33 -0
  215. package/dist/ui-DH95w1Qk.mjs +5 -0
  216. package/dist/undici-DTSBJHNS.mjs +96 -0
  217. package/dist/update-check-AAn7EXw8.mjs +2 -0
  218. package/dist/update-check-BbIXBq1o.mjs +2 -0
  219. package/dist/update-check-worker.mjs +2 -0
  220. package/dist/url-info-BRA0XGT2.mjs +4 -0
  221. package/dist/url-normalization-B6N2m5s6.mjs +9 -0
  222. package/dist/url-scanner-CeKkzkhe.mjs +16 -0
  223. package/dist/user-CftksgmF.mjs +112 -0
  224. package/dist/values-m7w9PX3o.mjs +4 -0
  225. package/dist/vectorize-BWBEtsgZ.mjs +32 -0
  226. package/dist/version-cPq-WKL8.mjs +2 -0
  227. package/dist/waiting-rooms-BVZSYTNJ.mjs +53 -0
  228. package/dist/web-assets-CLU5vAgP.mjs +64 -0
  229. package/dist/web3-Dkd4XRNH.mjs +28 -0
  230. package/dist/workers-BQi4_SBS.mjs +36 -0
  231. package/dist/workers-builds-BgtPSDYJ.mjs +14 -0
  232. package/dist/workers-for-platforms-actLCM6Q.mjs +25 -0
  233. package/dist/workers-vpc-DjGfJgQn.mjs +13 -0
  234. package/dist/workflows-Cm7WsAgB.mjs +43 -0
  235. package/dist/zaraz-DurWe32F.mjs +22 -0
  236. package/dist/zero-trust-D8SVU8YZ.mjs +795 -0
  237. package/dist/zone-B3AEAfcd.mjs +4 -0
  238. package/dist/zones-DiX5LoSU.mjs +124 -0
  239. package/package.json +26 -11
  240. package/dist/_meta/agent-context.json +0 -195
  241. package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
  242. package/dist/access-BoT1waG4.mjs +0 -11
  243. package/dist/account-agnMUKWj.mjs +0 -2
  244. package/dist/account-tags-BRMMHCee.mjs +0 -9
  245. package/dist/accounts-Cut77dAt.mjs +0 -30
  246. package/dist/acm-C8WgXNCl.mjs +0 -3
  247. package/dist/addressing-CR8EV42x.mjs +0 -13
  248. package/dist/agent-context-Wj5TRRbW.mjs +0 -8
  249. package/dist/agent-memory-CVJpKKZy.mjs +0 -6
  250. package/dist/ai-BbNYt-yI.mjs +0 -5
  251. package/dist/ai-audit-mVajM-2i.mjs +0 -2
  252. package/dist/ai-gateway-BsepSA_v.mjs +0 -13
  253. package/dist/ai-search-DbEJqm5-.mjs +0 -7
  254. package/dist/ai-security-DmyB5EYk.mjs +0 -4
  255. package/dist/alerting-dmy3hd8O.mjs +0 -6
  256. package/dist/analytics-B1xBMla0.mjs +0 -5
  257. package/dist/analytics_engine-DazCn3iC.mjs +0 -2
  258. package/dist/api-security-0HXCzfHk.mjs +0 -50
  259. package/dist/argo-DSHsE8zv.mjs +0 -2
  260. package/dist/artifacts-CwiU9Mxu.mjs +0 -5
  261. package/dist/audit-logs-DwFtMDwH.mjs +0 -2
  262. package/dist/auth-B0ZyXc3y.mjs +0 -5
  263. package/dist/auth-DWxtJ918.mjs +0 -8
  264. package/dist/billing-Cbpadkgu.mjs +0 -3
  265. package/dist/bot-management-B6M2Vyyn.mjs +0 -5
  266. package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
  267. package/dist/brand-protection-B5R0b3pu.mjs +0 -3
  268. package/dist/browser-extension-D55pYZf_.mjs +0 -3
  269. package/dist/browser-run-C1b2VkGB.mjs +0 -4
  270. package/dist/build-CP2JUfV1.mjs +0 -2
  271. package/dist/builds-CVEXO_4a.mjs +0 -9
  272. package/dist/cache-BU5xX82E.mjs +0 -9
  273. package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
  274. package/dist/cf-BV2HLCQm.mjs +0 -18
  275. package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
  276. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
  277. package/dist/chunk-vbHwaUoU.mjs +0 -2
  278. package/dist/client-certificates-DX84qeYG.mjs +0 -3
  279. package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
  280. package/dist/cloud-connector-cf8qlxap.mjs +0 -2
  281. package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
  282. package/dist/command-DYrspBc0.mjs +0 -2
  283. package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
  284. package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
  285. package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
  286. package/dist/connectors-aPQspZdg.mjs +0 -3
  287. package/dist/containers-D0Kjl8h-.mjs +0 -58
  288. package/dist/content-scan-BVx18XmS.mjs +0 -4
  289. package/dist/cps-ByazyM0x.mjs +0 -2
  290. package/dist/csamScanner-OG5lQxBC.mjs +0 -6
  291. package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
  292. package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
  293. package/dist/custom-csrs-CR_5qbST.mjs +0 -3
  294. package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
  295. package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
  296. package/dist/custom-pages-BmGXoTIo.mjs +0 -3
  297. package/dist/d1-DedC8N0N.mjs +0 -21
  298. package/dist/data-security-B2UB26ry.mjs +0 -7
  299. package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
  300. package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
  301. package/dist/dist-CyisSore.mjs +0 -371
  302. package/dist/dist-Dr4Hg_Up.mjs +0 -48
  303. package/dist/dls-R6PvHbhj.mjs +0 -3
  304. package/dist/dns-Cl8se64c.mjs +0 -29
  305. package/dist/dns-firewall-WtmKilDT.mjs +0 -57
  306. package/dist/dry-run-YSQndLvt.mjs +0 -2
  307. package/dist/durable-objects-jfVU6yp_.mjs +0 -2
  308. package/dist/email-auth-DPmZ85eW.mjs +0 -2
  309. package/dist/email-routing-Bf6DbNTr.mjs +0 -6
  310. package/dist/email-security-DTifjSxM.mjs +0 -18
  311. package/dist/email-sending-Dm3WkFHV.mjs +0 -7
  312. package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
  313. package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
  314. package/dist/firewall-D5N2APXO.mjs +0 -8
  315. package/dist/flagship-sUOy9jei.mjs +0 -4
  316. package/dist/fraud-WLW2Ep1Z.mjs +0 -20
  317. package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
  318. package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
  319. package/dist/hostnames-Ba6FuL8K.mjs +0 -3
  320. package/dist/hyperdrive-DMqcU639.mjs +0 -21
  321. package/dist/iam-CXlYm0uC.mjs +0 -6
  322. package/dist/images-D_g1oli6.mjs +0 -8
  323. package/dist/intel-B8bS0ARd.mjs +0 -8
  324. package/dist/ips-68fzniN4.mjs +0 -2
  325. package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
  326. package/dist/keys-DkVdS2lF.mjs +0 -2
  327. package/dist/kv-gDAN50BQ.mjs +0 -5
  328. package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
  329. package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
  330. package/dist/local-BwL_gesw.mjs +0 -2
  331. package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
  332. package/dist/logos-DFBJFAYJ.mjs +0 -3
  333. package/dist/logpush-gzmlZayc.mjs +0 -4
  334. package/dist/logs-BuzwQgt5.mjs +0 -18
  335. package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
  336. package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
  337. package/dist/magic-transit-ClSmJDKw.mjs +0 -111
  338. package/dist/managed-defense-EOihg1UR.mjs +0 -2
  339. package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
  340. package/dist/matches-B6sG0_fr.mjs +0 -2
  341. package/dist/mcp--kK0vS5i.mjs +0 -4
  342. package/dist/mesh-DfXYUHOO.mjs +0 -4
  343. package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
  344. package/dist/network-U6f_5ihp.mjs +0 -6
  345. package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
  346. package/dist/oauth-BdVr2hJp.mjs +0 -14
  347. package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
  348. package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
  349. package/dist/observability-Bsp-LdmJ.mjs +0 -10
  350. package/dist/organization-BSeMdj-7.mjs +0 -45
  351. package/dist/organizations-BroR48Nv.mjs +0 -2
  352. package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
  353. package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
  354. package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
  355. package/dist/page-rules-ZcdjPohY.mjs +0 -27
  356. package/dist/pages-W4tKa7xk.mjs +0 -14
  357. package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
  358. package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
  359. package/dist/pipelines-Dug0BR-c.mjs +0 -6
  360. package/dist/precursor-D-11DkRU.mjs +0 -4
  361. package/dist/previews-D_Nv4dR6.mjs +0 -4
  362. package/dist/progress-a5IKeKni.mjs +0 -2
  363. package/dist/queries-BdA2vJoe.mjs +0 -3
  364. package/dist/queues-Bu06ZqUE.mjs +0 -7
  365. package/dist/r2-COC9wMKb.mjs +0 -25
  366. package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
  367. package/dist/radar-L-yoLIHF.mjs +0 -2
  368. package/dist/realtime-JKIiXfzi.mjs +0 -20
  369. package/dist/registrar-_dYUZrK0.mjs +0 -43
  370. package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
  371. package/dist/reporting-3fyoMcmb.mjs +0 -2
  372. package/dist/request-headers-BhQQAfJt.mjs +0 -2
  373. package/dist/request-tracers-TisEth2p.mjs +0 -2
  374. package/dist/resolve-CYUp6YgC.mjs +0 -2
  375. package/dist/resource-sharing-C4-dnohU.mjs +0 -6
  376. package/dist/resource-tagging-BRDifKqM.mjs +0 -2
  377. package/dist/rules-BCF3gIkw.mjs +0 -4
  378. package/dist/rulesets-wp6rllt3.mjs +0 -5
  379. package/dist/rum-B77awgoB.mjs +0 -4
  380. package/dist/run-BS8otL3u.mjs +0 -2
  381. package/dist/scim-C9BmUYil.mjs +0 -4
  382. package/dist/secrets-store-ckkZR2dM.mjs +0 -7
  383. package/dist/security-center-BCahKT57.mjs +0 -2
  384. package/dist/security-txt-0SI5du7I.mjs +0 -3
  385. package/dist/shared-D0B-7q-D.mjs +0 -2
  386. package/dist/smart-shield-BDPbrZa4.mjs +0 -4
  387. package/dist/snippets-CVRR_h0i.mjs +0 -4
  388. package/dist/spawn-DP4T92ss.mjs +0 -519
  389. package/dist/spectrum-CjNXQIQE.mjs +0 -63
  390. package/dist/speed-CrXCHk3h.mjs +0 -4
  391. package/dist/src-BbnV77C4.mjs +0 -108
  392. package/dist/ssl-DKORhHkh.mjs +0 -15
  393. package/dist/startup-profile-CBIH6yZy.mjs +0 -17
  394. package/dist/state-QUu6HfxC.mjs +0 -2
  395. package/dist/stream-wY3zi3FK.mjs +0 -16
  396. package/dist/submit-B-4oCBSk.mjs +0 -2
  397. package/dist/tags-5uJEkYJZ.mjs +0 -2
  398. package/dist/telemetry-n3NJourL.mjs +0 -2
  399. package/dist/tenant-BkFvv2o3.mjs +0 -2
  400. package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
  401. package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
  402. package/dist/tunnels-9Zg3ePwD.mjs +0 -5
  403. package/dist/turnstile-BTwKYpzD.mjs +0 -23
  404. package/dist/ui-DQSZeaG5.mjs +0 -5
  405. package/dist/url-info-D7Y61BFd.mjs +0 -2
  406. package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
  407. package/dist/url-scanner-CiCIltSQ.mjs +0 -2
  408. package/dist/user-DDFDGJ0Y.mjs +0 -12
  409. package/dist/values-DRznB_Cl.mjs +0 -2
  410. package/dist/vectorize-CbznPhzq.mjs +0 -4
  411. package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
  412. package/dist/web-assets-C-ZoSkkh.mjs +0 -8
  413. package/dist/web3-DwlN4dOw.mjs +0 -4
  414. package/dist/workers-builds-ECw_x_kp.mjs +0 -2
  415. package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
  416. package/dist/workers-vpc-CCosFcxz.mjs +0 -3
  417. package/dist/workers-zFMrbUkg.mjs +0 -6
  418. package/dist/workflows-C8GXGDRW.mjs +0 -5
  419. package/dist/zaraz-B5UIREaz.mjs +0 -2
  420. package/dist/zero-trust-DUp0XoIo.mjs +0 -91
  421. package/dist/zone-BGLkk-mL.mjs +0 -2
  422. package/dist/zones-CwYjNXMH.mjs +0 -44
  423. /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
  424. /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
  425. /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  426. /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
  427. /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
  428. /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  429. /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  430. /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  431. /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  432. /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
  433. /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  434. /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
  435. /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
  436. /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
  437. /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
  438. /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  439. /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  440. /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
  441. /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  442. /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
  443. /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  444. /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  445. /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
  446. /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  447. /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  448. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  449. /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  450. /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  451. /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e}from"./theme-CeVf-5qG.mjs";import{n as t,t as n}from"./local-BwL_gesw.mjs";import{f as r,g as i}from"./oauth-BdVr2hJp.mjs";import{a,o,r as s}from"./auth-DWxtJ918.mjs";import{t as c}from"./output-Z2lQmPUW.mjs";import{t as l}from"./dry-run-YSQndLvt.mjs";import{t as u}from"./progress-a5IKeKni.mjs";import{r as d,t as f}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as p,n as m,t as h}from"./body-parser-Cmw7PZ7a.mjs";import{n as g}from"./input-validation-nF-0Ze2h.mjs";import{a as _,i as v,n as ee,o as y,r as b}from"./prompt-BP8XrQSj.mjs";import{t as x}from"./cli-types-abvWQN3T.mjs";import{_ as S,a as C,c as w,d as T,g as E,h as D,i as O,m as k,o as A,p as j,r as M,s as te,t as N,u as ne}from"./schema-flags-CUGxFeZe.mjs";import{isDeepStrictEqual as re}from"node:util";import{domainToASCII as ie}from"node:url";function ae(e){return e.positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:ae,handler:async e=>f({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.extensions.get({account_id:a,extension:e.extension})),{successLabel:`Loaded`})})};function se(e){return e.option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
3
- Pass this value to fetch the next page of results. Omit (or
4
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:x(se),handler:async e=>f({command:`registrar extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){l({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/extensions`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.extensions.list({account_id:o,...t})),{successLabel:`Loaded`})})},le={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};async function P(e,t,n){let r=y(n),i=ie(n.trim().replace(/\.$/,``)).toLowerCase(),a=await u(`Checking availability`,()=>e.registrar.registrations.check({account_id:t,domains:[n]})),o=i===``?[]:a.domains.filter(e=>e.name.toLowerCase()===i),s=o.length===1?o[0]:void 0;if(!s)throw Error(`The availability check returned no result for ${r}, so cf cannot safely register it.`);if(s.registrable!==!0&&s.reason===`domain_premium`)throw Error(`${r} is a premium domain (domain_premium). Premium registration is not supported by this API, so cf will not submit it.`);if(s.registrable!==!0){let e=s.reason===void 0?``:` (${y(s.reason)})`;throw Error(`${r} is not available for registration${e}.`)}if(s.tier===`premium`)throw Error(`${r} is a premium domain. Premium registration is not supported by this API, so cf will not submit it.`);if(s.tier!==`standard`)throw Error(`${r} is not confirmed as a standard domain. This API only supports standard registrations, so cf will not submit it.`);if(!s.pricing)throw Error(`The availability check returned no pricing for ${r}, so cf cannot safely register it.`);return s.pricing}const F=`registrar-extension-schema`;function ue(e){let t=e.trim().toLowerCase().replace(/\.$/,``).split(`.`);return t.slice(1).map((e,n)=>t.slice(n+1).join(`.`))}async function de(e,t,n,r){let i;try{i=r===void 0?await n.registrar.extensions.get({account_id:t,extension:e}):await n.registrar.extensions.get({account_id:t,extension:e},{timeoutInSeconds:r/1e3,maxRetries:0})}catch(e){return{ok:!1,reason:k(e)}}let a=D(i,`registration_schema`);return a?{ok:!0,extension:e,schema:a}:{ok:!1,reason:`the API returned no registration schema for .${e}`}}async function I(e,t,n,r,i){let a=t?[t]:ue(e);if(a.length===0)return{ok:!1,reason:`'${e}' has no extension — pass a fully qualified domain name`};let o,s=`not found`;for(let e of a){let t=E(F,[n,e]);if(t)return{ok:!0,extension:e,schema:t};if(!o)try{o=await r()}catch(e){return{ok:!1,reason:k(e)}}let a;if(i!==void 0&&(a=i-Date.now(),a<=0))return{ok:!1,reason:`the request timed out`};let c=await de(e,n,o,a);if(c.ok)return S(F,[n,e],c.schema),c;if(s=c.reason,!/not found/i.test(c.reason))return c}return{ok:!1,reason:a.length>1?`no registration schema for ${a.map(e=>`.${e}`).join(` or `)} (${s})`:s}}const fe=new Set([`domain_name`,`years`,`auto_renew`,`privacy_mode`]),pe={acknowledgements:`Acknowledgements`,contact_extensions:`Registry Details`,contacts:`Contacts`};function me(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function he(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function L(e){return typeof e==`boolean`?e?`Yes`:`No`:e===null?`null`:typeof e==`string`||typeof e==`number`?String(e):JSON.stringify(e)??`undefined`}function R(e,t){return e.find(e=>e.path.length===t.length&&e.path.every((e,n)=>e===t[n]))}function ge(e,t,n){if(typeof t==`boolean`&&e.some(e=>e.includes(`acknowledgement`)))return t?`Accepted`:`Declined`;let r=R(n,e),i=L(t),a=me(r?.choiceLabels,i);if(a)return`${a} (${i})`;let o=(r?.schema.oneOf??r?.schema.anyOf)?.find(e=>e.title&&T(e,t).length===0);return o?.title?`${o.title} (${i})`:i}function _e(e,t){return e.map((n,r)=>r===e.length-1&&t?.schema.title?t.schema.title:me(pe,n)??he(n)).join(` · `)}function z(e,t,n=[]){let r=[];for(let[i,a]of Object.entries(e)){if(n.length===0&&fe.has(i))continue;let e=[...n,i];if(typeof a==`object`&&a&&!Array.isArray(a)&&Object.keys(a).length>0){r.push(...z(a,t,e));continue}let o=R(t,e);r.push([_e(e,o),ge(e,a,t)])}return r.sort(([e],[t])=>e.localeCompare(t))}function B(e,t,n){if(Object.hasOwn(e,n))return L(e[n]);let r=ve(t,n);return r===void 0?`API default`:`${L(r)} (default)`}function V(e){return e===void 0?[]:[...e.default===void 0?[]:[e.default],...(e.allOf??[]).flatMap(V)]}function H(e,t){return e===void 0?[]:[...V(e.properties?.[t]),...(e.allOf??[]).flatMap(e=>H(e,t))]}function ve(e,t){let n=H(e,t),r=n[0];return n.length>0&&n.every(e=>re(e,r))?r:void 0}function U(t){let n=t.map(([e,t])=>[y(e),y(t)]),r=Math.min(32,Math.max(...n.map(([e])=>e.length),0));return n.map(([t,n])=>`│ ${e.muted(t.padEnd(r))} ${e.bold(n)}`)}function ye(t){let n=[[`Domain`,t.domain],[`Account`,t.accountId],[`Registration term`,`${t.years} ${t.years===1?`year`:`years`}`],[`Due now`,t.quotedCost],[`Renewal price`,`${t.pricing.currency} ${t.pricing.renewal_cost} per year`],[`Auto-renew`,B(t.body,t.schema,`auto_renew`)],[`Privacy mode`,B(t.body,t.schema,`privacy_mode`)]],r=z(t.body,t.descriptors??[]);return[`│`,`${e.brand(`◇`)} ${e.bold(`Review registration`)}`,`│`,...U(n),...r.length>0?[`│`,`│ ${e.bold(`Registration details`)}`,...U(r)]:[],`│`].join(`
5
- `)}const W=[`domain_name`],G=`Fully qualified domain name to register, e.g. example.travel`,K=[`domain-name`,`domainName`,`extension`,`force`,`f`,`prefer`,`contacts`];function be(e){return`/${e.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}function xe(e,t,n){return t.some(t=>{if(t.path[0]!==e||t.path.length===1)return!1;let r=t.name.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase());return Object.hasOwn(n,t.name)&&n[t.name]!==void 0||Object.hasOwn(n,r)&&n[r]!==void 0})}function Se(e){if(e.choices===void 0)return;let t=(e.schema.enum??(e.schema.oneOf??e.schema.anyOf)?.flatMap(e=>e.const===void 0?e.enum??[]:[e.const]))?.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t?.length===e.choices.length?t:void 0}function Ce(e){let t=e.type===`boolean`&&e.schema.const===!0,n=e.schema.description,r=n===void 0?void 0:y(n);return{path:be(e.path),flag:`--${e.name}`,question:te(e),description:r,choices:Se(e)?.map(t=>{let n=String(t);return{value:t,label:y(e.choiceLabels!==void 0&&Object.hasOwn(e.choiceLabels,n)?e.choiceLabels[n]??n:n)}}),requiredValue:e.schema.const,acknowledgementText:t?r:void 0}}function q(e,t,n,r,i){let a=C(n,r);return a.length===0?!1:(c({submitted:!1,reason:`registration_input_required`,message:`Not submitted. Additional registration input is required.`,domainName:e,extension:t,missingFields:a.map(Ce),validationErrors:i}),!0)}function J(e){let t=/^(\d+)(?:\.(\d+))?$/.exec(e);if(!t)return;let n=t[2]??``;return{units:BigInt(`${t[1]}${n}`),scale:n.length}}function we(e,t){let n=J(e.registration_cost),r=J(e.renewal_cost);if(!n||!r)return;let i=Math.max(n.scale,r.scale),a=e=>10n**BigInt(e),o=n.units*a(i-n.scale)+r.units*a(i-r.scale)*BigInt(t-1);if(i===0)return o.toString();let s=a(i);return`${o/s}.${(o%s).toString().padStart(i,`0`)}`}function Te(e,t){let n=we(e,t);if(!n||!/^[A-Z]{3}$/.test(e.currency))throw Error(`The availability check returned invalid pricing, so cf cannot safely confirm this registration.`);return`${e.currency} ${n}`}function Y(e,t){return e.flatMap(e=>t.map(t=>[...e,...t]))}function X(e,t,n,r=!1,i=[]){let a=e.properties?.[t],o=a!==void 0,s=[a===void 0?[]:[a]],c=e.if&&e.then&&M(e.if)&&T(e.if,n).length===0?[e.then]:[];for(let a of[...e.allOf??[],...c]){let e=X(a,t,n,r,i);e.found&&(o=!0,s=Y(s,e.bundles))}for(let a of[e.oneOf,e.anyOf]){if(!a?.length)continue;let e=r&&a.every(M)?a.filter(e=>ke(e,t,n,i)):[],c=(e.length>0?e:a).map(e=>X(e,t,n,r,i));c.some(e=>e.found)&&(o=!0,s=Y(s,c.flatMap(e=>e.bundles)))}return{found:o,bundles:s}}function Z(e,t){let n=e[t];return[...n===void 0?[]:[n],...(e.allOf??[]).flatMap(e=>Z(e,t))]}function Q(e){return e.length===0?{}:e.length===1?e[0]??{}:{allOf:e}}function Ee(e){let t=[...typeof e.minimum==`number`?[e.exclusiveMinimum===!0?Math.floor(e.minimum)+1:Math.ceil(e.minimum)]:[],...typeof e.exclusiveMinimum==`number`?[Math.floor(e.exclusiveMinimum)+1]:[],...(e.allOf??[]).flatMap(e=>{let t=Ee(e);return t===void 0?[]:[t]})];return t.length>0?Math.max(1,...t):void 0}function De(e){let t=Z(e,`const`);if(t.length>0)return t.every(e=>Object.is(e,t[0]))?{found:!0,value:t[0]}:{found:!1};let n=Z(e,`default`);if(n.length>0)return n.every(e=>Object.is(e,n[0]))?{found:!0,value:n[0]}:{found:!1};let r=Ee(e);return r===void 0?{found:!1}:{found:!0,value:r}}function $(e){let{allOf:t,anyOf:n,oneOf:r,...i}=e,a=[Object.keys(i).length===0?[]:[i]];for(let e of t??[])a=Y(a,$(e).map(e=>[e]));for(let e of[r,n])e?.length&&(a=Y(a,e.flatMap(e=>$(e).map(e=>[e]))));return a.map(Q)}function Oe(e){return e.flatMap(e=>$(e).map(t=>({schema:e,candidate:De(t)})))}function ke(e,t,n,r){let i=T(e,n);return Object.hasOwn(n,t)||i.length===0?i.length===0:r.some(r=>T(e,{...n,[t]:r}).length===0)}function Ae(e,t){let n=Object.hasOwn(e,`years`),r=X(t,`years`,e,!1);if(!r.found)throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let i=r.bundles.map(Q),a=X(t,`years`,e,!0,n?[]:Oe(i).flatMap(({schema:e,candidate:t})=>t.found&&T(e,t.value).length===0?[t.value]:[]));if(!a.found||n&&a.bundles.some(e=>e.length===0))throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let o=a.bundles.map(Q),s=o,c,l;if(n)l=e.years;else{let n=Oe(o).filter(({schema:e,candidate:t})=>{if(!t.found)return!0;let[n]=T(e,t.value);return n===void 0?!0:(c??=n,!1)});if(M(t)){let r=n.filter(({candidate:e})=>!e.found),i=n.filter(({candidate:n})=>n.found&&T(t,{...e,years:n.value}).length===0);i.length>0&&(n=[...r,...i])}s=n.map(({schema:e})=>e);let r=n.map(({candidate:e})=>e),[i]=r;l=i?.found===!0&&r.every(e=>e.found&&Object.is(e.value,i.value))?i.value:void 0}if(typeof l!=`number`||!Number.isInteger(l)||l<=0)throw!n&&s.length===0&&c?Error(`The extension schema returned an invalid default registration term: ${c}`):Error(n?`The requested registration term must be a positive whole number of years.`:`The extension schema returned no safe default registration term, so cf cannot safely confirm this registration.`);let u=n?T(o.length===1?o[0]??{}:{anyOf:o},l):s.flatMap(e=>T(e,l));if(u.length>0)throw Error(n?`The requested registration term is invalid: ${u[0]}`:`The extension schema returned an invalid default registration term: ${u[0]}`);return e.years=l,l}let je;function Me(e){let t=g(e,`domain-name`,`text`);if(t!==void 0&&typeof t!=`string`)throw Error(`--domain-name must be a string`);return t}function Ne(e){return je=e,e.positional(`domain-name`,{type:`string`,description:`Fully qualified domain name, e.g. example.travel`}).option(`extension`,{type:`string`,description:`Extension whose registration schema to use (default: derived from the domain)`}).option(`prefer`,{type:`string`,description:"Set the Prefer header, e.g. `respond-async` to skip the synchronous wait"}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip the registration confirmation prompt`,default:!1}).option(`contacts`,{type:`string`,description:`Registrant contacts as inline JSON or @path to a reusable JSON file`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this extension's input flags`}).epilogue("Input flags depend on the extension: run `cf registrar registrations create <domain> --help`.\ncf rechecks availability and pricing before confirmation. Run `cf registrar registrations check --domains <domain>` to inspect them separately.")}async function Pe(t){je?.showHelp(`log`);let n=Me(t[`domain-name`]);if(!n)return;let r=y(n);if(t.local){console.log(`\n${e.muted(`Registration fields are unavailable in local mode.`)}`);return}let i=Date.now()+j,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the registration fields for ${r}.`)}`);return}let c=await I(n,t.extension,a,()=>s(t),i);console.log(c.ok?`\n${A(w(c.schema,{exclude:[W]}),`Registration fields for .${c.extension}`)}`:`\n${e.muted(`Could not load the registration fields for ${r}: ${y(c.reason)}.`)}`)}async function Fe(e,t,n){for(;;){let r=O(e,t,n);if(r.length===0)return!0;for(let e of r){let n=e.description??``,r=te(e);if(e.type===`boolean`&&e.schema.const===!0){let r=y(e.schema.description??n);if(!await b(e.name,r))return!1;t[e.name]=!0}else e.choices?.length?t[e.name]=await v(e.name,r,e.choices,e.choiceLabels):t[e.name]=await _(e.name,r,{validate:t=>ne(e,t)})}}}function Ie(e){let t=m(e);if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--body must contain a JSON object`);return t}function Le(e){let t;if(e.startsWith(`@`))t=g(e,`contacts`,`json`);else try{t=JSON.parse(e)}catch{throw Error(`--contacts must contain a JSON object or @path to a JSON file`)}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--contacts must contain a JSON object or @path to a JSON file`);return t}var Re=d({command:`create [domain-name]`,describe:"Register a domain. Billable and non-refundable — input fields are extension-specific, see `create <domain> --help`",builder:Ne,handler:async e=>{if(e.help){await Pe(e);return}if(e.local)throw Error(t);let n={};e.prefer!==void 0&&(n.Prefer=String(e.prefer));let o;if(e.body!==void 0){let t=N([],e,{reserved:K}).errors.some(e=>e.startsWith(`Unknown flag`));if(e.contacts!==void 0||t)throw Error(`--body cannot be combined with registration field flags. Pass one or the other.`);o=Ie(e.body)}let d=e.contacts===void 0?void 0:Le(e.contacts),f=Me(e[`domain-name`]),p=o?.domain_name;if(p!==void 0&&typeof p!=`string`)throw Error(`--body field domain_name must be a string`);if(f!==void 0&&p!==void 0&&f!==p)throw Error(`The positional domain '${y(f)}' does not match --body domain_name '${y(p)}'`);let m=f??p;if(!m){if(o!==void 0){c({submitted:!1,reason:`registration_input_required`,message:`Not submitted. A domain is required to determine the registration schema.`,missingFields:[{path:`/domain_name`,flag:`--domain-name`,question:G}],validationErrors:["`/domain_name` is required"]});return}m=await _(`domain-name`,G)}let h=y(m);o&&(o.domain_name=m);let g=e.dryRun?await i()??`<account-id>`:await r(),v,b=async()=>(v||=await s(e),v);e.dryRun||await P(await b(),g,m);let x=await I(m,e.extension,g,b);if(!x.ok)throw Error(`Could not load the registration schema for ${h}: ${y(x.reason)}.`);let S=y(x.extension),C=x.schema,E=w(x.schema,{exclude:[W]});if(!o){if(d!==void 0&&xe(`contacts`,E,e))throw Error(`--contacts cannot be combined with --contacts-* fields. Pass one or the other.`);let t={...e},n=d===void 0?void 0:{contacts:d};if(n!==void 0&&delete t.contacts,!await Fe(E,t,n))return;let r=N(E,t,{reserved:K,baseBody:n});if(r.errors.length>0)throw Error(`${r.errors.join(`
6
- `)}\n\nRun \`cf registrar registrations create ${h} --help\` for .${S}'s registration fields.`);o={domain_name:m,...r.body}}let D;try{D=Ae(o,C)}catch(e){let t=T(C,o);if(q(m,x.extension,E,o,t))return;throw e}let O=T(C,o);if(q(m,x.extension,E,o,O))return;if(O.length>0)throw Error(`${O.join(`
7
- `)}\n\nRun \`cf registrar registrations create ${h} --help\` for this extension's registration fields.`);if(e.dryRun){l({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${g}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:o});return}let k=await P(await b(),g,m),A=Te(k,D);if(e.force||process.stderr.write(`${ye({domain:m,accountId:g,years:D,quotedCost:A,pricing:k,body:o,schema:C,descriptors:E})}\n`),!await ee({force:e.force,message:`Registering ${h} for ${D} ${D===1?`year`:`years`} costs ${A}, charges the account's default payment method, and cannot be refunded.`}))return;if(o.years!==D)throw Error(`The registration term changed after confirmation, so cf will not submit this registration.`);let j=await P(await b(),g,m);if(j.currency!==k.currency||j.registration_cost!==k.registration_cost||j.renewal_cost!==k.renewal_cost)throw Error(`Availability or pricing changed while awaiting confirmation, so cf will not submit this registration. Re-run the command to review the current quote.`);let M=await b();e.accountId=g,c(await u(`Registering`,async()=>a(M,`POST`,`/accounts/${g}/registrar/registrations`,{body:o,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Registered ${h}`})}},{command:`registrar registrations create`,recordArgs:!1});function ze(e){return e.positional(`domains`,{type:`string`,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const Be={command:`check <domains>`,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:ze,handler:async e=>f({command:`registrar registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:m(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=m(e.body);c(await u(`Creating`,async()=>t.registrar.registrations.check({...n,account_id:a})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Ve(e){return e.positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`get-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:Ve,handler:async e=>f({command:`registrar registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.getRegistrationStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})})};function Ue(e){return e.positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`get-transfer-status <domain-name>`,describe:"Returns the current status of a domain transfer workflow. Use this endpoint to poll transfer progress after initiating a transfer with `POST /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in`. The URL is provided in the `links.self` field of the transfer response. ### Transfer timelines Transfers typically take 1–10 days due to ICANN-mandated approval windows. ### Workflow states **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `in_progress`: Transfer has been submitted to the registry and is being processed. Continue polling. - `blocked`: The workflow is waiting on the losing registrar or registry to release the domain. This is the **most common state** for transfers and is entirely normal — it means the ICANN transfer approval window is in effect. The losing registrar has up to 5 days to approve or reject. Continue polling with longer intervals (e.g., every 30–60 minutes). - `action_required`: The user needs to take action (e.g., the FOA email needs to be accepted). See `context` for details on what is needed. - `pending`: Transfer workflow created but not yet started processing. ### Polling guidance Adjust your polling interval based on the current workflow state: - `pending` or `in_progress`: Poll every 30 seconds. - `blocked`: The transfer is waiting on a third party (e.g., losing registrar approval). Poll every 30–60 minutes. - `action_required`: Stop polling. The workflow will not advance until the user takes action. Check `context` for details on what is needed. - `succeeded` or `failed`: Terminal — stop polling.",builder:Ue,handler:async e=>f({command:`registrar registrations get-transfer-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar registrations get-transfer-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.getTransferStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})})};function Ge(e){return e.positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ke={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:Ge,handler:async e=>f({command:`registrar registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.getUpdateStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})})};function qe(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 Je={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:qe,handler:async e=>f({command:`registrar registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.registrar.registrations.get({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})})};function Ye(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
8
- Pass this value to fetch the next page of results. Omit (or
9
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date (`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={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:x(Ye),handler:async e=>f({command:`registrar registrations list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){l({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.list({account_id:o,...t})),{successLabel:`Loaded`})})};function Ze(e){return e.option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
10
- - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
11
- - 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,
12
- returns results across all supported extensions. Extensions not in the supported
13
- 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 Qe={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:Ze,handler:async e=>f({command:`registrar registrations search`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={q:e.query,extensions:e.extensions,limit:e.limit};if(e.dryRun){l({command:`cf registrar registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.search({account_id:o,...t})),{successLabel:`Loaded`})})};function $e(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to transfer.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to indicate a preference for asynchronous\nprocessing (RFC 7240)."}).option(`auth-code`,{type:`string`,description:`The EPP/authorization code from your current registrar, base64-encoded
14
- per RFC 4648 §4. Obtain this from your current registrar's control panel.
15
- Required for all extensions, except for UK.
16
- `}).option(`auto-renew`,{type:`boolean`,description:"Enable or disable automatic renewal after transfer. Defaults to `false` if omitted.\n",default:!1}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
17
- communications from the registry, including ownership verification
18
- and renewal notices.
19
- `}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
20
- Most registrations do not require a fax number.
21
- `}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
22
- communications from the registry, including ownership verification
23
- and renewal notices.
24
- `}).option(`contacts-billing-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
25
- Most registrations do not require a fax number.
26
- `}).option(`contacts-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-billing-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
27
- communications from the registry, including ownership verification
28
- and renewal notices.
29
- `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
30
- Most registrations do not require a fax number.
31
- `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
32
- communications from the registry, including ownership verification
33
- and renewal notices.
34
- `}).option(`contacts-technical-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
35
- Most registrations do not require a fax number.
36
- `}).option(`contacts-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-technical-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`privacy-mode`,{type:`string`,description:`WHOIS privacy mode to apply after transfer completes. Defaults to
37
- the extension's default privacy mode (typically \`redaction\`).
38
- `,choices:[`off`,`redaction`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`,`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`,`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`,`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --contacts-* flag is set`)}return!0})}const et={command:`transfer-in <domain-name>`,describe:"Starts a domain transfer-in workflow. This is typically a billable operation — successful transfers charge the account's default payment method, except for extensions with zero transfer pricing (e.g. UK extensions). All successful domain transfers are non-refundable. ### How transfers work Domain transfers move a domain from another registrar to Cloudflare. Transfers typically take 1-10 days due to ICANN-mandated approval windows. ### Prerequisites - The domain must already have a zone in the Cloudflare account (added through the dashboard or zone API). - The zone must have DNSSec disabled. - For billable transfers (i.e. extensions with non-zero transfer pricing), 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 domain must be unlocked at the current registrar. - An authorization/EPP code from the current registrar is required, except for UK extensions — see Auth code below. ### Auth code An authorization code (also called EPP code, transfer key, or auth-info code) is required for most extensions, with the exception of UK extensions. Obtain this from your current registrar's control panel. The auth code in the request body must be base64-encoded per RFC 4648 §4 (standard alphabet, no line breaks). ### Response behavior Successful transfer initiation returns `202 Accepted`. Validation or initiation failures return the documented `4XX` responses. Poll `GET /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in-status` to track progress. ### Premium domains Premium domain transfers are not currently supported by this API. Please use the [dashboard](https://dash.cloudflare.com/) for now. ### Billing The account's default payment method is charged upon successful transfer completion, unless the extension has zero transfer pricing (e.g. UK extensions). The transfer adds time to the domain's existing expiration date (typically 1 year).",builder:$e,handler:async e=>f({command:`registrar registrations transfer-in`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){l({command:`cf registrar registrations transfer-in`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?h({auth_code:g(e[`auth-code`],`auth-code`,`text`),auto_renew:e[`auto-renew`],contacts:{administrator:{email:g(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:g(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:g(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:g(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:g(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:g(e[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:g(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:g(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:g(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:g(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:g(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:g(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:g(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:g(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:g(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:g(e[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:g(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:g(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:g(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:g(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},privacy_mode:g(e[`privacy-mode`],`privacy-mode`,`text`)}):m(e.body)});return}let o=await s(e),d=e.local?n:await r();if(e.accountId=d,e.body){let n=m(e.body);c(await u(`Creating`,async()=>a(o,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:n,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`});return}let f={};e[`auth-code`]!==void 0&&p(f,[`auth_code`],g(e[`auth-code`],`auth-code`,`text`)),e[`auto-renew`]!==void 0&&p(f,[`auto_renew`],e[`auto-renew`]),e[`contacts-administrator-email`]!==void 0&&p(f,[`contacts`,`administrator`,`email`],g(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),e[`contacts-administrator-fax`]!==void 0&&p(f,[`contacts`,`administrator`,`fax`],g(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),e[`contacts-administrator-phone`]!==void 0&&p(f,[`contacts`,`administrator`,`phone`],g(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),e[`contacts-administrator-postal-info-name`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`name`],g(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),e[`contacts-administrator-postal-info-organization`]!==void 0&&p(f,[`contacts`,`administrator`,`postal_info`,`organization`],g(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),e[`contacts-billing-email`]!==void 0&&p(f,[`contacts`,`billing`,`email`],g(e[`contacts-billing-email`],`contacts-billing-email`,`text`)),e[`contacts-billing-fax`]!==void 0&&p(f,[`contacts`,`billing`,`fax`],g(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),e[`contacts-billing-phone`]!==void 0&&p(f,[`contacts`,`billing`,`phone`],g(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),e[`contacts-billing-postal-info-name`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`name`],g(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),e[`contacts-billing-postal-info-organization`]!==void 0&&p(f,[`contacts`,`billing`,`postal_info`,`organization`],g(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),e[`contacts-registrant-email`]!==void 0&&p(f,[`contacts`,`registrant`,`email`],g(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),e[`contacts-registrant-fax`]!==void 0&&p(f,[`contacts`,`registrant`,`fax`],g(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),e[`contacts-registrant-phone`]!==void 0&&p(f,[`contacts`,`registrant`,`phone`],g(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),e[`contacts-registrant-postal-info-name`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`name`],g(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),e[`contacts-registrant-postal-info-organization`]!==void 0&&p(f,[`contacts`,`registrant`,`postal_info`,`organization`],g(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),e[`contacts-technical-email`]!==void 0&&p(f,[`contacts`,`technical`,`email`],g(e[`contacts-technical-email`],`contacts-technical-email`,`text`)),e[`contacts-technical-fax`]!==void 0&&p(f,[`contacts`,`technical`,`fax`],g(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),e[`contacts-technical-phone`]!==void 0&&p(f,[`contacts`,`technical`,`phone`],g(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),e[`contacts-technical-postal-info-name`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`name`],g(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),e[`contacts-technical-postal-info-organization`]!==void 0&&p(f,[`contacts`,`technical`,`postal_info`,`organization`],g(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),e[`privacy-mode`]!==void 0&&p(f,[`privacy_mode`],g(e[`privacy-mode`],`privacy-mode`,`text`)),c(await u(`Creating`,async()=>a(o,`POST`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:Object.keys(f).length>0?f:void 0,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`})})};function tt(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.
39
- Setting this field to \`true\` authorizes Cloudflare to charge the
40
- account's default payment method up to 30 days before domain expiry
41
- to renew the domain automatically. Renewal pricing may change over
42
- time based on registry pricing.
43
- `}).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 nt={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:tt,handler:async e=>f({command:`registrar registrations update`,classification:{safeFlags:[`auto-renew`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){l({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?h({auto_renew:e[`auto-renew`]}):m(e.body)});return}let o=await s(e),d=e.local?n:await r();if(e.accountId=d,e.body){let n=m(e.body);c(await u(`Updating`,async()=>a(o,`PATCH`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:n,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Updated`});return}let f={};e[`auto-renew`]!==void 0&&p(f,[`auto_renew`],e[`auto-renew`]),c(await u(`Updating`,async()=>a(o,`PATCH`,`/accounts/${d}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:Object.keys(f).length>0?f:void 0,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Updated`})})},rt={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(Be).command(Re).command(Je).command(He).command(We).command(Ke).command(Xe).command(Qe).command(et).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},it={command:`registrar`,describe:`registrar`,builder:e=>e.command(le).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{it as default};
@@ -1,56 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{a as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(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 g={command:`get <extension>`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:h,handler:async r=>c({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/extensions/${r.extension==null?`<extension>`:encodeURIComponent(String(r.extension))}`,pathParams:{extension:String(r.extension??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:r.extension})),{successLabel:`Loaded`})})};function _(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 v={command:`list`,describe:"Returns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.",builder:m(_),handler:async r=>c({command:`registrar-sandbox extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},r,async()=>{let c={name:r.name,cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})})},y={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.positional(`domains`,{type:`string`,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const x={command:`check <domains>`,describe:"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:b,handler:async r=>c({command:`registrar-sandbox registrations check`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...e,account_id:l})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function S(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
5
- waiting for the operation to complete (RFC 7240).
6
-
7
- The header may be combined with other preferences using standard
8
- comma-separated syntax.`}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal. Defaults to \`false\` if omitted.
9
- Setting this field to \`true\` is an explicit opt-in authorizing
10
- Cloudflare to charge the account's default payment method up to 30
11
- days before domain expiry to renew the domain automatically.
12
- Renewal pricing may change over time based on registry pricing.
13
- `,default:!1}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
14
- communications from the registry, including ownership verification
15
- and renewal notices.
16
- `}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
17
- Most registrations do not require a fax number.
18
- `}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
19
- communications from the registry, including ownership verification
20
- and renewal notices.
21
- `}).option(`contacts-billing-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-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-billing-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
24
- communications from the registry, including ownership verification
25
- and renewal notices.
26
- `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
27
- Most registrations do not require a fax number.
28
- `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-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
29
- communications from the registry, including ownership verification
30
- and renewal notices.
31
- `}).option(`contacts-technical-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-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-technical-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`domain-name`,{type:`string`,description:`Provides a fully qualified domain name (FQDN), including the extension
34
- (e.g., \`example.com\`, \`mybrand.app\`). The domain name uniquely identifies
35
- a registration. Cloudflare permits only one registration per domain, making
36
- the domain name a natural idempotency key for registration requests.
37
- `}).option(`privacy-mode`,{type:`string`,description:"Sets the WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Disables WHOIS privacy.\n- `redaction`: Requests WHOIS redaction where the extension supports it.\n Some extensions exclude privacy and redaction.\n",choices:[`off`,`redaction`],default:`redaction`}).option(`years`,{type:`number`,description:`Sets the registration term from 1 to 10 years. When omitted, this
38
- field defaults to the registry's minimum registration period for the
39
- extension. Most extensions require 1 year, while some require longer
40
- minimum terms (e.g., \`.ai\` requires 2 years).
41
-
42
- Each registry may also enforce its own maximum registration term. A
43
- request above that maximum fails. When uncertain, omit this field to
44
- use the default.
45
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`,`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`,`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`,`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --contacts-* flag is set`)}return!0})}const C={command:`create`,describe:"Starts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 500 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:S,handler:async m=>c({command:`registrar-sandbox registrations create`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},m,async()=>{let c={};if(m.prefer!==void 0&&(c.Prefer=String(m.prefer)),m.dryRun){o({command:`cf registrar-sandbox registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},bodyKind:`json`,body:m.body===void 0?d({auto_renew:m[`auto-renew`],contacts:{administrator:{email:f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:f(m[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:f(m[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},domain_name:f(m[`domain-name`],`domain-name`,`text`),privacy_mode:f(m[`privacy-mode`],`privacy-mode`,`text`),years:m.years}):u(m.body)});return}let h=await i(m),g=m.local?e:await t();if(m.accountId=g,m.body){let e=u(m.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}m[`domain-name`]===void 0&&(m[`domain-name`]=await p(`domain-name`,"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests. "));let _={};m[`auto-renew`]!==void 0&&l(_,[`auto_renew`],m[`auto-renew`]),m[`contacts-administrator-email`]!==void 0&&l(_,[`contacts`,`administrator`,`email`],f(m[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),m[`contacts-administrator-fax`]!==void 0&&l(_,[`contacts`,`administrator`,`fax`],f(m[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),m[`contacts-administrator-phone`]!==void 0&&l(_,[`contacts`,`administrator`,`phone`],f(m[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),m[`contacts-administrator-postal-info-name`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`name`],f(m[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),m[`contacts-administrator-postal-info-organization`]!==void 0&&l(_,[`contacts`,`administrator`,`postal_info`,`organization`],f(m[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),m[`contacts-billing-email`]!==void 0&&l(_,[`contacts`,`billing`,`email`],f(m[`contacts-billing-email`],`contacts-billing-email`,`text`)),m[`contacts-billing-fax`]!==void 0&&l(_,[`contacts`,`billing`,`fax`],f(m[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),m[`contacts-billing-phone`]!==void 0&&l(_,[`contacts`,`billing`,`phone`],f(m[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),m[`contacts-billing-postal-info-name`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`name`],f(m[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),m[`contacts-billing-postal-info-organization`]!==void 0&&l(_,[`contacts`,`billing`,`postal_info`,`organization`],f(m[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),m[`contacts-registrant-email`]!==void 0&&l(_,[`contacts`,`registrant`,`email`],f(m[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),m[`contacts-registrant-fax`]!==void 0&&l(_,[`contacts`,`registrant`,`fax`],f(m[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),m[`contacts-registrant-phone`]!==void 0&&l(_,[`contacts`,`registrant`,`phone`],f(m[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),m[`contacts-registrant-postal-info-name`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`name`],f(m[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),m[`contacts-registrant-postal-info-organization`]!==void 0&&l(_,[`contacts`,`registrant`,`postal_info`,`organization`],f(m[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),m[`contacts-technical-email`]!==void 0&&l(_,[`contacts`,`technical`,`email`],f(m[`contacts-technical-email`],`contacts-technical-email`,`text`)),m[`contacts-technical-fax`]!==void 0&&l(_,[`contacts`,`technical`,`fax`],f(m[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),m[`contacts-technical-phone`]!==void 0&&l(_,[`contacts`,`technical`,`phone`],f(m[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),m[`contacts-technical-postal-info-name`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`name`],f(m[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),m[`contacts-technical-postal-info-organization`]!==void 0&&l(_,[`contacts`,`technical`,`postal_info`,`organization`],f(m[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),m[`domain-name`]!==void 0&&l(_,[`domain_name`],f(m[`domain-name`],`domain-name`,`text`)),m[`privacy-mode`]!==void 0&&l(_,[`privacy_mode`],f(m[`privacy-mode`],`privacy-mode`,`text`)),m.years!==void 0&&l(_,[`years`],m.years),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar-sandbox/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function w(e){return e.positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={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:w,handler:async r=>c({command:`registrar-sandbox registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getRegistrationStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})})};function E(e){return e.positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={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:E,handler:async r=>c({command:`registrar-sandbox registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.getUpdateStatus({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})})};function O(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 k={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:O,handler:async r=>c({command:`registrar-sandbox registrations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.registrations.get({account_id:l,domain_name:r[`domain-name`]})),{successLabel:`Loaded`})})};function A(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
46
- Pass this value to fetch the next page of results. Omit (or
47
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date (`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:"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:m(A),handler:async r=>c({command:`registrar-sandbox registrations list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},r,async()=>{let c={cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.list({account_id:u,...c})),{successLabel:`Loaded`})})};function M(e){return e.option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
48
- - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
49
- - 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,
50
- returns results across all supported extensions. Extensions not in the supported
51
- 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 N={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:M,handler:async r=>c({command:`registrar-sandbox registrations search`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={q:r.query,extensions:r.extensions,limit:r.limit};if(r.dryRun){o({command:`cf registrar-sandbox registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/domain-search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.registrations.search({account_id:u,...c})),{successLabel:`Loaded`})})};function P(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.
52
- Setting this field to \`true\` authorizes Cloudflare to charge the
53
- account's default payment method up to 30 days before domain expiry
54
- to renew the domain automatically. Renewal pricing may change over
55
- time based on registry pricing.
56
- `}).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 F={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:P,handler:async f=>c({command:`registrar-sandbox registrations update`,classification:{safeFlags:[`auto-renew`,`dry-run`]}},f,async()=>{let c={};if(f.prefer!==void 0&&(c.Prefer=String(f.prefer)),f.dryRun){o({command:`cf registrar-sandbox registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/registrar-sandbox/registrations/${f[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(f[`domain-name`]))}`,pathParams:{"domain-name":String(f[`domain-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({auto_renew:f[`auto-renew`]}):u(f.body)});return}let p=await i(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=u(f.body);a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(f[`domain-name`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let h={};f[`auto-renew`]!==void 0&&l(h,[`auto_renew`],f[`auto-renew`]),a(await s(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar-sandbox/registrations/${encodeURIComponent(String(f[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},I={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(x).command(C).command(k).command(T).command(D).command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`registrar-sandbox`,describe:`registrar-sandbox`,builder:e=>e.command(y).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{L as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c}from"./body-parser-Cmw7PZ7a.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Gets the industry classification for an account.`,builder:l,handler:async c=>s({command:`reporting industry get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting industry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.industry.get({account_id:l})),{successLabel:`Loaded`})})};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`update`,describe:`Updates the industry classification for an account.`,builder:d,handler:async l=>s({command:`reporting industry update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf reporting industry update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.reporting.industry.update({...e,account_id:u})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},p={command:`industry`,describe:`Operations for industry`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.positional(`policy-id`,{type:`string`,description:`Unique identifier for the policy (UUID format)`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <policy-id>`,describe:`Gets a reporting policy by identifier.`,builder:m,handler:async c=>s({command:`reporting policies get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/policies/${c[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(c[`policy-id`]))}`,pathParams:{"policy-id":String(c[`policy-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.policies.get({account_id:l,policy_id:c[`policy-id`]})),{successLabel:`Loaded`})})};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Lists all reporting policies for an account.`,builder:g,handler:async c=>s({command:`reporting policies list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/policies`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.policies.list({account_id:l})),{successLabel:`Loaded`})})},v={command:`policies`,describe:`Operations for policies`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.positional(`report-id`,{type:`string`,description:`Unique report identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <report-id>`,describe:`Gets a generated report by identifier.`,builder:y,handler:async c=>s({command:`reporting reports get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.reports.get({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists all generated reports for an account.`,builder:x,handler:async c=>s({command:`reporting reports list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/reporting/reports`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.reports.list({account_id:l})),{successLabel:`Loaded`})})},C={command:`reports`,describe:`Operations for reports`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`reporting`,describe:`reporting`,builder:e=>e.command(p).command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{o as e}from"./lifecycle-CadF_i2n.mjs";import{i as t,t as n}from"./interactive-CGOh-aYq.mjs";const r=new Set([``,`0`,`false`,`no`,`off`]);function i(e,t){let n=e[t];if(typeof n!=`string`)return;let i=n.trim();return r.has(i.toLowerCase())?void 0:i}function a(e,t,n){return e[t]===n}function o(e,t,n){return t&&e.push(n),t}function s(e,t,n={}){return{harness:e,...n,signals:t}}const c=[e=>a(e,`OPENCODE`,`1`)?s({id:`opencode`,name:`OpenCode`},[`OPENCODE`]):null,e=>{let t=i(e,`QWEN_CODE_SESSION_ID`);if(!t)return null;let n=[`QWEN_CODE_SESSION_ID`],r=i(e,`QWEN_CODE_MODEL`),a=i(e,`QWEN_CODE_AGENT_ID`),o=i(e,`QWEN_CODE_PROMPT_ID`);return r&&n.push(`QWEN_CODE_MODEL`),a&&n.push(`QWEN_CODE_AGENT_ID`),o&&n.push(`QWEN_CODE_PROMPT_ID`),s({id:`qwen-code`,name:`Qwen Code`},n,{model:r?{id:r}:void 0,sessionId:t,invocationId:a??o})},e=>{let t=[],n=o(t,a(e,`PI_CODING_AGENT`,`true`),`PI_CODING_AGENT`),r=o(t,a(e,`AI_AGENT`,`pi`),`AI_AGENT`);if(!n&&!r)return null;let c=i(e,`PI_SESSION_ID`),l=i(e,`PI_PROVIDER`),u=i(e,`PI_MODEL`);return c&&t.push(`PI_SESSION_ID`),l&&t.push(`PI_PROVIDER`),u&&t.push(`PI_MODEL`),s({id:`pi`,name:`Pi`},t,{model:u?{id:u,provider:l}:void 0,sessionId:c})},e=>{if(!a(e,`CURSOR_AGENT`,`1`))return null;let t=[`CURSOR_AGENT`],n=i(e,`CURSOR_CONVERSATION_ID`),r=i(e,`CURSOR_TRACE_ID`);return n&&t.push(`CURSOR_CONVERSATION_ID`),r&&t.push(`CURSOR_TRACE_ID`),s({id:`cursor-agent`,name:`Cursor Agent`},t,{sessionId:n,invocationId:r})},e=>{if(!a(e,`CLAUDECODE`,`1`))return null;let t=[`CLAUDECODE`],n=i(e,`CLAUDE_CODE_SESSION_ID`);return n&&t.push(`CLAUDE_CODE_SESSION_ID`),s({id:`claude-code`,name:`Claude Code`},t,{sessionId:n})},e=>{let t=i(e,`CODEX_THREAD_ID`);return t?s({id:`codex`,name:`OpenAI Codex`},[`CODEX_THREAD_ID`],{sessionId:t}):null},e=>{let t=i(e,`AMP_CURRENT_THREAD_ID`);return t?s({id:`amp`,name:`Amp`},[`AMP_CURRENT_THREAD_ID`],{sessionId:t}):null},e=>a(e,`GEMINI_CLI`,`1`)?s({id:`gemini-agent`,name:`Gemini CLI`},[`GEMINI_CLI`]):null,e=>a(e,`AUGMENT_AGENT`,`1`)?s({id:`auggie`,name:`Auggie`},[`AUGMENT_AGENT`]):null,e=>{let t=[],n=o(t,a(e,`CRUSH`,`1`),`CRUSH`),r=o(t,a(e,`AI_AGENT`,`crush`),`AI_AGENT`);return n||r?s({id:`crush`,name:`Crush`},t):null},e=>{let t=[],n=o(t,a(e,`AI_AGENT`,`github_copilot_vscode_agent`),`AI_AGENT`),r=o(t,a(e,`COPILOT_AGENT`,`1`),`COPILOT_AGENT`);return n||r?s({id:`vscode-copilot-agent`,name:`GitHub Copilot in VS Code`,surface:`vscode`},t):null},e=>{let t=i(e,`OZ_RUN_ID`);return t?s({id:`warp`,name:`Warp`},[`OZ_RUN_ID`],{sessionId:t}):null}];function l(e=process.env,t=c){let n=[];for(let r of t)try{let t=r(e);t&&n.push(t)}catch{}return{isAgentic:n.length>0,harness:n[0]?.harness??null,model:n.find(e=>e.model)?.model??null,sessionId:n.find(e=>e.sessionId)?.sessionId??null,invocationId:n.find(e=>e.invocationId)?.invocationId??null,matches:n}}function u(){return n?`ci`:t()?`interactive`:`non-interactive`}function d(){let t=l(),n=t.isAgentic&&t.harness!==null?{"X-CF-CLI-Agent":t.harness.id}:{};return{"User-Agent":e,"X-CF-CLI-Mode":u(),...n}}export{d as n,l as r,u as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d}from"./prompt-BP8XrQSj.mjs";function f(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 p={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:f,handler:async f=>s({command:`request-tracers traces create`,classification:{safeFlags:[`context-geoloc-is-eu-country`,`context-skip-challenge`,`skip-response`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}f.method===void 0&&(f.method=await d(`method`,`HTTP Method of tracing request`)),f.url===void 0&&(f.url=await d(`url`,`URL to which perform tracing request`));let m=l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)});i(await o(`Creating`,async()=>s.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})})},m={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e}from"./chunk-vbHwaUoU.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{i as n,t as r,o as t};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,i as p,n as m}from"./prompt-BP8XrQSj.mjs";import{t as h}from"./cli-types-abvWQN3T.mjs";function g(e){return e.option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`,builder:g,handler:async p=>s({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)}):c(p.body)});return}let s=await r(p),m=p.local?e:await t();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.resourceSharing.create({...e,account_id:m})),{successLabel:`Created`});return}if(p.name===void 0&&(p.name=await f(`name`,`The name of the share.`)),p.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(p.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)});i(await o(`Creating`,async()=>s.resourceSharing.create({...h,account_id:m})),{successLabel:`Created`})})};function v(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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <share-id>`,describe:`Deletion is not immediate, an updated share object with a new status will be returned.`,builder:v,handler:async c=>s({command:`resource-sharing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>s.resourceSharing.delete({account_id:l,share_id:c[`share-id`]})),{successLabel:`Deleted`})})};function b(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={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:b,handler:async e=>s({command:`resource-sharing excluded-recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.resourceSharing.excludedRecipients.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function S(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 C={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:S,handler:async c=>s({command:`resource-sharing excluded-recipients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing excluded-recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/excluded-recipients/${c[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(c[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"excluded-recipient-id":String(c[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
- `);return}i(await o(`Deleting`,async()=>s.resourceSharing.excludedRecipients.delete({account_id:l,share_id:c[`share-id`],excluded_recipient_id:c[`excluded-recipient-id`]})),{successLabel:`Deleted`})})};function w(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 T={command:`get <excluded-recipient-id>`,describe:`Gets a single excluded recipient of a share by its identifier tag.`,builder:w,handler:async c=>s({command:`resource-sharing excluded-recipients get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing excluded-recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/excluded-recipients/${c[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(c[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"excluded-recipient-id":String(c[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.resourceSharing.excludedRecipients.get({account_id:l,share_id:c[`share-id`],excluded_recipient_id:c[`excluded-recipient-id`]})),{successLabel:`Loaded`})})};function E(e){return e.option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:"Lists the accounts excluded from an organization-targeted share. Only valid for shares with `target_type=organization`.",builder:E,handler:async e=>s({command:`resource-sharing excluded-recipients list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf resource-sharing excluded-recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);i(await o(`Loading`,async()=>n.resourceSharing.excludedRecipients.list({account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t})),{successLabel:`Loaded`})})};function O(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={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:O,handler:async e=>s({command:`resource-sharing excluded-recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf resource-sharing excluded-recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Updating`,async()=>t.resourceSharing.excludedRecipients.update({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},A={command:`excluded-recipients`,describe:`Operations for excluded-recipients`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <share-id>`,describe:`Fetches share by ID.`,builder:j,handler:async c=>s({command:`resource-sharing get`,classification:{safeFlags:[`include-resources`,`include-recipient-counts`,`dry-run`]}},c,async()=>{let s={include_resources:c[`include-resources`],include_recipient_counts:c[`include-recipient-counts`]};if(c.dryRun){a({command:`cf resource-sharing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.resourceSharing.get({account_id:u,share_id:c[`share-id`],...s})),{successLabel:`Loaded`})})};function N(e){return e.option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).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(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all account shares.`,builder:h(N),handler:async c=>s({command:`resource-sharing list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`include-resources`,`include-recipient-counts`,`dry-run`]}},c,async()=>{let s={status:c.status,kind:c.kind,target_type:c[`target-type`],resource_types:c[`resource-types`],order:c.order,direction:c.direction,page:c.page,per_page:c[`per-page`],include_resources:c[`include-resources`],include_recipient_counts:c[`include-recipient-counts`],tag:c.tag};if(c.dryRun){a({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.resourceSharing.list({account_id:u,...s})),{successLabel:`Loaded`})})};function F(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const I={command:`create <share-id>`,describe:"Adds a single recipient to an account-targeted resource share, granting them access to the shared resources. The recipient account must belong to the same organization as the share owner. To replace the entire recipient list in one call, use `PUT /accounts/{account_id}/shares/{share_id}/recipients` instead.",builder:F,handler:async e=>s({command:`resource-sharing recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({organization_id:d(e[`organization-id`],`organization-id`,`text`)}):c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.resourceSharing.recipients.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`});return}let n=u({organization_id:d(e[`organization-id`],`organization-id`,`text`)});i(await o(`Creating`,async()=>t.resourceSharing.recipients.create({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Created`})})};function ee(e){return e.positional(`recipient-id`,{type:`string`,description:`Share 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 L={command:`delete <recipient-id>`,describe:"Performs a **soft delete**: sets the recipient's `desired_association_status` to `disassociated`, which signals the background reconciliation workflow (Temporal) to remove the shared resources from the recipient account. The recipient record remains in the database for audit purposes and is still returned by `GET /accounts/{account_id}/shares/{share_id}/recipients` with its updated status. Resource access is not fully removed until the workflow completes and `current_association_status` transitions to `disassociated`. The recipient record itself is never physically deleted.",builder:ee,handler:async c=>s({command:`resource-sharing recipients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/recipients/${c[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(c[`recipient-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"recipient-id":String(c[`recipient-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
5
- `);return}i(await o(`Deleting`,async()=>s.resourceSharing.recipients.delete({account_id:l,share_id:c[`share-id`],recipient_id:c[`recipient-id`]})),{successLabel:`Deleted`})})};function R(e){return e.positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <recipient-id>`,describe:`Get share recipient by ID.`,builder:R,handler:async c=>s({command:`resource-sharing recipients get`,classification:{safeFlags:[`include-resources`,`dry-run`]}},c,async()=>{let s={include_resources:c[`include-resources`]};if(c.dryRun){a({command:`cf resource-sharing recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/recipients/${c[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(c[`recipient-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"recipient-id":String(c[`recipient-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.resourceSharing.recipients.get({account_id:u,share_id:c[`share-id`],recipient_id:c[`recipient-id`],...s})),{successLabel:`Loaded`})})};function B(e){return e.option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).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 V={command:`list`,describe:'List share recipients by share ID. Returns **all** recipients regardless of their `association_status` (associating, associated, disassociating, disassociated). Callers that want only "active" recipients must filter client-side on the `association_status` field.',builder:B,handler:async e=>s({command:`resource-sharing recipients list`,classification:{safeFlags:[`include-resources`,`dry-run`]}},e,async()=>{let t={include_resources:e[`include-resources`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf resource-sharing recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);i(await o(`Loading`,async()=>n.resourceSharing.recipients.list({account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t})),{successLabel:`Loaded`})})};function H(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`update <share-id>`,describe:"Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (`target_type=organization`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.",builder:H,handler:async e=>s({command:`resource-sharing recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Updating`,async()=>t.resourceSharing.recipients.update({body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},W={command:`recipients`,describe:`Update share recipients`,builder:e=>e.command(I).command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create <share-id>`,describe:`Adds a resource to an existing share, making it available to share recipients.`,builder:G,handler:async l=>s({command:`resource-sharing resources create`,classification:{safeFlags:[`resource-type`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${l[`share-id`]==null?`<share-id>`:encodeURIComponent(String(l[`share-id`]))}/resources`,pathParams:{"share-id":String(l[`share-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:d(l[`resource-type`],`resource-type`,`text`)}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.resourceSharing.resources.create({body:e,account_id:m,share_id:l[`share-id`]})),{successLabel:`Created`});return}l[`resource-account-id`]===void 0&&(l[`resource-account-id`]=await f(`resource-account-id`,`Account identifier.`)),l[`resource-id`]===void 0&&(l[`resource-id`]=await f(`resource-id`,`Share Resource identifier.`)),l[`resource-type`]===void 0&&(l[`resource-type`]=await p(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let h=u({resource_account_id:d(l[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(l[`resource-id`],`resource-id`,`text`),resource_type:d(l[`resource-type`],`resource-type`,`text`)});i(await o(`Creating`,async()=>s.resourceSharing.resources.create({body:h,account_id:m,share_id:l[`share-id`]})),{successLabel:`Created`})})};function q(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <share-resource-id>`,describe:`Deletion is not immediate, an updated share resource object with a new status will be returned.`,builder:q,handler:async c=>s({command:`resource-sharing resources delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing resources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/resources/${c[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(c[`share-resource-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"share-resource-id":String(c[`share-resource-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
6
- `);return}i(await o(`Deleting`,async()=>s.resourceSharing.resources.delete({account_id:l,share_id:c[`share-id`],share_resource_id:c[`share-resource-id`]})),{successLabel:`Deleted`})})};function Y(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <share-resource-id>`,describe:`Get share resource by ID.`,builder:Y,handler:async c=>s({command:`resource-sharing resources get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf resource-sharing resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/resources/${c[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(c[`share-resource-id`]))}`,pathParams:{"share-id":String(c[`share-id`]??``),"share-resource-id":String(c[`share-resource-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.resourceSharing.resources.get({account_id:l,share_id:c[`share-id`],share_resource_id:c[`share-resource-id`]})),{successLabel:`Loaded`})})};function Z(e){return e.option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).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 Q={command:`list`,describe:`List share resources by share ID.`,builder:h(Z),handler:async c=>s({command:`resource-sharing resources list`,classification:{safeFlags:[`status`,`resource-type`,`dry-run`]}},c,async()=>{let s={status:c.status,resource_type:c[`resource-type`],page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf resource-sharing resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${c[`share-id`]==null?`<share-id>`:encodeURIComponent(String(c[`share-id`]))}/resources`,pathParams:{"share-id":String(c[`share-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.resourceSharing.resources.list({account_id:u,share_id:c[`share-id`],...s})),{successLabel:`Loaded`})})};function $(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`update <share-resource-id>`,describe:`Update is not immediate, an updated share resource object with a new status will be returned.`,builder:$,handler:async l=>s({command:`resource-sharing resources update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${l[`share-id`]==null?`<share-id>`:encodeURIComponent(String(l[`share-id`]))}/resources/${l[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(l[`share-resource-id`]))}`,pathParams:{"share-id":String(l[`share-id`]??``),"share-resource-id":String(l[`share-resource-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.resourceSharing.resources.update({...e,account_id:u,share_id:l[`share-id`],share_resource_id:l[`share-resource-id`]})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},ne={command:`resources`,describe:`Individual resources (zones, configs) that have been shared with recipients`,builder:e=>e.command(K).command(J).command(X).command(Q).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for `PUT /accounts/{account_id}/shares/{share_id}`. The share's display `name` and `tags` can be updated via this endpoint. To modify recipients, use the `/accounts/{account_id}/shares/{share_id}/recipients` subresource endpoints (POST, PUT, DELETE). "})}const ie={command:`update <share-id>`,describe:"Updates the share's display name and tags. This endpoint does **not** modify recipients or resources — those are managed via dedicated subresource endpoints: - **Recipients**: Use `POST /accounts/{account_id}/shares/{share_id}/recipients` to add a single recipient, `PUT /accounts/{account_id}/shares/{share_id}/recipients` to replace the full recipient list, or `DELETE /accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` to remove a recipient. - **Resources**: Use the share's resource subresource endpoints. Updating is not immediate; an updated share object with a new status will be returned.",builder:re,handler:async l=>s({command:`resource-sharing update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/shares/${l[`share-id`]==null?`<share-id>`:encodeURIComponent(String(l[`share-id`]))}`,pathParams:{"share-id":String(l[`share-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.resourceSharing.update({...e,account_id:p,share_id:l[`share-id`]})),{successLabel:`Updated`});return}l.name===void 0&&(l.name=await f(`name`,`The name of the share.`));let m=u({name:d(l.name,`name`,`text`)});i(await o(`Updating`,async()=>s.resourceSharing.update({...m,account_id:p,share_id:l[`share-id`]})),{successLabel:`Updated`})})},ae={command:`resource-sharing`,describe:`Share Cloudflare resources (zones, accounts) across organizations with granular access controls`,builder:e=>e.command(_).command(y).command(M).command(P).command(ie).command(A).command(W).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ae as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";function c(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 l={command:`get`,describe:`Lists all distinct tag keys and their distinct values across resources in an account.`,builder:c,handler:async c=>s({command:`resource-tagging summary get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor};if(c.dryRun){a({command:`cf resource-tagging summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/summary`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.resourceTagging.summary.get({account_id:u,...s})),{successLabel:`Loaded`})})},u={command:`summary`,describe:`Operations for summary`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`resource-tagging`,describe:`resource-tagging`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,n as p}from"./prompt-BP8XrQSj.mjs";function m(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 h={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:m,handler:async c=>s({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/bulk_operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}`,pathParams:{"operation-id":String(c[`operation-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.bulkOperations.get({account_id:l,operation_id:c[`operation-id`]})),{successLabel:`Loaded`})})},g={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Creates a new list of the specified kind.`,builder:_,handler:async l=>s({command:`rules lists create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rules.lists.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)});i(await o(`Creating`,async()=>s.rules.lists.create({...m,account_id:p})),{successLabel:`Created`})})};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <list-id>`,describe:`Deletes a specific list and all its items.`,builder:y,handler:async c=>s({command:`rules lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the custom list and every item it contains.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>s.rules.lists.delete({account_id:l,list_id:c[`list-id`]})),{successLabel:`Deleted`})})};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})}const S={command:`get <list-id>`,describe:`Fetches the details of a list.`,builder:x,handler:async c=>s({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.get({account_id:l,list_id:c[`list-id`]})),{successLabel:`Loaded`})})};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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={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:C,handler:async l=>s({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rules.lists.items.create({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function T(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`items`,{type:`string`,description:`The items field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={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:T,handler:async d=>s({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{if(d.dryRun){a({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${d[`list-id`]==null?`<list-id>`:encodeURIComponent(String(d[`list-id`]))}/items`,pathParams:{"list-id":String(d[`list-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,!await p({force:!!d.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
4
- `);return}if(d.body){let e=c(d.body);i(await o(`Deleting`,async()=>s.rules.lists.items.delete({...e,account_id:f,list_id:d[`list-id`]})),{successLabel:`Deleted`});return}let m=u({items:l(d.items,`items`)});i(await o(`Deleting`,async()=>s.rules.lists.items.delete({...m,account_id:f,list_id:d[`list-id`]})),{successLabel:`Deleted`})})};function D(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 O={command:`get <item-id>`,describe:`Fetches a list item in the list.`,builder:D,handler:async c=>s({command:`rules lists items get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items/${c[`item-id`]==null?`<item-id>`:encodeURIComponent(String(c[`item-id`]))}`,pathParams:{"item-id":String(c[`item-id`]??``),"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.items.get({account_id:l,list_id:c[`list-id`],item_id:c[`item-id`]})),{successLabel:`Loaded`})})};function k(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 A={command:`list`,describe:`Fetches all the items in the list.`,builder:k,handler:async c=>s({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor,per_page:c[`per-page`],search:c.search};if(c.dryRun){a({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.rules.lists.items.list({account_id:u,list_id:c[`list-id`],...s})),{successLabel:`Loaded`})})};function j(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 M={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:j,handler:async l=>s({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.items.update({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},N={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Fetches all lists in the account.`,builder:P,handler:async c=>s({command:`rules lists list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.list({account_id:l})),{successLabel:`Loaded`})})};function I(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 L={command:`update <list-id>`,describe:`Updates the description of a list.`,builder:I,handler:async l=>s({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.update({...e,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`});return}let p=u({description:d(l.description,`description`,`text`)});i(await o(`Updating`,async()=>s.rules.lists.update({...p,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`})})},R={command:`lists`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(v).command(b).command(S).command(F).command(L).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`rules`,describe:`Account-level IP lists, hostname lists, and other reusable lists referenced by Rulesets rules`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};