cf 0.3.0 → 0.5.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 (228) hide show
  1. package/README.md +7 -1
  2. package/dist/_meta/agent-context.json +26 -21
  3. package/dist/_meta/commands.json +7696 -18100
  4. package/dist/_meta/schemas.json +6411 -13925
  5. package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
  6. package/dist/{accounts-Kx1epdA1.mjs → accounts-B_joQcMi.mjs} +9 -9
  7. package/dist/{acm-Utu252kC.mjs → acm-_kIHqYME.mjs} +2 -2
  8. package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CaFlw8y1.mjs} +10 -10
  9. package/dist/{agent-context-BGTU299M.mjs → agent-context-DMPfi54f.mjs} +1 -1
  10. package/dist/ai-CqnhNb_c.mjs +2 -0
  11. package/dist/ai-gateway-pgYGI519.mjs +8 -0
  12. package/dist/ai-search-eqQMPQol.mjs +7 -0
  13. package/dist/ai_gateway--vuVLnOm.mjs +4 -0
  14. package/dist/{alerting-CqmEIaKn.mjs → alerting-CPxHiYHb.mjs} +5 -5
  15. package/dist/{analytics-Dv-X8x7D.mjs → analytics-DSSRDZz8.mjs} +1 -1
  16. package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
  17. package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
  18. package/dist/argo-aC6A3JyX.mjs +2 -0
  19. package/dist/artifacts-HD4V2xpK.mjs +4 -0
  20. package/dist/audit-logs-BuExU_nz.mjs +2 -0
  21. package/dist/auth-CSC4yhEJ.mjs +9 -0
  22. package/dist/auth-D5hNsOFq.mjs +5 -0
  23. package/dist/billing-COaghyxl.mjs +2 -0
  24. package/dist/bot-management-DmEzeV1Y.mjs +5 -0
  25. package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
  26. package/dist/brand-protection-dPrGe8sL.mjs +3 -0
  27. package/dist/browser-rendering-BiSGnpBf.mjs +4 -0
  28. package/dist/{build-DYkGW4dh.mjs → build-HuS9-R0V.mjs} +131 -131
  29. package/dist/{cache-DsoW6Xwv.mjs → cache-CY-7Lt71.mjs} +4 -4
  30. package/dist/calls-wOQGDWPl.mjs +4 -0
  31. package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
  32. package/dist/chunk-6IEM75FG-BEjRFMGh.mjs +2 -0
  33. package/dist/client-certificates-CRf41xLe.mjs +3 -0
  34. package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
  35. package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
  36. package/dist/{completions-BwRpZQVn.mjs → completions-DOeHPdCG.mjs} +2 -2
  37. package/dist/config-B5k-XbwS.mjs +2 -0
  38. package/dist/connectivity-Bx3MgTHX.mjs +3 -0
  39. package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
  40. package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
  41. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
  42. package/dist/connectors-DRt4e6d_.mjs +3 -0
  43. package/dist/content-scanning-Cd2vy5Sz.mjs +4 -0
  44. package/dist/context-jpewmual.mjs +2 -0
  45. package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
  46. package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
  47. package/dist/custom-nameservers-CWqA51in.mjs +3 -0
  48. package/dist/custom-pages-DeUKEFGe.mjs +4 -0
  49. package/dist/d1-DvWY9Gp4.mjs +4 -0
  50. package/dist/data-security-BPo6dIWu.mjs +6 -0
  51. package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
  52. package/dist/{deploy-CQial3kN.mjs → deploy-dVrgDUOp.mjs} +1 -1
  53. package/dist/{dev-B38LfCTl.mjs → dev-C01_Lby6.mjs} +1 -1
  54. package/dist/diagnostics-6nKPmVgz.mjs +3 -0
  55. package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
  56. package/dist/dist-C6zxsVdY.mjs +306 -0
  57. package/dist/{dist-AIcZFk0U.mjs → dist-t_YrL25p.mjs} +7 -7
  58. package/dist/{dns-VMhQSr5n.mjs → dns-ClciFGxx.mjs} +13 -13
  59. package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
  60. package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
  61. package/dist/{email-routing-tIR2SFu-.mjs → email-routing-CGXhFqF5.mjs} +9 -9
  62. package/dist/{email-security-Ca1id3rZ.mjs → email-security-D5viPq8S.mjs} +7 -7
  63. package/dist/email-sending-C2jpc3gh.mjs +3 -0
  64. package/dist/{filters-A4dg_a68.mjs → filters-bzsFcWt0.mjs} +3 -3
  65. package/dist/{firewall-DWPQgYd9.mjs → firewall-DYZcTtIC.mjs} +10 -10
  66. package/dist/{fraud-BMkSsJGU.mjs → fraud-C03MtdZb.mjs} +1 -1
  67. package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
  68. package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
  69. package/dist/hostnames-CFgIVI3s.mjs +3 -0
  70. package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
  71. package/dist/iam-DqVPzGrb.mjs +6 -0
  72. package/dist/images-BYfl4YgR.mjs +7 -0
  73. package/dist/index.mjs +1 -1
  74. package/dist/intel-duTEPIHc.mjs +3 -0
  75. package/dist/{ips-K4bzaGqd.mjs → ips-nv9INuWZ.mjs} +1 -1
  76. package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
  77. package/dist/{kv-8o27w_pY.mjs → kv-CZoV4tiv.mjs} +4 -4
  78. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
  79. package/dist/{load-balancers-DtG8nj25.mjs → load-balancers--OMg0HNt.mjs} +5 -5
  80. package/dist/{logpush-4L0njy1d.mjs → logpush-C0_lZTyY.mjs} +3 -3
  81. package/dist/{logs-B_Yp95hv.mjs → logs-BtpWZQfV.mjs} +2 -2
  82. package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
  83. package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
  84. package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-CLhMcJ_-.mjs} +32 -33
  85. package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
  86. package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
  87. package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
  88. package/dist/oauth-Bk-F-tIO.mjs +52 -0
  89. package/dist/{observability-DWvpqnQJ.mjs → observability-BynRbTF4.mjs} +3 -3
  90. package/dist/open-YWOUIZ5Y-3jqSKAB1.mjs +4 -0
  91. package/dist/{organizations-T77D50Sq.mjs → organizations-BqJHyvMK.mjs} +3 -3
  92. package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
  93. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
  94. package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
  95. package/dist/{output-BJFNwj7b.mjs → output-B6fBFRqe.mjs} +1 -1
  96. package/dist/{page-rules-CjZPTMQX.mjs → page-rules-EZHJePmn.mjs} +4 -4
  97. package/dist/{page-shield-D5RRNJCY.mjs → page-shield-CXJioWPs.mjs} +5 -5
  98. package/dist/{pages-CWJtJnL0.mjs → pages-D4aYteKk.mjs} +8 -8
  99. package/dist/{pipelines-B0L_7j9e.mjs → pipelines-G8Iusxq-.mjs} +5 -5
  100. package/dist/progress-DrDErV9w.mjs +2 -0
  101. package/dist/queues-DEkbKqZX.mjs +6 -0
  102. package/dist/{r2-DQIcyRtA.mjs → r2-CV0IkCAW.mjs} +9 -9
  103. package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
  104. package/dist/radar-D986zPJr.mjs +2 -0
  105. package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
  106. package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
  107. package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
  108. package/dist/{registrar-Ko-xZemf.mjs → registrar-CDIwTz3G.mjs} +6 -6
  109. package/dist/request-tracers-D7SFMDik.mjs +2 -0
  110. package/dist/resource-sharing-YIQ04jXE.mjs +5 -0
  111. package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
  112. package/dist/rules-DHjLP5Kx.mjs +4 -0
  113. package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-q4QABpKs.mjs} +7 -7
  114. package/dist/rum-SmT4HZmM.mjs +4 -0
  115. package/dist/{schema-D16TgWBg.mjs → schema-BR31o4P6.mjs} +1 -1
  116. package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-vVetgC_P.mjs} +5 -5
  117. package/dist/{scim-DdSEr4kZ.mjs → scim-ChOkZpNx.mjs} +2 -2
  118. package/dist/{session-COHHdS7A.mjs → sdk-DhIhH6GB.mjs} +4 -4
  119. package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-BAK9G12O.mjs} +12 -12
  120. package/dist/security-center-eScuYDKP.mjs +2 -0
  121. package/dist/security-txt-x7R4gmQu.mjs +3 -0
  122. package/dist/session-DHYCE-PM.mjs +93 -0
  123. package/dist/shared-BAjo72Lz.mjs +2 -0
  124. package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
  125. package/dist/snippets-DrlgYJYp.mjs +4 -0
  126. package/dist/{spawn-DcppKGI5.mjs → spawn-CCGzKlC4.mjs} +1 -1
  127. package/dist/{spectrum-CTTZID8u.mjs → spectrum-pVGxb7u5.mjs} +6 -6
  128. package/dist/speed-ZFrMWDgd.mjs +4 -0
  129. package/dist/src-DU7FBCOX.mjs +108 -0
  130. package/dist/ssl-9JY05sYt.mjs +15 -0
  131. package/dist/stream-tRU39b8K.mjs +14 -0
  132. package/dist/{tenants-Bd7NGQ_m.mjs → tenants-HLGUazms.mjs} +1 -1
  133. package/dist/{token-validation-DAgtFOvs.mjs → token-validation-_VdamKpz.mjs} +4 -4
  134. package/dist/{tools-DXQmfFuE.mjs → tools-D_hfUU_Z.mjs} +1 -1
  135. package/dist/{turnstile-cfdaO4ca.mjs → turnstile-BRzXd28B.mjs} +4 -4
  136. package/dist/{ui-D4KtlMh9.mjs → ui-erjBdVKL.mjs} +1 -1
  137. package/dist/url-normalization-D-NxuLtN.mjs +3 -0
  138. package/dist/url-scanner-BzzR6iDx.mjs +2 -0
  139. package/dist/{user-CAo-yCJA.mjs → user-C4omq__w.mjs} +2 -2
  140. package/dist/vectorize-By6EqcNR.mjs +4 -0
  141. package/dist/{versions-CUwWJWmy.mjs → versions-CBHwWPAM.mjs} +1 -1
  142. package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
  143. package/dist/{web3-HQJRm38W.mjs → web3-DQ5dmE9W.mjs} +3 -3
  144. package/dist/{workers-Dg7ddG2Q.mjs → workers-D8Be7_as.mjs} +14 -14
  145. package/dist/workers-builds-BE3W3qNk.mjs +7 -0
  146. package/dist/{workflows-VquuSh2J.mjs → workflows-BWWufqFA.mjs} +3 -3
  147. package/dist/zaraz-Bsa9AvVL.mjs +2 -0
  148. package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
  149. package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
  150. package/dist/zones-BXtdwt6E.mjs +21 -0
  151. package/package.json +4 -4
  152. package/dist/ai-DOOKLPkG.mjs +0 -2
  153. package/dist/ai-gateway-Cj1T3avF.mjs +0 -8
  154. package/dist/ai-search-CQF_Sn7d.mjs +0 -7
  155. package/dist/ai_gateway-C3fH22C0.mjs +0 -4
  156. package/dist/analytics_engine-DdXVR8z2.mjs +0 -2
  157. package/dist/argo-CX_A4kcn.mjs +0 -2
  158. package/dist/audit-logs-BfBf3oo-.mjs +0 -2
  159. package/dist/auth-SyWhMmPu.mjs +0 -6
  160. package/dist/auth-ffdf9yR0.mjs +0 -135
  161. package/dist/autorag-BuGhGTeZ.mjs +0 -2
  162. package/dist/billing-PoG81XaQ.mjs +0 -2
  163. package/dist/bot-management-CFvtVx62.mjs +0 -5
  164. package/dist/botnet-feed-B-M4Yu0W.mjs +0 -3
  165. package/dist/brand-protection-D05Eg-_6.mjs +0 -3
  166. package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
  167. package/dist/calls-CZbO7TyR.mjs +0 -4
  168. package/dist/certificate-authorities-D2yr7_3t.mjs +0 -2
  169. package/dist/client-certificates-MJcDsTId.mjs +0 -3
  170. package/dist/cloud-connector-DWOrN2eM.mjs +0 -2
  171. package/dist/config-DYzlVxcB.mjs +0 -2
  172. package/dist/connectivity-BX8C7tvK.mjs +0 -3
  173. package/dist/content-scanning-r6uzMO1r.mjs +0 -4
  174. package/dist/context-DGlHRGWM.mjs +0 -2
  175. package/dist/custom-nameservers-D1DtlRue.mjs +0 -3
  176. package/dist/custom-pages-DQCi2plU.mjs +0 -4
  177. package/dist/d1-DbnYhw45.mjs +0 -4
  178. package/dist/data-security-D_EtYBfo.mjs +0 -6
  179. package/dist/dcv-delegation-CHspSzTI.mjs +0 -2
  180. package/dist/diagnostics-BJQGjVJn.mjs +0 -3
  181. package/dist/dist-DNBSHor6.mjs +0 -301
  182. package/dist/dns-firewall-B4DVXFBQ.mjs +0 -57
  183. package/dist/durable-objects-CTboySEo.mjs +0 -2
  184. package/dist/email-sending-DwWKc5jC.mjs +0 -3
  185. package/dist/google-tag-gateway-BGD49nRC.mjs +0 -2
  186. package/dist/hostnames-BiomxukN.mjs +0 -3
  187. package/dist/hyperdrive-Da104VaQ.mjs +0 -18
  188. package/dist/iam-BIGKo0WW.mjs +0 -6
  189. package/dist/images-BO8FbDAa.mjs +0 -5
  190. package/dist/intel-CY6_79v8.mjs +0 -3
  191. package/dist/keyless-certificates-CZC-L8gM.mjs +0 -3
  192. package/dist/leaked-credential-checks-qLzRyu85.mjs +0 -3
  193. package/dist/magic-cloud-networking-CSOM3EM-.mjs +0 -5
  194. package/dist/managed-transforms-D15yVbZx.mjs +0 -3
  195. package/dist/mtls-certificates-D8k0AXWK.mjs +0 -3
  196. package/dist/origin-ca-certificates-DXIvD8H5.mjs +0 -3
  197. package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +0 -2
  198. package/dist/progress-CrCGTq7N.mjs +0 -2
  199. package/dist/queues-CN6DPhRR.mjs +0 -6
  200. package/dist/r2-data-catalog-Bbo93TJx.mjs +0 -14
  201. package/dist/radar-Bxb0WX8V.mjs +0 -2
  202. package/dist/raw-fetch-Dlccg0Tr.mjs +0 -2
  203. package/dist/request-tracers-DOW_reTJ.mjs +0 -2
  204. package/dist/resource-sharing-D7TX0JV0.mjs +0 -5
  205. package/dist/rules-BXRADHL5.mjs +0 -4
  206. package/dist/rum-BjPptTUP.mjs +0 -4
  207. package/dist/security-center-DAy6AKtT.mjs +0 -2
  208. package/dist/security-txt-xAMb7K6Y.mjs +0 -3
  209. package/dist/shared-AGtpXwwL.mjs +0 -2
  210. package/dist/snippets-CCSsCXVs.mjs +0 -4
  211. package/dist/speed-CuzTE0AL.mjs +0 -4
  212. package/dist/src-BW6vfAwE.mjs +0 -108
  213. package/dist/ssl-BWA2LdwC.mjs +0 -15
  214. package/dist/stream-GFsIZ-pP.mjs +0 -14
  215. package/dist/url-normalization-B5RN4nLD.mjs +0 -3
  216. package/dist/url-scanner-BrZ1L9OC.mjs +0 -2
  217. package/dist/vectorize-C7_oQlaI.mjs +0 -4
  218. package/dist/workers-builds-AVfx8IyL.mjs +0 -7
  219. package/dist/zaraz-xYSWIV4P.mjs +0 -2
  220. package/dist/zones-BSgmZ9WC.mjs +0 -21
  221. /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  222. /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-BeyOc81z.mjs} +0 -0
  223. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-_fMCApaH.mjs} +0 -0
  224. /package/dist/{lib-Eu1wXxuh.mjs → lib-4PQI6yRW.mjs} +0 -0
  225. /package/dist/{local-VJaJ3BZ1.mjs → local-CYc9q7l2.mjs} +0 -0
  226. /package/dist/{metadata-5VwHPW6C.mjs → metadata-OOwvpR8m.mjs} +0 -0
  227. /package/dist/{resolve-4-OSeHlK.mjs → resolve-C3h-mwp7.mjs} +0 -0
  228. /package/dist/{theme-BklJDrb2.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,_ as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,r as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";import{t as p}from"./cli-types-CRIDdDw3.mjs";function m(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
2
+ import{E as e,S as t,g as n}from"./oauth-Bk-F-tIO.mjs";import{i as r,n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,r as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.mjs";function m(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
3
3
  - Minimum: 1 domain
4
4
  - Maximum: 20 domains per request
5
5
  - Domains on unsupported extensions are returned with \`registrable: false\` and a \`reason\` field
6
6
  - Malformed domain names (e.g., missing extension) may be omitted from the response
7
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const h={command:`domain-check`,describe:"Performs real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.",builder:m,handler:async t=>{if(t.dryRun){l({command:`cf registrar domain-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({domains:t.domains}):a(t.body)});return}let r=await i(t),o=t.local?f:await n(r);if(t.accountId=o,t.body){let e=a(t.body);c(await u(`Creating`,async()=>r.registrar.domainCheck({...e,account_id:o})),{successLabel:`Created`});return}if(t.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let d=s({domains:t.domains});c(await u(`Creating`,async()=>r.registrar.domainCheck({...d,account_id:o})),{successLabel:`Created`})}};function g(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
7
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const h={command:`domain-check`,describe:"Performs real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.",builder:m,handler:async e=>{if(e.dryRun){l({command:`cf registrar domain-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({domains:e.domains}):a(e.body)});return}let r=await i(e),o=e.local?f:await n(r);if(e.accountId=o,e.body){let t=a(e.body);c(await u(`Creating`,async()=>r.registrar.domainCheck({...t,account_id:o})),{successLabel:`Created`});return}if(e.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let d=s({domains:e.domains});c(await u(`Creating`,async()=>r.registrar.domainCheck({...d,account_id:o})),{successLabel:`Created`})}};function g(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
8
8
  - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
9
9
  - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
10
10
  returns results across all supported extensions. Extensions not in the supported
11
- set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`domain-search`,describe:'Searches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.',builder:g,handler:async t=>{let r={q:t.q,extensions:t.extensions,limit:t.limit};if(t.dryRun){l({command:`cf registrar domain-search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,c(await u(`Loading`,async()=>a.registrar.domainSearch({account_id:o,...r})),{successLabel:`Loaded`})}};function v(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
11
+ set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`domain-search`,describe:'Searches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.',builder:g,handler:async e=>{let r={q:e.q,extensions:e.extensions,limit:e.limit};if(e.dryRun){l({command:`cf registrar domain-search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await n(a);e.accountId=o,c(await u(`Loading`,async()=>a.registrar.domainSearch({account_id:o,...r})),{successLabel:`Loaded`})}};function v(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
12
12
  waiting for the operation to complete (RFC 7240).
13
13
 
14
14
  The header may be combined with other preferences using standard
@@ -36,11 +36,11 @@ The registry for each extension may also enforce its own maximum
36
36
  registration term. If the requested value exceeds the registry's
37
37
  maximum, the registration will be rejected. When in doubt, use the
38
38
  default by omitting this field.
39
- `}).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-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-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 y={command:`create`,describe:"Starts a domain registration workflow. This is a billable operation — successful registration charges the account's default payment method. All successful domain registrations are non-refundable — once the workflow completes with `state: succeeded`, the charge cannot be reversed. ### Prerequisites - The account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The account must not already be at the maximum supported domain limit. A single account may own up to 100 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Express mode The only required field is `domain_name`. If `contacts` is omitted, the system uses the account's default address book entry as the registrant. If no default exists and no contact is provided, the request fails. Set up a default address book entry and accept the required agreement at `https://dash.cloudflare.com/{account_id}/domains/registrations`. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:v,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){l({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?s({auto_renew:p[`auto-renew`],contacts:{registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):a(p.body)});return}let h=await i(p),g=p.local?f:await n(h);if(p.accountId=g,p.body){let e=a(p.body);c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await t(`domain-name`,"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests. "));let _={};p[`auto-renew`]!==void 0&&o(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-registrant-email`]!==void 0&&o(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&o(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&o(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&o(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&o(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&o(_,[`years`],p.years),c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function b(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get-status <domain-name>`,describe:"Returns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```",builder:b,handler:async t=>{if(t.dryRun){l({command:`cf registrar registrations get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getStatus({account_id:a,domain_name:t[`domain-name`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={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:S,handler:async t=>{if(t.dryRun){l({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getUpdateStatus({account_id:a,domain_name:t[`domain-name`]})),{successLabel:`Loaded`})}};function w(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 T={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:w,handler:async t=>{if(t.dryRun){l({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.get({account_id:a,domain_name:t[`domain-name`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
39
+ `}).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-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-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 y={command:`create`,describe:"Starts a domain registration workflow. This is a billable operation — successful registration charges the account's default payment method. All successful domain registrations are non-refundable — once the workflow completes with `state: succeeded`, the charge cannot be reversed. ### Prerequisites - The account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The account must not already be at the maximum supported domain limit. A single account may own up to 100 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Express mode The only required field is `domain_name`. If `contacts` is omitted, the system uses the account's default address book entry as the registrant. If no default exists and no contact is provided, the request fails. Set up a default address book entry and accept the required agreement at `https://dash.cloudflare.com/{account_id}/domains/registrations`. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:v,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){l({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?s({auto_renew:p[`auto-renew`],contacts:{registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):a(p.body)});return}let h=await i(p),g=p.local?f:await n(h);if(p.accountId=g,p.body){let e=a(p.body);c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await e(`domain-name`,"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests. "));let _={};p[`auto-renew`]!==void 0&&o(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-registrant-email`]!==void 0&&o(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&o(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&o(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&o(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&o(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&o(_,[`years`],p.years),c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function b(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get-status <domain-name>`,describe:"Returns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```",builder:b,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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 r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={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:S,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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 r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getUpdateStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function w(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 T={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:w,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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 r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.get({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
40
40
  Pass this value to fetch the next page of results. Omit (or
41
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date\n(`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:"Returns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.",builder:p(E),handler:async t=>{let r={cursor:t.cursor,per_page:t[`per-page`],direction:t.direction,sort_by:t[`sort-by`]};if(t.dryRun){l({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.list({account_id:o,...r})),{successLabel:`Loaded`})}};function O(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.
41
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date\n(`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:"Returns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.",builder:p(E),handler:async e=>{let r={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/${t()??`<account-id>`}/registrar/registrations`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await n(a);e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.list({account_id:o,...r})),{successLabel:`Loaded`})}};function O(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.
42
42
  Setting this field to \`true\` authorizes Cloudflare to charge the
43
43
  account's default payment method up to 30 days before domain expiry
44
44
  to renew the domain automatically. Renewal pricing may change over
45
45
  time based on registry pricing.
46
- `}).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 k={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:O,handler:async t=>{let d={};if(t.prefer!==void 0&&(d.Prefer=String(t.prefer)),t.dryRun){l({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/registrar/registrations/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}`,pathParams:{"domain-name":String(t[`domain-name`]??``)},bodyKind:`json`,body:t.body===void 0?s({auto_renew:t[`auto-renew`]}):a(t.body)});return}let p=await i(t),m=t.local?f:await n(p);if(t.accountId=m,t.body){let e=a(t.body);c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(t[`domain-name`]))}`,{body:e,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`});return}let h={};t[`auto-renew`]!==void 0&&o(h,[`auto_renew`],t[`auto-renew`]),c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(t[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},A={command:`registrations`,describe:`Domain registrations — purchase, view, update, and inspect registration status`,builder:e=>e.command(y).command(T).command(x).command(C).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`registrar`,describe:`Domain registration and transfer management through Cloudflare Registrar`,builder:e=>e.command(h).command(_).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
46
+ `}).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 k={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:O,handler:async e=>{let d={};if(e.prefer!==void 0&&(d.Prefer=String(e.prefer)),e.dryRun){l({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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?s({auto_renew:e[`auto-renew`]}):a(e.body)});return}let p=await i(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=a(e.body);c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:t,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`});return}let h={};e[`auto-renew`]!==void 0&&o(h,[`auto_renew`],e[`auto-renew`]),c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},A={command:`registrations`,describe:`Domain registrations — purchase, view, update, and inspect registration status`,builder:e=>e.command(y).command(T).command(x).command(C).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`registrar`,describe:`Domain registration and transfer management through Cloudflare Registrar`,builder:e=>e.command(h).command(_).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{E as e,S as t,g as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";function d(e){return e.option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`,builder:d,handler:async d=>{if(d.dryRun){s({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:d.body===void 0?a({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)}):i(d.body)});return}let f=await r(d),p=d.local?u:await n(f);if(d.accountId=p,d.body){let e=i(d.body);o(await c(`Creating`,async()=>f.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}d.method===void 0&&(d.method=await e(`method`,`HTTP Method of tracing request`)),d.url===void 0&&(d.url=await e(`url`,`URL to which perform tracing request`));let m=a({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)});o(await c(`Creating`,async()=>f.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})}},p={command:`traces`,describe:`Operations for traces`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`request-tracers`,describe:`request-tracers`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.mjs";function m(e){return e.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:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`,builder:m,handler:async n=>{if(n.dryRun){l({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`)}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.resourceSharing.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await e(`name`,`The name of the share.`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Creating`,async()=>i.resourceSharing.create({...m,account_id:p})),{successLabel:`Created`})}};function g(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 _={command:`delete <share-id>`,describe:`Deletion is not immediate, an updated share object with a new status will be returned.`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}c(await u(`Deleting`,async()=>n.resourceSharing.delete({account_id:o,share_id:e[`share-id`]})),{successLabel:`Deleted`})}};function v(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 y={command:`get <share-id>`,describe:`Fetches share by ID.`,builder:v,handler:async e=>{let n={include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`]};if(e.dryRun){l({command:`cf resource-sharing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.resourceSharing.get({account_id:o,share_id:e[`share-id`],...n})),{successLabel:`Loaded`})}};function b(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 x={command:`list`,describe:`Lists all account shares.`,builder:p(b),handler:async e=>{let n={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`],include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`],tag:e.tag};if(e.dryRun){l({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.resourceSharing.list({account_id:o,...n})),{successLabel:`Loaded`})}};function S(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,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 C={command:`create <share-id>`,describe:`Adds a recipient to a resource share, granting them access to the shared resources.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({organization_id:d(e[`organization-id`],`organization-id`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.resourceSharing.recipients.create({body:t,account_id:i,share_id:e[`share-id`]})),{successLabel:`Created`});return}let p=s({organization_id:d(e[`organization-id`],`organization-id`,`text`)});c(await u(`Creating`,async()=>n.resourceSharing.recipients.create({body:p,account_id:i,share_id:e[`share-id`]})),{successLabel:`Created`})}};function w(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 T={command:`delete <recipient-id>`,describe:`Deletion is not immediate, an updated share recipient object with a new status will be returned.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients/${e[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(e[`recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"recipient-id":String(e[`recipient-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
4
+ `);return}c(await u(`Deleting`,async()=>n.resourceSharing.recipients.delete({account_id:o,share_id:e[`share-id`],recipient_id:e[`recipient-id`]})),{successLabel:`Deleted`})}};function E(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 D={command:`get <recipient-id>`,describe:`Get share recipient by ID.`,builder:E,handler:async e=>{let n={include_resources:e[`include-resources`]};if(e.dryRun){l({command:`cf resource-sharing recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients/${e[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(e[`recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"recipient-id":String(e[`recipient-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.resourceSharing.recipients.get({account_id:o,share_id:e[`share-id`],recipient_id:e[`recipient-id`],...n})),{successLabel:`Loaded`})}};function O(e){return e.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 k={command:`list`,describe:`List share recipients by share ID.`,builder:O,handler:async e=>{let n={include_resources:e[`include-resources`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf resource-sharing recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.resourceSharing.recipients.list({account_id:o,share_id:e[`share-id`],...n})),{successLabel:`Loaded`})}};function A(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <share-id>`,describe:`Changes a share's recipients to match the given list. Returns an error if the share targets an organization.`,builder:A,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.resourceSharing.recipients.update({body:t,account_id:i,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.`)}},M={command:`recipients`,describe:`Operations for recipients`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.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`]}).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 <share-id>`,describe:`Adds a resource to an existing share, making it available to share recipients.`,builder:N,handler:async i=>{if(i.dryRun){l({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${i[`share-id`]==null?`<share-id>`:encodeURIComponent(String(i[`share-id`]))}/resources`,pathParams:{"share-id":String(i[`share-id`]??``)},bodyKind:`json`,body:i.body===void 0?s({resource_account_id:d(i[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(i[`resource-id`],`resource-id`,`text`),resource_type:d(i[`resource-type`],`resource-type`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.resourceSharing.resources.create({body:e,account_id:m,share_id:i[`share-id`]})),{successLabel:`Created`});return}i[`resource-account-id`]===void 0&&(i[`resource-account-id`]=await e(`resource-account-id`,`Account identifier.`)),i[`resource-id`]===void 0&&(i[`resource-id`]=await e(`resource-id`,`Share Resource identifier.`)),i[`resource-type`]===void 0&&(i[`resource-type`]=await n(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`]));let h=s({resource_account_id:d(i[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(i[`resource-id`],`resource-id`,`text`),resource_type:d(i[`resource-type`],`resource-type`,`text`)});c(await u(`Creating`,async()=>p.resourceSharing.resources.create({body:h,account_id:m,share_id:i[`share-id`]})),{successLabel:`Created`})}};function F(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 I={command:`delete <share-resource-id>`,describe:`Deletion is not immediate, an updated share resource object with a new status will be returned.`,builder:F,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing resources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}c(await u(`Deleting`,async()=>n.resourceSharing.resources.delete({account_id:o,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]})),{successLabel:`Deleted`})}};function L(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 R={command:`get <share-resource-id>`,describe:`Get share resource by ID.`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.resourceSharing.resources.get({account_id:i,share_id:e[`share-id`],share_resource_id:e[`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`]}).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 B={command:`list`,describe:`List share resources by share ID.`,builder:p(z),handler:async e=>{let n={status:e.status,resource_type:e[`resource-type`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf resource-sharing resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources`,pathParams:{"share-id":String(e[`share-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.resourceSharing.resources.list({account_id:o,share_id:e[`share-id`],...n})),{successLabel:`Loaded`})}};function V(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 H={command:`update <share-resource-id>`,describe:`Update is not immediate, an updated share resource object with a new status will be returned.`,builder:V,handler:async e=>{if(e.dryRun){l({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.resourceSharing.resources.update({...t,account_id:i,share_id:e[`share-id`],share_resource_id:e[`share-resource-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.`)}},U={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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:`Raw JSON request body (bypasses individual flags)`})}const G={command:`update <share-id>`,describe:`Updating is not immediate, an updated share object with a new status will be returned.`,builder:W,handler:async n=>{if(n.dryRun){l({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/shares/${n[`share-id`]==null?`<share-id>`:encodeURIComponent(String(n[`share-id`]))}`,pathParams:{"share-id":String(n[`share-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`)}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>i.resourceSharing.update({...e,account_id:p,share_id:n[`share-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await e(`name`,`The name of the share.`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Updating`,async()=>i.resourceSharing.update({...m,account_id:p,share_id:n[`share-id`]})),{successLabel:`Updated`})}},K={command:`resource-sharing`,describe:`resource-sharing`,builder:e=>e.command(h).command(_).command(y).command(x).command(G).command(M).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,E as n,S as r,T as i,_ as a,i as o,n as s}from"./auth-ffdf9yR0.mjs";import{n as c,r as l,t as u}from"./body-parser-DKa8Ipg1.mjs";import{t as d}from"./output-BJFNwj7b.mjs";import{n as f,t as p}from"./progress-CrCGTq7N.mjs";import{n as m}from"./input-validation-zEO81MWN.mjs";import{t as h}from"./local-VJaJ3BZ1.mjs";import{t as g}from"./cli-types-CRIDdDw3.mjs";function _(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
2
+ import{E as e,S as t,T as n,g as r,w as i,x as a}from"./oauth-Bk-F-tIO.mjs";import{i as o,n as s}from"./auth-CSC4yhEJ.mjs";import{n as c,r as l,t as u}from"./body-parser-DWSy7uZ8.mjs";import{t as d}from"./output-B6fBFRqe.mjs";import{n as f,t as p}from"./progress-DrDErV9w.mjs";import{n as m}from"./input-validation-_fMCApaH.mjs";import{t as h}from"./local-CYc9q7l2.mjs";import{t as g}from"./cli-types-BeyOc81z.mjs";function _(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
3
3
  verify the current resource ETag matches before applying the write. Returns
4
4
  412 Precondition Failed if the resource has been modified since the ETag was
5
- obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const v={command:`delete`,describe:`Removes all tags from a specific account-level resource.`,builder:_,handler:async r=>{let g={};if(r[`if-match`]!==void 0&&(g[`If-Match`]=String(r[`if-match`])),r.dryRun){f({command:`cf resource-tagging account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({resource_id:m(r[`resource-id`],`resource-id`,`text`),resource_type:m(r[`resource-type`],`resource-type`,`text`),worker_id:m(r[`worker-id`],`worker-id`,`text`)}):c(r.body)});return}let _=await s(r),v=r.local?h:await a(_);if(r.accountId=v,!await i({force:!!r.force})){process.stderr.write(`Aborted.
6
- `);return}if(r.body){let e=c(r.body);d(await p(`Deleting`,async()=>o(_,`DELETE`,`/accounts/${v}/tags`,{body:e,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`});return}r[`resource-id`]===void 0&&(r[`resource-id`]=await t(`resource-id`,`Identifies the unique resource.`)),r[`resource-type`]===void 0&&(r[`resource-type`]=await n(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let y={};r[`resource-id`]!==void 0&&l(y,[`resource_id`],m(r[`resource-id`],`resource-id`,`text`)),r[`resource-type`]!==void 0&&l(y,[`resource_type`],m(r[`resource-type`],`resource-type`,`text`)),r[`worker-id`]!==void 0&&l(y,[`worker_id`],m(r[`worker-id`],`worker-id`,`text`)),d(await p(`Deleting`,async()=>o(_,`DELETE`,`/accounts/${v}/tags`,{body:Object.keys(y).length>0?y:void 0,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`})}};function y(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:[`access_application`,`access_group`,`account`,`ai_gateway`,`alerting_policy`,`alerting_webhook`,`cloudflared_tunnel`,`d1_database`,`durable_object_namespace`,`gateway_list`,`gateway_rule`,`image`,`kv_namespace`,`queue`,`r2_bucket`,`resource_share`,`stream_live_input`,`stream_video`,`worker`,`worker_version`],demandOption:!0}).option(`worker-id`,{type:`string`,description:`Worker identifier. Required for worker_version resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves tags for a specific account-level resource.`,builder:g(y),handler:async t=>{let n={resource_id:t[`resource-id`],resource_type:t[`resource-type`],worker_id:t[`worker-id`]};if(t.dryRun){f({command:`cf resource-tagging account-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags`,pathParams:{},query:n,bodyKind:`none`});return}let r=await s(t),i=t.local?h:await a(r);t.accountId=i,d(await p(`Loading`,async()=>r.resourceTagging.accountTags.get({account_id:i,...n})),{successLabel:`Loaded`})}};function x(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
5
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const v={command:`delete`,describe:`Removes all tags from a specific account-level resource.`,builder:_,handler:async a=>{let g={};if(a[`if-match`]!==void 0&&(g[`If-Match`]=String(a[`if-match`])),a.dryRun){f({command:`cf resource-tagging account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:a.body===void 0?u({resource_id:m(a[`resource-id`],`resource-id`,`text`),resource_type:m(a[`resource-type`],`resource-type`,`text`),worker_id:m(a[`worker-id`],`worker-id`,`text`)}):c(a.body)});return}let _=await s(a),v=a.local?h:await r(_);if(a.accountId=v,!await i({force:!!a.force})){process.stderr.write(`Aborted.
6
+ `);return}if(a.body){let e=c(a.body);d(await p(`Deleting`,async()=>o(_,`DELETE`,`/accounts/${v}/tags`,{body:e,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`});return}a[`resource-id`]===void 0&&(a[`resource-id`]=await e(`resource-id`,`Identifies the unique resource.`)),a[`resource-type`]===void 0&&(a[`resource-type`]=await n(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let y={};a[`resource-id`]!==void 0&&l(y,[`resource_id`],m(a[`resource-id`],`resource-id`,`text`)),a[`resource-type`]!==void 0&&l(y,[`resource_type`],m(a[`resource-type`],`resource-type`,`text`)),a[`worker-id`]!==void 0&&l(y,[`worker_id`],m(a[`worker-id`],`worker-id`,`text`)),d(await p(`Deleting`,async()=>o(_,`DELETE`,`/accounts/${v}/tags`,{body:Object.keys(y).length>0?y:void 0,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Deleted`})}};function y(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:[`access_application`,`access_group`,`account`,`ai_gateway`,`alerting_policy`,`alerting_webhook`,`cloudflared_tunnel`,`d1_database`,`durable_object_namespace`,`gateway_list`,`gateway_rule`,`image`,`kv_namespace`,`queue`,`r2_bucket`,`resource_share`,`stream_live_input`,`stream_video`,`worker`,`worker_version`],demandOption:!0}).option(`worker-id`,{type:`string`,description:`Worker identifier. Required for worker_version resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves tags for a specific account-level resource.`,builder:g(y),handler:async e=>{let n={resource_id:e[`resource-id`],resource_type:e[`resource-type`],worker_id:e[`worker-id`]};if(e.dryRun){f({command:`cf resource-tagging account-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags`,pathParams:{},query:n,bodyKind:`none`});return}let i=await s(e),a=e.local?h:await r(i);e.accountId=a,d(await p(`Loading`,async()=>i.resourceTagging.accountTags.get({account_id:a,...n})),{successLabel:`Loaded`})}};function x(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
7
7
  verify the current resource ETag matches before applying the write. Returns
8
8
  412 Precondition Failed if the resource has been modified since the ETag was
9
- obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on account-level resources.`})}const S={command:`update`,describe:`Creates or updates tags for a specific account-level resource.`,builder:x,handler:async r=>{let i={};if(r[`if-match`]!==void 0&&(i[`If-Match`]=String(r[`if-match`])),r.dryRun){f({command:`cf resource-tagging account-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({resource_id:m(r[`resource-id`],`resource-id`,`text`),resource_type:m(r[`resource-type`],`resource-type`,`text`),worker_id:m(r[`worker-id`],`worker-id`,`text`)}):c(r.body)});return}let g=await s(r),_=r.local?h:await a(g);if(r.accountId=_,r.body){let e=c(r.body);d(await p(`Updating`,async()=>o(g,`PUT`,`/accounts/${_}/tags`,{body:e,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`});return}r[`resource-id`]===void 0&&(r[`resource-id`]=await t(`resource-id`,`Identifies the unique resource.`)),r[`resource-type`]===void 0&&(r[`resource-type`]=await n(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let v={};r[`resource-id`]!==void 0&&l(v,[`resource_id`],m(r[`resource-id`],`resource-id`,`text`)),r[`resource-type`]!==void 0&&l(v,[`resource_type`],m(r[`resource-type`],`resource-type`,`text`)),r[`worker-id`]!==void 0&&l(v,[`worker_id`],m(r[`worker-id`],`worker-id`,`text`)),d(await p(`Updating`,async()=>o(g,`PUT`,`/accounts/${_}/tags`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}},C={command:`account-tags`,describe:`Tags applied to the account for organizational grouping and policy targeting`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:w,handler:async t=>{let n={cursor:t.cursor};if(t.dryRun){f({command:`cf resource-tagging keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags/keys`,pathParams:{},query:n,bodyKind:`none`});return}let r=await s(t),i=t.local?h:await a(r);t.accountId=i,d(await p(`Loading`,async()=>r.resourceTagging.keys.list({account_id:i,...n})),{successLabel:`Loaded`})}},E={command:`keys`,describe:`Tag key definitions that establish the vocabulary for tagging resources`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists all tagged resources for an account.`,builder:g(D),handler:async t=>{let n={type:t.type,tag:t.tag,cursor:t.cursor};if(t.dryRun){f({command:`cf resource-tagging list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags/resources`,pathParams:{},query:n,bodyKind:`none`});return}let r=await s(t),i=t.local?h:await a(r);t.accountId=i,d(await p(`Loading`,async()=>r.resourceTagging.list({account_id:i,...n})),{successLabel:`Loaded`})}};function k(e){return e.option(`tag-key`,{type:`string`,description:`The tag key to retrieve values for.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter by resource type.`,choices:`access_application.access_application_policy.access_group.account.ai_gateway.alerting_policy.alerting_webhook.api_gateway_operation.cloudflared_tunnel.custom_certificate.custom_hostname.d1_database.dns_record.durable_object_namespace.gateway_list.gateway_rule.image.kv_namespace.managed_client_certificate.queue.r2_bucket.resource_share.stream_live_input.stream_video.worker.worker_version.zone`.split(`.`)}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all distinct values for a given tag key, optionally filtered by resource type.`,builder:g(k),handler:async t=>{let n={type:t.type,cursor:t.cursor};if(t.dryRun){f({command:`cf resource-tagging values list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/tags/values/${t[`tag-key`]==null?`<tag-key>`:encodeURIComponent(String(t[`tag-key`]))}`,pathParams:{"tag-key":String(t[`tag-key`]??``)},query:n,bodyKind:`none`});return}let r=await s(t),i=t.local?h:await a(r);t.accountId=i,d(await p(`Loading`,async()=>r.resourceTagging.values.list({account_id:i,tag_key:t[`tag-key`],...n})),{successLabel:`Loaded`})}},j={command:`values`,describe:`Allowed values for tag keys — constrain tagging to a defined set of options`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
9
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:[`worker_version`]}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on account-level resources.`})}const S={command:`update`,describe:`Creates or updates tags for a specific account-level resource.`,builder:x,handler:async i=>{let a={};if(i[`if-match`]!==void 0&&(a[`If-Match`]=String(i[`if-match`])),i.dryRun){f({command:`cf resource-tagging account-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags`,pathParams:{},bodyKind:`json`,body:i.body===void 0?u({resource_id:m(i[`resource-id`],`resource-id`,`text`),resource_type:m(i[`resource-type`],`resource-type`,`text`),worker_id:m(i[`worker-id`],`worker-id`,`text`)}):c(i.body)});return}let g=await s(i),_=i.local?h:await r(g);if(i.accountId=_,i.body){let e=c(i.body);d(await p(`Updating`,async()=>o(g,`PUT`,`/accounts/${_}/tags`,{body:e,headers:Object.keys(a).length>0?a:void 0})),{successLabel:`Updated`});return}i[`resource-id`]===void 0&&(i[`resource-id`]=await e(`resource-id`,`Identifies the unique resource.`)),i[`resource-type`]===void 0&&(i[`resource-type`]=await n(`resource-type`,`Enum for worker_version resource type.`,[`worker_version`]));let v={};i[`resource-id`]!==void 0&&l(v,[`resource_id`],m(i[`resource-id`],`resource-id`,`text`)),i[`resource-type`]!==void 0&&l(v,[`resource_type`],m(i[`resource-type`],`resource-type`,`text`)),i[`worker-id`]!==void 0&&l(v,[`worker_id`],m(i[`worker-id`],`worker-id`,`text`)),d(await p(`Updating`,async()=>o(g,`PUT`,`/accounts/${_}/tags`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(a).length>0?a:void 0})),{successLabel:`Updated`})}},C={command:`account-tags`,describe:`Tags applied to the account for organizational grouping and policy targeting`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:w,handler:async e=>{let n={cursor:e.cursor};if(e.dryRun){f({command:`cf resource-tagging keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags/keys`,pathParams:{},query:n,bodyKind:`none`});return}let i=await s(e),a=e.local?h:await r(i);e.accountId=a,d(await p(`Loading`,async()=>i.resourceTagging.keys.list({account_id:a,...n})),{successLabel:`Loaded`})}},E={command:`keys`,describe:`Tag key definitions that establish the vocabulary for tagging resources`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists all tagged resources for an account.`,builder:g(D),handler:async e=>{let n={type:e.type,tag:e.tag,cursor:e.cursor};if(e.dryRun){f({command:`cf resource-tagging list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags/resources`,pathParams:{},query:n,bodyKind:`none`});return}let i=await s(e),a=e.local?h:await r(i);e.accountId=a,d(await p(`Loading`,async()=>i.resourceTagging.list({account_id:a,...n})),{successLabel:`Loaded`})}};function k(e){return e.option(`tag-key`,{type:`string`,description:`The tag key to retrieve values for.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter by resource type.`,choices:`access_application.access_application_policy.access_group.account.ai_gateway.alerting_policy.alerting_webhook.api_gateway_operation.cloudflared_tunnel.custom_certificate.custom_hostname.d1_database.dns_record.durable_object_namespace.gateway_list.gateway_rule.image.kv_namespace.managed_client_certificate.queue.r2_bucket.resource_share.stream_live_input.stream_video.worker.worker_version.zone`.split(`.`)}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all distinct values for a given tag key, optionally filtered by resource type.`,builder:g(k),handler:async e=>{let n={type:e.type,cursor:e.cursor};if(e.dryRun){f({command:`cf resource-tagging values list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tags/values/${e[`tag-key`]==null?`<tag-key>`:encodeURIComponent(String(e[`tag-key`]))}`,pathParams:{"tag-key":String(e[`tag-key`]??``)},query:n,bodyKind:`none`});return}let i=await s(e),a=e.local?h:await r(i);e.accountId=a,d(await p(`Loading`,async()=>i.resourceTagging.values.list({account_id:a,tag_key:e[`tag-key`],...n})),{successLabel:`Loaded`})}},j={command:`values`,describe:`Allowed values for tag keys — constrain tagging to a defined set of options`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
10
10
  verify the current resource ETag matches before applying the write. Returns
11
11
  412 Precondition Failed if the resource has been modified since the ETag was
12
- obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from zone-level resources.`})}const N={command:`delete`,describe:`Removes all tags from a specific zone-level resource.`,builder:M,handler:async e=>{let a={};if(e[`if-match`]!==void 0&&(a[`If-Match`]=String(e[`if-match`])),e.dryRun){f({command:`cf resource-tagging zone-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({resource_id:m(e[`resource-id`],`resource-id`,`text`),resource_type:m(e[`resource-type`],`resource-type`,`text`),access_application_id:m(e[`access-application-id`],`access-application-id`,`text`)}):c(e.body)});return}let h=await s(e);if(e.zoneId=await r({zone:e.zone},h,{quiet:e.quiet}),!await i({force:!!e.force})){process.stderr.write(`Aborted.
13
- `);return}if(e.body){let t=c(e.body);d(await p(`Deleting`,async()=>o(h,`DELETE`,`/zones/${e.zoneId}/tags`,{body:t,headers:Object.keys(a).length>0?a:void 0})),{successLabel:`Deleted`});return}e[`resource-id`]===void 0&&(e[`resource-id`]=await t(`resource-id`,`Identifies the unique resource.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await n(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]));let g={};e[`resource-id`]!==void 0&&l(g,[`resource_id`],m(e[`resource-id`],`resource-id`,`text`)),e[`resource-type`]!==void 0&&l(g,[`resource_type`],m(e[`resource-type`],`resource-type`,`text`)),e[`access-application-id`]!==void 0&&l(g,[`access_application_id`],m(e[`access-application-id`],`access-application-id`,`text`)),d(await p(`Deleting`,async()=>o(h,`DELETE`,`/zones/${e.zoneId}/tags`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(a).length>0?a:void 0})),{successLabel:`Deleted`})}};function P(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:[`access_application_policy`,`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`],demandOption:!0}).option(`access-application-id`,{type:`string`,description:`Access application ID identifier. Required for access_application_policy resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Retrieves tags for a specific zone-level resource.`,builder:g(P),handler:async e=>{let t={resource_id:e[`resource-id`],resource_type:e[`resource-type`],access_application_id:e[`access-application-id`]};if(e.dryRun){f({command:`cf resource-tagging zone-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,d(await p(`Loading`,async()=>n.resourceTagging.zoneTags.get({zone_id:i,...t})),{successLabel:`Loaded`})}};function I(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
12
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from zone-level resources.`})}const N={command:`delete`,describe:`Removes all tags from a specific zone-level resource.`,builder:M,handler:async t=>{let r={};if(t[`if-match`]!==void 0&&(r[`If-Match`]=String(t[`if-match`])),t.dryRun){f({command:`cf resource-tagging zone-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?u({resource_id:m(t[`resource-id`],`resource-id`,`text`),resource_type:m(t[`resource-type`],`resource-type`,`text`),access_application_id:m(t[`access-application-id`],`access-application-id`,`text`)}):c(t.body)});return}let h=await s(t);if(t.zoneId=await a({zone:t.zone},h,{quiet:t.quiet}),!await i({force:!!t.force})){process.stderr.write(`Aborted.
13
+ `);return}if(t.body){let e=c(t.body);d(await p(`Deleting`,async()=>o(h,`DELETE`,`/zones/${t.zoneId}/tags`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`});return}t[`resource-id`]===void 0&&(t[`resource-id`]=await e(`resource-id`,`Identifies the unique resource.`)),t[`resource-type`]===void 0&&(t[`resource-type`]=await n(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]));let g={};t[`resource-id`]!==void 0&&l(g,[`resource_id`],m(t[`resource-id`],`resource-id`,`text`)),t[`resource-type`]!==void 0&&l(g,[`resource_type`],m(t[`resource-type`],`resource-type`,`text`)),t[`access-application-id`]!==void 0&&l(g,[`access_application_id`],m(t[`access-application-id`],`access-application-id`,`text`)),d(await p(`Deleting`,async()=>o(h,`DELETE`,`/zones/${t.zoneId}/tags`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function P(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:[`access_application_policy`,`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`],demandOption:!0}).option(`access-application-id`,{type:`string`,description:`Access application ID identifier. Required for access_application_policy resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Retrieves tags for a specific zone-level resource.`,builder:g(P),handler:async e=>{let t={resource_id:e[`resource-id`],resource_type:e[`resource-type`],access_application_id:e[`access-application-id`]};if(e.dryRun){f({command:`cf resource-tagging zone-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,d(await p(`Loading`,async()=>n.resourceTagging.zoneTags.get({zone_id:r,...t})),{successLabel:`Loaded`})}};function I(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
14
14
  verify the current resource ETag matches before applying the write. Returns
15
15
  412 Precondition Failed if the resource has been modified since the ETag was
16
- obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on zone-level resources.`})}const L={command:`update`,describe:`Creates or updates tags for a specific zone-level resource. Replaces all existing tags for the resource.`,builder:I,handler:async e=>{let i={};if(e[`if-match`]!==void 0&&(i[`If-Match`]=String(e[`if-match`])),e.dryRun){f({command:`cf resource-tagging zone-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({resource_id:m(e[`resource-id`],`resource-id`,`text`),resource_type:m(e[`resource-type`],`resource-type`,`text`),access_application_id:m(e[`access-application-id`],`access-application-id`,`text`)}):c(e.body)});return}let a=await s(e);if(e.zoneId=await r({zone:e.zone},a,{quiet:e.quiet}),e.body){let t=c(e.body);d(await p(`Updating`,async()=>o(a,`PUT`,`/zones/${e.zoneId}/tags`,{body:t,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`});return}e[`resource-id`]===void 0&&(e[`resource-id`]=await t(`resource-id`,`Identifies the unique resource.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await n(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]));let h={};e[`resource-id`]!==void 0&&l(h,[`resource_id`],m(e[`resource-id`],`resource-id`,`text`)),e[`resource-type`]!==void 0&&l(h,[`resource_type`],m(e[`resource-type`],`resource-type`,`text`)),e[`access-application-id`]!==void 0&&l(h,[`access_application_id`],m(e[`access-application-id`],`access-application-id`,`text`)),d(await p(`Updating`,async()=>o(a,`PUT`,`/zones/${e.zoneId}/tags`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}},R={command:`zone-tags`,describe:`Tags applied to individual zones for categorization and bulk management`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`resource-tagging`,describe:`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,builder:e=>e.command(O).command(C).command(E).command(j).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
16
+ obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for base zone-level resource types (those with no extra required fields).`,choices:[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]}).option(`access-application-id`,{type:`string`,description:`Access application ID is required only for access_application_policy resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on zone-level resources.`})}const L={command:`update`,describe:`Creates or updates tags for a specific zone-level resource. Replaces all existing tags for the resource.`,builder:I,handler:async t=>{let r={};if(t[`if-match`]!==void 0&&(r[`If-Match`]=String(t[`if-match`])),t.dryRun){f({command:`cf resource-tagging zone-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/tags`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?u({resource_id:m(t[`resource-id`],`resource-id`,`text`),resource_type:m(t[`resource-type`],`resource-type`,`text`),access_application_id:m(t[`access-application-id`],`access-application-id`,`text`)}):c(t.body)});return}let i=await s(t);if(t.zoneId=await a({zone:t.zone},i,{quiet:t.quiet}),t.body){let e=c(t.body);d(await p(`Updating`,async()=>o(i,`PUT`,`/zones/${t.zoneId}/tags`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`});return}t[`resource-id`]===void 0&&(t[`resource-id`]=await e(`resource-id`,`Identifies the unique resource.`)),t[`resource-type`]===void 0&&(t[`resource-type`]=await n(`resource-type`,`Enum for base zone-level resource types (those with no extra required fields).`,[`api_gateway_operation`,`custom_certificate`,`custom_hostname`,`dns_record`,`managed_client_certificate`,`zone`]));let h={};t[`resource-id`]!==void 0&&l(h,[`resource_id`],m(t[`resource-id`],`resource-id`,`text`)),t[`resource-type`]!==void 0&&l(h,[`resource_type`],m(t[`resource-type`],`resource-type`,`text`)),t[`access-application-id`]!==void 0&&l(h,[`access_application_id`],m(t[`access-application-id`],`access-application-id`,`text`)),d(await p(`Updating`,async()=>o(i,`PUT`,`/zones/${t.zoneId}/tags`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}},R={command:`zone-tags`,describe:`Tags applied to individual zones for categorization and bulk management`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`resource-tagging`,describe:`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,builder:e=>e.command(O).command(C).command(E).command(j).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.mjs";function f(e){return e.positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <operation-id>`,describe:"Gets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.",builder:f,handler:async e=>{if(e.dryRun){c({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/bulk_operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.rules.lists.bulkOperations.get({account_id:a,operation_id:e[`operation-id`]})),{successLabel:`Loaded`})}},m={command:`bulk-operations`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Creates a new list of the specified kind.`,builder:h,handler:async r=>{if(r.dryRun){c({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Creating`,async()=>f.rules.lists.create({...e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await e(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=o({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)});s(await l(`Creating`,async()=>f.rules.lists.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <list-id>`,describe:`Deletes a specific list and all its items.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}s(await l(`Deleting`,async()=>a.rules.lists.delete({account_id:o,list_id:e[`list-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <list-id>`,describe:`Fetches the details of a list.`,builder:y,handler:async e=>{if(e.dryRun){c({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.rules.lists.get({account_id:a,list_id:e[`list-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create <list-id>`,describe:"Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:x,handler:async e=>{if(e.dryRun){c({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let r=await i(e),o=e.local?d:await n(r);if(e.accountId=o,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.rules.lists.items.create({body:t,account_id:o,list_id:e[`list-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 C(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`delete <list-id>`,describe:"Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:C,handler:async e=>{if(e.dryRun){c({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let o=await i(e),u=e.local?d:await n(o);if(e.accountId=u,!await r({force:!!e.force})){process.stderr.write(`Aborted.
4
+ `);return}if(e.body){let t=a(e.body);s(await l(`Deleting`,async()=>o.rules.lists.items.delete({...t,account_id:u,list_id:e[`list-id`]})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>o.rules.lists.items.delete({account_id:u,list_id:e[`list-id`]})),{successLabel:`Deleted`})}};function T(e){return e.positional(`item-id`,{type:`string`,description:`Defines the unique ID of the item in the List.`,demandOption:!0}).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <item-id>`,describe:`Fetches a list item in the list.`,builder:T,handler:async e=>{if(e.dryRun){c({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{"item-id":String(e[`item-id`]??``),"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.rules.lists.items.get({account_id:a,list_id:e[`list-id`],item_id:e[`item-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token indicating the position from which to continue when requesting the next/previous set of records. Cursor values are provided under `result_info.cursors` in the response. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Fetches all the items in the list.`,builder:D,handler:async e=>{let r={cursor:e.cursor,per_page:e[`per-page`],search:e.search};if(e.dryRun){c({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.rules.lists.items.list({account_id:o,list_id:e[`list-id`],...r})),{successLabel:`Loaded`})}};function k(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`update <list-id>`,describe:"Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.",builder:k,handler:async e=>{if(e.dryRun){c({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let r=await i(e),o=e.local?d:await n(r);if(e.accountId=o,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.rules.lists.items.update({body:t,account_id:o,list_id:e[`list-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.`)}},j={command:`items`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(S).command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Fetches all lists in the account.`,builder:M,handler:async e=>{if(e.dryRun){c({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.rules.lists.list({account_id:a})),{successLabel:`Loaded`})}};function P(e){return e.positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update <list-id>`,describe:`Updates the description of a list.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({description:u(e.description,`description`,`text`)}):a(e.body)});return}let r=await i(e),f=e.local?d:await n(r);if(e.accountId=f,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.rules.lists.update({...t,account_id:f,list_id:e[`list-id`]})),{successLabel:`Updated`});return}let p=o({description:u(e.description,`description`,`text`)});s(await l(`Updating`,async()=>r.rules.lists.update({...p,account_id:f,list_id:e[`list-id`]})),{successLabel:`Updated`})}},I={command:`lists`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(g).command(v).command(b).command(N).command(F).command(m).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`rules`,describe:`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{L as default};