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,57 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <dns-firewall-id>`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:d(f),handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters,time_delta:t[`time-delta`]};if(t.dryRun){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <dns-firewall-id>`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h,handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
3
- indicated by the TTL received from upstream nameservers. This setting
4
- sets an upper bound on this duration. For caching purposes, higher TTLs
5
- will be decreased to the maximum value defined by this setting.
6
-
7
- This setting does not affect the TTL value in the DNS response
8
- Cloudflare returns to clients. Cloudflare will always forward the TTL
9
- value received from upstream nameservers.
10
- `,default:900}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
11
- indicated by the TTL received from upstream nameservers. This setting
12
- sets a lower bound on this duration. For caching purposes, lower TTLs
13
- will be increased to the minimum value defined by this setting.
14
-
15
- This setting does not affect the TTL value in the DNS response
16
- Cloudflare returns to clients. Cloudflare will always forward the TTL
17
- value received from upstream nameservers.
18
-
19
- Note that, even with this setting, there is no guarantee that a
20
- response will be cached for at least the specified duration. Cached
21
- responses may be removed earlier for capacity or other operational
22
- reasons.
23
- `,default:60}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
24
- responses (e.g., NXDOMAIN) from the upstream servers.
25
-
26
- This setting does not affect the TTL value in the DNS response
27
- Cloudflare returns to clients. Cloudflare will always forward the TTL
28
- value received from upstream nameservers.
29
- `}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`,default:2}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dns-firewall-ip-count`,{type:`number`,description:`Number of IPv4 addresses to assign to the DNS Firewall cluster. Only used during cluster creation and cannot be changed later.`,default:2}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create a DNS Firewall cluster`,builder:y,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`dns-firewall-ip-count`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.dnsFirewall.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`dns-firewall-ip-count`]});o(await c(`Creating`,async()=>d.dnsFirewall.create({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <dns-firewall-id>`,describe:`Delete a DNS Firewall cluster`,builder:x,handler:async i=>{if(i.dryRun){s({command:`cf dns-firewall delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${i[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(i[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(i[`dns-firewall-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
30
- `);return}o(await c(`Deleting`,async()=>a.dnsFirewall.delete({account_id:l,dns_firewall_id:i[`dns-firewall-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
31
- indicated by the TTL received from upstream nameservers. This setting
32
- sets an upper bound on this duration. For caching purposes, higher TTLs
33
- will be decreased to the maximum value defined by this setting.
34
-
35
- This setting does not affect the TTL value in the DNS response
36
- Cloudflare returns to clients. Cloudflare will always forward the TTL
37
- value received from upstream nameservers.
38
- `}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
39
- indicated by the TTL received from upstream nameservers. This setting
40
- sets a lower bound on this duration. For caching purposes, lower TTLs
41
- will be increased to the minimum value defined by this setting.
42
-
43
- This setting does not affect the TTL value in the DNS response
44
- Cloudflare returns to clients. Cloudflare will always forward the TTL
45
- value received from upstream nameservers.
46
-
47
- Note that, even with this setting, there is no guarantee that a
48
- response will be cached for at least the specified duration. Cached
49
- responses may be removed earlier for capacity or other operational
50
- reasons.
51
- `}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
52
- responses (e.g., NXDOMAIN) from the upstream servers.
53
-
54
- This setting does not affect the TTL value in the DNS response
55
- Cloudflare returns to clients. Cloudflare will always forward the TTL
56
- value received from upstream nameservers.
57
- `}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <dns-firewall-id>`,describe:`Modify the configuration of a DNS Firewall cluster`,builder:C,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.dnsFirewall.edit({...e,account_id:f,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]});o(await c(`Updating`,async()=>d.dnsFirewall.edit({...p,account_id:f,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`})}};function T(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <dns-firewall-id>`,describe:`Show a single DNS Firewall cluster for an account`,builder:T,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.get({account_id:a,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results`}).option(`per-page`,{type:`number`,description:`Number of clusters per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List DNS Firewall clusters for an account`,builder:D,handler:async t=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){s({command:`cf dns-firewall list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.list({account_id:l,...i})),{successLabel:`Loaded`})}};function k(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <dns-firewall-id>`,describe:`Update reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:k,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let a=await r(t),l=t.local?u:await n(a);if(t.accountId=l,t.body){let e=i(t.body);o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({...e,account_id:l,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({account_id:l,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <dns-firewall-id>`,describe:`Show reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:j,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.reverseDns.get({account_id:a,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Loaded`})}},N={command:`reverse-dns`,describe:`Operations for reverse-dns`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`dns-firewall`,describe:`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(v).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,_ as t,n}from"./auth-ffdf9yR0.mjs";import{t as r}from"./output-BJFNwj7b.mjs";import{n as i,t as a}from"./progress-CrCGTq7N.mjs";import{t as o}from"./local-VJaJ3BZ1.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,n as a}from"./auth-ffdf9yR0.mjs";import{n 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";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:p,handler:async t=>{if(t.dryRun){l({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.emailSending.limits.get({account_id:r})),{successLabel:`Loaded`})}},h={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:g,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(n.from===void 0&&(n.from=await t(`from`,`Sender email address.`)),n[`mime-message`]===void 0&&(n[`mime-message`]=await t(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),n.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients});c(await u(`Creating`,async()=>r.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:v,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}n.subject===void 0&&(n.subject=await t(`subject`,`Email subject line.`));let m=s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}});c(await u(`Creating`,async()=>r.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present.`,builder:b,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...t,zone_id:i})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...f,zone_id:i})),{successLabel:`Created`})}};function S(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>t.emailSending.subdomains.delete({zone_id:i,subdomain_id:e[`subdomain-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`fix <subdomain-id>`,describe:`Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns fix`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Creating`,async()=>t.emailSending.subdomains.dns.fix({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Created`})}};function E(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get-status <subdomain-id>`,describe:`Returns the desired DNS records for a sending subdomain along with a live diff against actual DNS state. Use this to detect missing, unlocked, foreign, or multi-record conflicts before deciding whether to call the fix endpoint.`,builder:E,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns/status`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.getStatus({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <subdomain-id>`,describe:`Returns the expected DNS records for a sending subdomain.`,builder:O,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}},A={command:`dns`,describe:`Operations for subdomains.dns`,builder:e=>e.command(T).command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <subdomain-id>`,describe:`Gets information for a specific sending subdomain.`,builder:j,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all sending-enabled subdomains for the zone.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.list({zone_id:r})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`preview`,describe:`Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status.`,builder:F,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...t,zone_id:i})),{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...f,zone_id:i})),{successLabel:`Loaded`})}};function L(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`preview-enabled`,{type:`boolean`,description:`Whether sent messages from this subdomain can be previewed in the activity log.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <subdomain-id>`,describe:`Updates the activity-log preview preference for a sending subdomain.`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({preview_enabled:e[`preview-enabled`]}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...n,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`});return}if(e[`preview-enabled`]===void 0)throw Error(`--preview-enabled is required (or pass --body with this field set).`);let i=s({preview_enabled:e[`preview-enabled`]});c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...i,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`})}},z={command:`subdomains`,describe:`Operations for subdomains`,builder:e=>e.command(x).command(C).command(M).command(P).command(I).command(R).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`email-sending`,describe:`Send emails and manage sending subdomains`,builder:e=>e.command(y).command(_).command(h).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{D as e,S as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Gets the Google Tag Gateway configuration for a zone.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf google-tag-gateway config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.googleTagGateway.config.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables Google Tag Gateway for this zone.`}).option(`endpoint`,{type:`string`,description:`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`}).option(`hide-original-ip`,{type:`boolean`,description:`Hides the original client IP address from Google when enabled.`}).option(`measurement-id`,{type:`string`,description:`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`}).option(`set-up-tag`,{type:`boolean`,description:`Set up the associated Google Tag on the zone automatically when enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Google Tag Gateway configuration for a zone.`})}const f={command:`update`,describe:`Updates the Google Tag Gateway configuration for a zone.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf google-tag-gateway config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:e,zone_id:d})),{successLabel:`Updated`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(l.endpoint===void 0&&(l.endpoint=await e(`endpoint`,`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`)),l[`hide-original-ip`]===void 0)throw Error(`--hide-original-ip is required (or pass --body with this field set).`);l[`measurement-id`]===void 0&&(l[`measurement-id`]=await e(`measurement-id`,`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`));let f=i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]});a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:f,zone_id:d})),{successLabel:`Updated`})}},p={command:`config`,describe:`Operations for config`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`google-tag-gateway`,describe:`Google Tag Gateway operations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{S as e,T as t,i as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{t as c}from"./cli-types-CRIDdDw3.mjs";function l(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get <hostname>`,describe:`Get the requested TLS setting for the hostname.`,builder:c(l),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls-single get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>n.hostnames.settings.tlsSingle.get({zone_id:i,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Loaded`})}},d={command:`tls-single`,describe:`Operations for settings.tls-single`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',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 p={command:`delete <hostname>`,describe:`Delete the tls setting value for the hostname.`,builder:c(f),handler:async n=>{if(n.dryRun){o({command:`cf hostnames settings tls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/hostnames/settings/${n[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(n[`setting-id`]))}/${n.hostname==null?`<hostname>`:encodeURIComponent(String(n.hostname))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),"setting-id":String(n[`setting-id`]??``),hostname:String(n.hostname??``)},bodyKind:`none`});return}let i=await r(n),c=await e({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=c,!await t({force:!!n.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.hostnames.settings.tls.delete({zone_id:c,setting_id:n[`setting-id`],hostname:n.hostname})),{successLabel:`Deleted`})}};function m(e){return e.positional(`setting-id`,{type:`string`,description:'The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`). - `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <setting-id>`,describe:`List the requested TLS setting for the hostnames under this zone.`,builder:c(m),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>n.hostnames.settings.tls.get({zone_id:i,setting_id:t[`setting-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',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 _={command:`update <hostname>`,describe:`Update the tls setting value for the hostname.`,builder:c(g),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let c=await r(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=i(t.body);a(await s(`Updating`,async()=>c.hostnames.settings.tls.update({...e,zone_id:l,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>n(c,`PUT`,`/zones/${t.zoneId}/hostnames/settings/${encodeURIComponent(String(t[`setting-id`]))}/${encodeURIComponent(String(t.hostname))}`)),{successLabel:`Updated`})}},v={command:`tls`,describe:`Operations for settings.tls`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(v).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`hostnames`,describe:`Per-hostname TLS settings — minimum TLS version, ciphers, and certificate pinning overrides`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-ffdf9yR0.mjs";import{n 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";function p(e){return e.option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-database`,{type:`string`,description:`Set the name of your origin database.`}).option(`origin-password`,{type:`string`,description:`Set the password needed to access your origin database. The API never returns this write-only value.`}).option(`origin-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`origin-user`,{type:`string`,description:`Set the user of your origin database.`}).option(`origin-host`,{type:`string`,description:`Defines the host (hostname or IP) of your origin database.`}).option(`origin-port`,{type:`number`,description:`Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.`}).option(`origin-access-client-id`,{type:`string`,description:`Defines the Client ID of the Access token to use when connecting to the origin database.`}).option(`origin-access-client-secret`,{type:`string`,description:`Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.`}).option(`origin-service-id`,{type:`string`,description:`The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
3
-
4
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
5
- If not specified, defaults to 20 for free tier and 60 for paid tier.
6
- Contact Cloudflare if you need a higher limit.
7
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`origin-host`,[`origin-service-id`]).conflicts(`origin-port`,[`origin-access-client-id`,`origin-access-client-secret`,`origin-service-id`]).implies(`origin-port`,[`origin-host`]).conflicts(`origin-access-client-id`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-id`,[`origin-host`,`origin-access-client-secret`]).conflicts(`origin-access-client-secret`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-secret`,[`origin-host`,`origin-access-client-id`]).conflicts(`origin-service-id`,[`origin-host`,`origin-port`,`origin-access-client-id`,`origin-access-client-secret`])}const m={command:`create`,describe:`Creates and returns a new Hyperdrive configuration.`,builder:p,handler:async r=>{if(r.dryRun){l({command:`cf hyperdrive create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.hyperdrive.create({body:e,account_id:m})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await t(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`)),r[`origin-database`]===void 0&&(r[`origin-database`]=await t(`origin-database`,`Set the name of your origin database.`)),r[`origin-password`]===void 0&&(r[`origin-password`]=await t(`origin-password`,`Set the password needed to access your origin database. The API never returns this write-only value.`,{kind:`secret`})),r[`origin-scheme`]===void 0&&(r[`origin-scheme`]=await n(`origin-scheme`,`Specifies the URL scheme used to connect to your origin database.`,[`postgres`,`postgresql`,`mysql`])),r[`origin-user`]===void 0&&(r[`origin-user`]=await t(`origin-user`,`Set the user of your origin database.`));let h=s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]});c(await u(`Creating`,async()=>p.hyperdrive.create({body:h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,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 g={command:`delete <hyperdrive-id>`,describe:`Deletes the specified Hyperdrive.`,builder:h,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
8
- `);return}c(await u(`Deleting`,async()=>n.hyperdrive.delete({account_id:o,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
9
-
10
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
11
- If not specified, defaults to 20 for free tier and 60 for paid tier.
12
- Contact Cloudflare if you need a higher limit.
13
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <hyperdrive-id>`,describe:`Patches and returns the specified Hyperdrive configuration. Custom caching settings are not kept if caching is disabled.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({caching:{disabled:t[`caching-disabled`],max_age:t[`caching-max-age`],stale_while_revalidate:t[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(t[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(t[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(t[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(t.name,`name`,`text`),origin_connection_limit:t[`origin-connection-limit`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.hyperdrive.edit({...e,account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Updated`});return}let p=s({caching:{disabled:t[`caching-disabled`],max_age:t[`caching-max-age`],stale_while_revalidate:t[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(t[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(t[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(t[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(t.name,`name`,`text`),origin_connection_limit:t[`origin-connection-limit`]});c(await u(`Updating`,async()=>n.hyperdrive.edit({...p,account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <hyperdrive-id>`,describe:`Returns the specified Hyperdrive configuration.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.hyperdrive.get({account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns a list of Hyperdrives.`,builder:x,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf hyperdrive list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.hyperdrive.list({account_id:o,...n})),{successLabel:`Loaded`})}};function C(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-database`,{type:`string`,description:`Set the name of your origin database.`}).option(`origin-password`,{type:`string`,description:`Set the password needed to access your origin database. The API never returns this write-only value.`}).option(`origin-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`origin-user`,{type:`string`,description:`Set the user of your origin database.`}).option(`origin-host`,{type:`string`,description:`Defines the host (hostname or IP) of your origin database.`}).option(`origin-port`,{type:`number`,description:`Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.`}).option(`origin-access-client-id`,{type:`string`,description:`Defines the Client ID of the Access token to use when connecting to the origin database.`}).option(`origin-access-client-secret`,{type:`string`,description:`Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.`}).option(`origin-service-id`,{type:`string`,description:`The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
14
-
15
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
16
- If not specified, defaults to 20 for free tier and 60 for paid tier.
17
- Contact Cloudflare if you need a higher limit.
18
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`origin-host`,[`origin-service-id`]).conflicts(`origin-port`,[`origin-access-client-id`,`origin-access-client-secret`,`origin-service-id`]).implies(`origin-port`,[`origin-host`]).conflicts(`origin-access-client-id`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-id`,[`origin-host`,`origin-access-client-secret`]).conflicts(`origin-access-client-secret`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-secret`,[`origin-host`,`origin-access-client-id`]).conflicts(`origin-service-id`,[`origin-host`,`origin-port`,`origin-access-client-id`,`origin-access-client-secret`])}const w={command:`update <hyperdrive-id>`,describe:`Updates and returns the specified Hyperdrive configuration.`,builder:C,handler:async r=>{if(r.dryRun){l({command:`cf hyperdrive update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${r[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(r[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(r[`hyperdrive-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.hyperdrive.update({body:e,account_id:m,hyperdrive_id:r[`hyperdrive-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await t(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`)),r[`origin-database`]===void 0&&(r[`origin-database`]=await t(`origin-database`,`Set the name of your origin database.`)),r[`origin-password`]===void 0&&(r[`origin-password`]=await t(`origin-password`,`Set the password needed to access your origin database. The API never returns this write-only value.`,{kind:`secret`})),r[`origin-scheme`]===void 0&&(r[`origin-scheme`]=await n(`origin-scheme`,`Specifies the URL scheme used to connect to your origin database.`,[`postgres`,`postgresql`,`mysql`])),r[`origin-user`]===void 0&&(r[`origin-user`]=await t(`origin-user`,`Set the user of your origin database.`));let h=s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]});c(await u(`Updating`,async()=>p.hyperdrive.update({body:h,account_id:m,hyperdrive_id:r[`hyperdrive-id`]})),{successLabel:`Updated`})}},T={command:`hyperdrive`,describe:`Accelerate access to existing databases by caching queries and pooling connections at the edge`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";import{t as f}from"./cli-types-CRIDdDw3.mjs";function p(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups/${t[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(t[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(t[`permission-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.permissionGroups.get({account_id:a,permission_group_id:t[`permission-group-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List all the permissions groups for an account.`,builder:h,handler:async t=>{let n={id:t.id,name:t.name,label:t.label,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.permissionGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}},_={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:v,handler:async n=>{if(n.dryRun){c({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({name:u(n.name,`name`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the resource group`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group 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 x={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}s(await l(`Deleting`,async()=>a.iam.resourceGroups.delete({account_id:o,resource_group_id:t[`resource-group-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:S,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.resourceGroups.get({account_id:a,resource_group_id:t[`resource-group-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List all the resource groups for an account.`,builder:w,handler:async t=>{let n={id:t.id,name:t.name};if(t.dryRun){c({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.resourceGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function E(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.resourceGroups.update({...e,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.resourceGroups.update({...p,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`})}},O={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Creating`,async()=>n.iam.sso.beginVerification({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Created`})}};function j(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:j,handler:async n=>{if(n.dryRun){c({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}n[`email-domain`]===void 0&&(n[`email-domain`]=await t(`email-domain`,`Email domain of the new SSO connector`));let m=o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]});s(await l(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector 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 P={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:N,handler:async t=>{if(t.dryRun){c({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}s(await l(`Deleting`,async()=>a.iam.sso.delete({account_id:o,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:F,handler:async t=>{if(t.dryRun){c({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.sso.get({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:I,handler:async t=>{if(t.dryRun){c({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.sso.list({account_id:a})),{successLabel:`Loaded`})}};function R(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async t=>{if(t.dryRun){c({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]}):a(t.body)});return}let n=await i(t),u=t.local?d:await r(n);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.sso.update({...e,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]});s(await l(`Updating`,async()=>n.iam.sso.update({...f,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`})}},B={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(A).command(M).command(P).command(ee).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).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:`Create a new user group under the specified account.`,builder:V,handler:async n=>{if(n.dryRun){c({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({name:u(n.name,`name`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the User group.`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function U(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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 W={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:U,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}s(await l(`Deleting`,async()=>a.iam.userGroups.delete({account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:G,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.userGroups.get({account_id:a,user_group_id:t[`user-group-id`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List all the user groups for an account.`,builder:f(q),handler:async t=>{let n={id:t.id,name:t.name,fuzzyName:t[`fuzzy-name`],page:t.page,per_page:t[`per-page`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.userGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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 X={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:Y,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.iam.userGroups.members.create({body:e,account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Z(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group 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 Q={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:Z,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members/${t[`member-id`]==null?`<member-id>`:encodeURIComponent(String(t[`member-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``),"member-id":String(t[`member-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
6
- `);return}s(await l(`Deleting`,async()=>a.iam.userGroups.members.delete({account_id:o,user_group_id:t[`user-group-id`],member_id:t[`member-id`]})),{successLabel:`Deleted`})}};function $(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`list`,describe:`List all the members attached to a user group.`,builder:f($),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],fuzzyEmail:t[`fuzzy-email`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.userGroups.members.list({account_id:o,user_group_id:t[`user-group-id`],...n})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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:`Set/Replace members to a user group.`})}const re={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:ne,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.userGroups.members.update({body:e,account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},ie={command:`members`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(X).command(Q).command(te).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).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 oe={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.userGroups.update({...e,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.userGroups.update({...p,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`})}},se={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(H).command(W).command(K).command(J).command(oe).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(_).command(O).command(B).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ce as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f,t as p}from"./input-validation-zEO81MWN.mjs";import{t as m}from"./local-VJaJ3BZ1.mjs";import{t as h}from"./cli-types-CRIDdDw3.mjs";import{n as g,t as _}from"./raw-fetch-Dlccg0Tr.mjs";function v(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const y={command:`get <image-id>`,describe:`Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`,builder:v,handler:async t=>{if(t.dryRun){u({command:`cf images v1 blobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}/blob`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r;let a=await d(`Loading`,async()=>_(`/accounts/${r}/images/v1/${encodeURIComponent(String(t[`image-id`]))}/blob`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));g(t.text===!0?a.toString(`utf-8`):a)}},b={command:`blobs`,describe:`Upload, transform, and serve images with named variants, signing keys, and usage stats`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const S={command:`create`,describe:`Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`,builder:x,handler:async t=>{if(t.dryRun){u({command:`cf images v1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file,creator:t.creator,id:t.id,metadata:t.metadata,"require-signed-urls":t[`require-signed-urls`],url:t.url}});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.file!==void 0||t.body!==void 0||t.creator!==void 0||t.id!==void 0||t.metadata!==void 0||t[`require-signed-urls`]!==void 0||t.url!==void 0){let e=new FormData;if(t.file){let n=p(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);if(t.creator!==void 0&&e.append(`creator`,String(f(t.creator,`creator`,`text`)??``)),t.id!==void 0&&e.append(`id`,String(f(t.id,`id`,`text`)??``)),t.metadata!==void 0){let n=typeof t.metadata==`string`?f(t.metadata,`metadata`,`text`):t.metadata;e.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}t[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(t[`require-signed-urls`])),t.url!==void 0&&e.append(`url`,String(f(t.url,`url`,`text`)??``)),l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v1`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>n.images.v1.create({account_id:r})),{successLabel:`Created`})}};function C(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <image-id>`,describe:`Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`,builder:C,handler:async t=>{if(t.dryRun){u({command:`cf images v1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.images.v1.delete({account_id:a,image_id:t[`image-id`]})),{successLabel:`Deleted`})}};function T(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit <image-id>`,describe:`Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`,builder:T,handler:async t=>{if(t.dryRun){u({command:`cf images v1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({creator:f(t.creator,`creator`,`text`),requireSignedURLs:t[`require-signed-urls`]}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.images.v1.edit({...e,account_id:r,image_id:t[`image-id`]})),{successLabel:`Updated`});return}let a=c({creator:f(t.creator,`creator`,`text`),requireSignedURLs:t[`require-signed-urls`]});l(await d(`Updating`,async()=>n.images.v1.edit({...a,account_id:r,image_id:t[`image-id`]})),{successLabel:`Updated`})}};function D(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <image-id>`,describe:`Fetch details for a CF Images image.`,builder:D,handler:async t=>{if(t.dryRun){u({command:`cf images v1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.get({account_id:r,image_id:t[`image-id`]})),{successLabel:`Loaded`})}};function k(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,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 A={command:`delete <signing-key-name>`,describe:`Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated.`,builder:k,handler:async t=>{if(t.dryRun){u({command:`cf images v1 keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys/${t[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(t[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(t[`signing-key-name`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}l(await d(`Deleting`,async()=>n.images.v1.keys.delete({account_id:a,signing_key_name:t[`signing-key-name`]})),{successLabel:`Deleted`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List your CF Images signing keys.`,builder:j,handler:async t=>{if(t.dryRun){u({command:`cf images v1 keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.keys.list({account_id:r})),{successLabel:`Loaded`})}};function N(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`update <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:N,handler:async t=>{if(t.dryRun){u({command:`cf images v1 keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys/${t[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(t[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(t[`signing-key-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Updating`,async()=>n.images.v1.keys.update({account_id:r,signing_key_name:t[`signing-key-name`]})),{successLabel:`Updated`})}},F={command:`keys`,describe:`Upload, transform, and serve images with named variants, signing keys, and usage stats`,builder:e=>e.command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`list`,describe:`List up to 100 images with one request. Use the optional parameters below to get a specific range of images.`,builder:I,handler:async t=>{let n={page:t.page,per_page:t[`per-page`],creator:t.creator};if(t.dryRun){u({command:`cf images v1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.v1.list({account_id:a,...n})),{successLabel:`Loaded`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get`,describe:`Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance.`,builder:L,handler:async t=>{if(t.dryRun){u({command:`cf images v1 stats get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/stats`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.stats.get({account_id:r})),{successLabel:`Loaded`})}},z={command:`stats`,describe:`Upload, transform, and serve images with named variants, signing keys, and usage stats`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <variant-id>`,describe:`Fetch details for a single variant with properties at the top level of the result.`,builder:B,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants-flat get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}/flat`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.variantsFlat.get({account_id:r,variant_id:t[`variant-id`]})),{successLabel:`Loaded`})}},H={command:`variants-flat`,describe:`Images v1 variant details in flat format`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create`,describe:`Create a CF Images variant that allows you to resize images for different use cases.`,builder:U,handler:async r=>{if(r.dryRun){u({command:`cf images v1 variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):s(r.body)});return}let a=await o(r),p=r.local?m:await i(a);if(r.accountId=p,r.body){let e=s(r.body);l(await d(`Creating`,async()=>a.images.v1.variants.create({body:e,account_id:p})),{successLabel:`Created`});return}if(r.id===void 0&&(r.id=await t(`id`,`The id field`)),r[`options-fit`]===void 0&&(r[`options-fit`]=await n(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await n(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let h=c({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});l(await d(`Creating`,async()=>a.images.v1.variants.create({body:h,account_id:p})),{successLabel:`Created`})}};function G(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const K={command:`delete <variant-id>`,describe:`Delete a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:G,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}l(await d(`Deleting`,async()=>n.images.v1.variants.delete({account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Deleted`})}};function q(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).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:`edit <variant-id>`,describe:`Update a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:q,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({neverRequireSignedURLs:t[`never-require-signed-urls`],options:{fit:f(t[`options-fit`],`options-fit`,`text`),height:t[`options-height`],metadata:f(t[`options-metadata`],`options-metadata`,`text`),width:t[`options-width`]}}):s(t.body)});return}let r=await o(t),a=t.local?m:await i(r);if(t.accountId=a,t.body){let e=s(t.body);l(await d(`Updating`,async()=>r.images.v1.variants.edit({...e,account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Updated`});return}if(t[`options-fit`]===void 0&&(t[`options-fit`]=await n(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),t[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(t[`options-metadata`]===void 0&&(t[`options-metadata`]=await n(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),t[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let p=c({neverRequireSignedURLs:t[`never-require-signed-urls`],options:{fit:f(t[`options-fit`],`options-fit`,`text`),height:t[`options-height`],metadata:f(t[`options-metadata`],`options-metadata`,`text`),width:t[`options-width`]}});l(await d(`Updating`,async()=>r.images.v1.variants.edit({...p,account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Updated`})}};function Y(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <variant-id>`,describe:`Fetch details for a CF Images variant.`,builder:Y,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.variants.get({account_id:r,variant_id:t[`variant-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`List existing CF Images variants.`,builder:Z,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.variants.list({account_id:r})),{successLabel:`Loaded`})}},$={command:`variants`,describe:`Upload, transform, and serve images with named variants, signing keys, and usage stats`,builder:e=>e.command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`v1`,describe:`Upload, transform, and serve images with named variants, signing keys, and usage stats`,builder:e=>e.command(S).command(w).command(E).command(O).command(ee).command(b).command(F).command(z).command($).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const re={command:`create`,describe:"Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.",builder:ne,handler:async t=>{if(t.dryRun){u({command:`cf images v2 direct-uploads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file,creator:t.creator,expiry:t.expiry,id:t.id,metadata:t.metadata,"require-signed-urls":t[`require-signed-urls`]}});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.file!==void 0||t.body!==void 0||t.creator!==void 0||t.expiry!==void 0||t.id!==void 0||t.metadata!==void 0||t[`require-signed-urls`]!==void 0){let e=new FormData;if(t.file){let n=p(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);if(t.creator!==void 0&&e.append(`creator`,String(f(t.creator,`creator`,`text`)??``)),t.expiry!==void 0&&e.append(`expiry`,String(f(t.expiry,`expiry`,`text`)??``)),t.id!==void 0&&e.append(`id`,String(f(t.id,`id`,`text`)??``)),t.metadata!==void 0){let n=typeof t.metadata==`string`?f(t.metadata,`metadata`,`text`):t.metadata;e.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}t[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(t[`require-signed-urls`])),l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>n.images.v2.directUploads.create({account_id:r})),{successLabel:`Created`})}},ie={command:`direct-uploads`,describe:`V2 image listing with cursor-based pagination and authenticated direct upload URLs`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`continuation-token`,{type:`string`,description:`Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:"List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.<field>[<operator>]=<value>` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ```",builder:h(ae),handler:async t=>{let n={continuation_token:t[`continuation-token`],per_page:t[`per-page`],sort_order:t[`sort-order`],creator:t.creator};if(t.dryRun){u({command:`cf images v2 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.v2.list({account_id:a,...n})),{successLabel:`Loaded`})}},se={command:`v2`,describe:`V2 image listing with cursor-based pagination and authenticated direct upload URLs`,builder:e=>e.command(oe).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`images`,describe:`Store, resize, and deliver optimized images globally — variants, signing keys, and direct uploads`,builder:e=>e.command(te).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ce as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u,t as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";import{t as p}from"./cli-types-CRIDdDw3.mjs";import{n as m,t as ee}from"./raw-fetch-Dlccg0Tr.mjs";function h(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:p(h),handler:async t=>{if(t.dryRun){c({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}};function _(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:p(_),handler:async t=>{if(t.dryRun){c({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}/subnets`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.subnets.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}},y={command:`subnets`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.attackSurfaceReport.issueTypes.get({account_id:a})),{successLabel:`Loaded`})}},C={command:`issue-types`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:p(w),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.class({account_id:o,...r})),{successLabel:`Loaded`})}};function E(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({dismiss:t.dismiss}):a(t.body)});return}let r=await i(t),u=t.local?f:await n(r);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...e,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`});return}let d=o({dismiss:t.dismiss});s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...d,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`})}};function O(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:p(O),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.list({account_id:o,...r})),{successLabel:`Loaded`})}};function A(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:p(A),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.severity({account_id:o,...r})),{successLabel:`Loaded`})}};function M(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:p(M),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.type({account_id:o,...r})),{successLabel:`Loaded`})}},P={command:`issues`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`attack-surface-report`,describe:`Operations for attack-surface-report`,builder:e=>e.command(C).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:p(I),handler:async t=>{let r={start_end_params:t[`start-end-params`],ipv4:t.ipv4,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/dns`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.dns.list({account_id:o,...r})),{successLabel:`Loaded`})}},R={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:z,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain-history`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domainHistory.get({account_id:o,...r})),{successLabel:`Loaded`})}},V={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:H,handler:async t=>{let r={domain:t.domain,include_ranking:t[`include-ranking`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.bulks.get({account_id:o,...r})),{successLabel:`Loaded`})}},W={command:`bulks`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:G,handler:async t=>{let r={domain:t.domain,skip_dns:t[`skip-dns`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.get({account_id:o,...r})),{successLabel:`Loaded`})}},q={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:J,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)});s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...p,account_id:d})),{successLabel:`Created`})}};function X(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:X,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/data`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,m((await l(`Loading`,async()=>ee(`/accounts/${a}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/data`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:p(Z),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/download`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.downloads.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}},ne={command:`downloads`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:p(re),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.list({account_id:a})),{successLabel:`Loaded`})}};function se(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:se,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:e,account_id:d})),{successLabel:`Updated`});return}let p=o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:p,account_id:d})),{successLabel:`Updated`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).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 ue={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:le,handler:async r=>{if(r.dryRun){c({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):a(r.body)});return}let d=await i(r),p=r.local?f:await n(d);if(r.accountId=p,!await t({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
3
- `);return}if(r.body){let e=a(r.body);s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:e,account_id:p})),{successLabel:`Deleted`});return}let m=o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:m,account_id:p})),{successLabel:`Deleted`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Lists current access permissions for custom threat indicator feeds.`,builder:de,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.permissions.list({account_id:a})),{successLabel:`Loaded`})}},pe={command:`permissions`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`source`,{type:`string`,description:"The file to upload. Either a plain STIX2/CRDF body or a gzipped one (recognised by `0x1f 0x8b` magic bytes or a `.gz` filename suffix). "})}const he={command:`update <feed-id>`,describe:"Revises the raw data entries in a custom threat indicator feed. Accepts both plain and gzipped STIX2/CRDF bodies. Gzip is detected by RFC 1952 magic bytes (`0x1f 0x8b`) and/or a `.gz` filename suffix (case-insensitive) — either signal alone is sufficient to trigger the gzip path; if the body is not valid gzip, the upload fails fast. Customers are encouraged to gzip larger uploads — the api-gateway 500 MB body cap applies to the on-the-wire (compressed) size, so gzip lets a single upload carry several GiB of decompressed STIX.",builder:p(me),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds snapshots update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/snapshot`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,source:t.source}});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,t.file!==void 0||t.body!==void 0||t.source!==void 0){let e=new FormData;if(t.file){let n=d(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.source!==void 0&&e.append(`source`,String(u(t.source,`source`,`text`)??``)),s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e})),{successLabel:`Updated`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>a.intel.indicatorFeeds.snapshots.update({account_id:o,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ge={command:`snapshots`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The new description of the feed`}).option(`is-attributable`,{type:`boolean`,description:`The new is_attributable value of the feed`}).option(`is-downloadable`,{type:`boolean`,description:`The new is_downloadable value of the feed`}).option(`is-public`,{type:`boolean`,description:`The new is_public value of the feed`}).option(`name`,{type:`string`,description:`The new name of the feed`}).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 ve={command:`update <feed-id>`,describe:`Revises details for a specific custom threat indicator feed.`,builder:p(_e),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...e,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`});return}let p=o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...p,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ye={command:`indicator-feeds`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Y).command(te).command(ie).command(oe).command(ve).command(ne).command(pe).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Returns a list of available IP list categories (e.g., anonymizer, botnetcc, malware, tor, vpn, open_proxies). This endpoint provides metadata about which IP lists are available in the system.`,builder:be,handler:async t=>{if(t.dryRun){c({command:`cf intel ip-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip-lists`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.ipLists.get({account_id:a})),{successLabel:`Loaded`})}},xe={command:`ip-lists`,describe:`Curated IP lists used for threat detection and policy enforcement`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`ipv6`,{type:`string`,description:`Ipv6`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get`,describe:"Gets the geolocation, ASN, infrastructure type of the ASN, and any security threat categories of an IP address. **Must provide ip query parameters.** For example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`.",builder:Se,handler:async t=>{let r={ipv4:t.ipv4,ipv6:t.ipv6};if(t.dryRun){c({command:`cf intel ips get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.ips.get({account_id:o,...r})),{successLabel:`Loaded`})}},we={command:`ips`,describe:`IP address intelligence — geolocation, risk assessment, and hosting provider details`,builder:e=>e.command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`content-adds`,{type:`string`,array:!0,description:`Content category IDs to add.`}).option(`content-removes`,{type:`string`,array:!0,description:`Content category IDs to remove.`}).option(`indicator-type`,{type:`string`,description:`The indicator_type field`,choices:[`domain`,`ipv4`,`ipv6`,`url`]}).option(`ip`,{type:`string`,description:"Provide only if indicator_type is `ipv4` or `ipv6`."}).option(`security-adds`,{type:`string`,array:!0,description:`Security category IDs to add.`}).option(`security-removes`,{type:`string`,array:!0,description:`Security category IDs to remove.`}).option(`url`,{type:`string`,description:"Provide only if indicator_type is `domain` or `url`. Example if indicator_type is `domain`: `example.com`. Example if indicator_type is `url`: `https://example.com/news/`."}).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 Ee={command:`create`,describe:"Allows you to submit requests to change a domain’s category. Requests that include category `169` (New Domains) or category `177` (Newly Seen) in any of `content_adds`, `content_removes`, `security_adds`, or `security_removes` will be rejected with a `400 Bad Request`. These categories are automatically managed and fall off 30 days after they are applied.",builder:Te,handler:async t=>{if(t.dryRun){c({command:`cf intel miscategorizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/miscategorization`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)});s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...p,account_id:d})),{successLabel:`Created`})}},De={command:`miscategorizations`,describe:`Report and track domain miscategorization corrections`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get`,describe:`Retrieves WHOIS registration data for a domain, including registrant and nameserver information.`,builder:Oe,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel whois get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/whois`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.whois.get({account_id:o,...r})),{successLabel:`Loaded`})}},Ae={command:`whois`,describe:`WHOIS registration data for domains including registrant, registrar, and nameservers`,builder:e=>e.command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},je={command:`intel`,describe:`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,builder:e=>e.command(b).command(F).command(R).command(V).command(q).command(ye).command(xe).command(we).command(De).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{je as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{D as e,S as t,T as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or SSL certificate and intermediate(s).`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`,default:24008}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).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([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].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 --tunnel-* flag is set`)}return!0})}const d={command:`create`,describe:`Creates a Keyless SSL configuration that allows SSL/TLS termination without exposing private keys to Cloudflare. Keys remain on your infrastructure.`,builder:u,handler:async n=>{if(n.dryRun){s({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({bundle_method:l(n[`bundle-method`],`bundle-method`,`text`),certificate:l(n.certificate,`certificate`,`text`),host:l(n.host,`host`,`text`),name:l(n.name,`name`,`text`),port:n.port,tunnel:{private_ip:l(n[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(n[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(n.certificate===void 0&&(n.certificate=await e(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),n.host===void 0&&(n.host=await e(`host`,`The keyless SSL name.`)),n.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=a({bundle_method:l(n[`bundle-method`],`bundle-method`,`text`),certificate:l(n.certificate,`certificate`,`text`),host:l(n.host,`host`,`text`),name:l(n.name,`name`,`text`),port:n.port,tunnel:{private_ip:l(n[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(n[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});o(await c(`Creating`,async()=>u.keylessCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <keyless-certificate-id>`,describe:`Removes a Keyless SSL configuration. SSL connections will no longer use the keyless server for cryptographic operations.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.keylessCertificates.delete({zone_id:a,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether or not the Keyless SSL is on or off.`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).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([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].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 --tunnel-* flag is set`)}return!0})}const h={command:`edit <keyless-certificate-id>`,describe:`This will update attributes of a Keyless SSL. Consists of one or more of the following: host,name,port.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({enabled:e.enabled,host:l(e.host,`host`,`text`),name:l(e.name,`name`,`text`),port:e.port,tunnel:{private_ip:l(e[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(e[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):i(e.body)});return}let n=await r(e),u=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.keylessCertificates.edit({...t,zone_id:u,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Updated`});return}let d=a({enabled:e.enabled,host:l(e.host,`host`,`text`),name:l(e.name,`name`,`text`),port:e.port,tunnel:{private_ip:l(e[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(e[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});o(await c(`Updating`,async()=>n.keylessCertificates.edit({...d,zone_id:u,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <keyless-certificate-id>`,describe:`Get details for one Keyless SSL configuration.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.keylessCertificates.get({zone_id:i,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List all Keyless SSL configurations for a given zone.`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.keylessCertificates.list({zone_id:i})),{successLabel:`Loaded`})}},b={command:`keyless-certificates`,describe:`Use your own SSL certificates without exposing private keys — keys stay on your infrastructure`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{S as e,T as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";function l(e){return e.option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const u={command:`create`,describe:`Updates the current status of Leaked Credential Checks.`,builder:l,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({enabled:t.enabled}):r(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=r(t.body);a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:e,zone_id:l})),{successLabel:`Created`});return}let u=i({enabled:t.enabled});a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:u,zone_id:l})),{successLabel:`Created`})}};function d(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const f={command:`create`,describe:`Create user-defined detection pattern for Leaked Credential Checks.`,builder:d,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function p(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <detection-id>`,describe:`Remove user-defined detection pattern for Leaked Credential Checks.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/leaked-credential-checks/detections/${r[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(r[`detection-id`]))}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"detection-id":String(r[`detection-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await e({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.leakedCredentialChecks.detections.delete({zone_id:c,detection_id:r[`detection-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <detection-id>`,describe:`Get user-defined detection pattern for Leaked Credential Checks.`,builder:h,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.detections.get({zone_id:i,detection_id:t[`detection-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List user-defined detection patterns for Leaked Credential Checks.`,builder:_,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.detections.list({zone_id:i})),{successLabel:`Loaded`})}};function y(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const b={command:`update <detection-id>`,describe:`Update user-defined detection pattern for Leaked Credential Checks.`,builder:y,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`})}},x={command:`detections`,describe:`Custom detection rules that define which request fields contain usernames and passwords to check`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Retrieves the current status of Leaked Credential Checks.`,builder:S,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.get({zone_id:i})),{successLabel:`Loaded`})}},w={command:`leaked-credential-checks`,describe:`Detect compromised credentials in login requests by checking against known breach databases`,builder:e=>e.command(u).command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};