cf 0.7.0 → 0.8.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 (174) hide show
  1. package/dist/_meta/agent-context.json +1 -1
  2. package/dist/_meta/commands.json +9 -112
  3. package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
  4. package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
  5. package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
  6. package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
  7. package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
  8. package/dist/ai-B4La9Oqk.mjs +8 -0
  9. package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
  10. package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
  11. package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
  12. package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
  13. package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
  14. package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
  15. package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
  16. package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
  17. package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
  18. package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
  19. package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
  20. package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
  21. package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
  22. package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
  23. package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
  24. package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
  25. package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
  26. package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
  27. package/dist/build-C1FOoThn.mjs +70 -0
  28. package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
  29. package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
  30. package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
  31. package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
  32. package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
  33. package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
  34. package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
  35. package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
  36. package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
  37. package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
  38. package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
  39. package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
  40. package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
  41. package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
  42. package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
  43. package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
  44. package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
  45. package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
  46. package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
  47. package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
  48. package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
  49. package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
  50. package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
  51. package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
  52. package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
  53. package/dist/deploy-D0_KIUpW.mjs +2 -0
  54. package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
  55. package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
  56. package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
  57. package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
  58. package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
  59. package/dist/dist-CnaLMpVH.mjs +18 -0
  60. package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
  61. package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
  62. package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
  63. package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
  64. package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
  65. package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
  66. package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
  67. package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
  68. package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
  69. package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
  70. package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
  71. package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
  72. package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
  73. package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
  74. package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
  75. package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
  76. package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
  77. package/dist/index.mjs +1 -1
  78. package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
  79. package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
  80. package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
  81. package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
  82. package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
  83. package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
  84. package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
  85. package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
  86. package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
  87. package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
  88. package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
  89. package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
  90. package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
  91. package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
  92. package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
  93. package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
  94. package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
  95. package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
  96. package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
  97. package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
  98. package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
  99. package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
  100. package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
  101. package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
  102. package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
  103. package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
  104. package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
  105. package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
  106. package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
  107. package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
  108. package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
  109. package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
  110. package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
  111. package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
  112. package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
  113. package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
  114. package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
  115. package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
  116. package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
  117. package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
  118. package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
  119. package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
  120. package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
  121. package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
  122. package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
  123. package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
  124. package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
  125. package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
  126. package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
  127. package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
  128. package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
  129. package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
  130. package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
  131. package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
  132. package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
  133. package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
  134. package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
  135. package/dist/shared-D0xvDsDl.mjs +2 -0
  136. package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
  137. package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
  138. package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
  139. package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
  140. package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
  141. package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
  142. package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
  143. package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
  144. package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
  145. package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
  146. package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
  147. package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
  148. package/dist/triggers-CYdZhJYr.mjs +2 -0
  149. package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
  150. package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
  151. package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
  152. package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
  153. package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
  154. package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
  155. package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
  156. package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
  157. package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
  158. package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
  159. package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
  160. package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
  161. package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
  162. package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
  163. package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
  164. package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
  165. package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
  166. package/package.json +5 -4
  167. package/dist/ai-BzJg0RIX.mjs +0 -3
  168. package/dist/build-CWuStmDi.mjs +0 -2
  169. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
  170. package/dist/deploy-CVvkZFjR.mjs +0 -2
  171. package/dist/lib-Og5sB51C.mjs +0 -68
  172. package/dist/shared-Bod3-Exx.mjs +0 -990
  173. /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
  174. /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.positional(`integration`,{type:`string`,description:`The database integration to authorize against.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`create-database-signature <integration>`,describe:`Returns a short-lived signed authorization for creating a database that is billed through Cloudflare. The caller passes these values to the integration partner's own CLI, which verifies the signature before creating the database. Requires the account to be entitled to Cloudflare-billed databases for the integration.`,builder:p(m),handler:async s=>{if(s.dryRun){i({command:`cf hyperdrive create-database-signature`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/hyperdrive/integrationsOperations/${s.integration==null?`<integration>`:encodeURIComponent(String(s.integration))}/createDatabaseSignature`,pathParams:{integration:String(s.integration??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.hyperdrive.createDatabaseSignature({account_id:l,integration:s.integration})),{successLabel:`Created`})}};function g(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.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DcfYBioA.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.positional(`integration`,{type:`string`,description:`The database integration to authorize against.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`create-database-signature <integration>`,describe:`Returns a short-lived signed authorization for creating a database that is billed through Cloudflare. The caller passes these values to the integration partner's own CLI, which verifies the signature before creating the database. Requires the account to be entitled to Cloudflare-billed databases for the integration.`,builder:p(m),handler:async s=>{if(s.dryRun){i({command:`cf hyperdrive create-database-signature`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/hyperdrive/integrationsOperations/${s.integration==null?`<integration>`:encodeURIComponent(String(s.integration))}/createDatabaseSignature`,pathParams:{integration:String(s.integration??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.hyperdrive.createDatabaseSignature({account_id:l,integration:s.integration})),{successLabel:`Created`})}};function g(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
3
 
4
4
  Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
5
5
  If not specified, defaults to 20 for free tier and 60 for paid tier.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";import{t as f}from"./cli-types-CFw6Xygp.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 s=>{if(s.dryRun){i({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/permission_groups/${s[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(s[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(s[`permission-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.permissionGroups.get({account_id:l,permission_group_id:s[`permission-group-id`]})),{successLabel:`Loaded`})}};function ee(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 h={command:`list`,describe:`List all the permissions groups for an account.`,builder:ee,handler:async s=>{let c={id:s.id,name:s.name,label:s.label,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/permission_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.iam.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},g={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(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 v={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:_,handler:async d=>{if(d.dryRun){i({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the resource group`));let m=c({name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function y(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 b={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DcfYBioA.mjs";import{t as f}from"./cli-types-CFw6Xygp.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 s=>{if(s.dryRun){i({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/permission_groups/${s[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(s[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(s[`permission-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.permissionGroups.get({account_id:l,permission_group_id:s[`permission-group-id`]})),{successLabel:`Loaded`})}};function ee(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 h={command:`list`,describe:`List all the permissions groups for an account.`,builder:ee,handler:async s=>{let c={id:s.id,name:s.name,label:s.label,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/permission_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.iam.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},g={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(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 v={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:_,handler:async d=>{if(d.dryRun){i({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the resource group`));let m=c({name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function y(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 b={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.iam.resourceGroups.delete({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Deleted`})}};function x(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 S={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.resourceGroups.get({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Loaded`})}};function C(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 w={command:`list`,describe:`List all the resource groups for an account.`,builder:C,handler:async s=>{let c={id:s.id,name:s.name};if(s.dryRun){i({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.iam.resourceGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function T(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 E={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:T,handler:async u=>{if(u.dryRun){i({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/resource_groups/${u[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(u[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(u[`resource-group-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`)}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Updating`,async()=>d.iam.resourceGroups.update({...e,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`)});r(await a(`Updating`,async()=>d.iam.resourceGroups.update({...p,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`})}},D={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={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:O,handler:async s=>{if(s.dryRun){i({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.iam.sso.beginVerification({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Created`})}};function A(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 j={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:A,handler:async d=>{if(d.dryRun){i({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}d[`email-domain`]===void 0&&(d[`email-domain`]=await u(`email-domain`,`Email domain of the new SSO connector`));let m=c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]});r(await a(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function M(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 N={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:M,handler:async s=>{if(s.dryRun){i({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>c.iam.sso.delete({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Deleted`})}};function P(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 F={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:P,handler:async s=>{if(s.dryRun){i({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.sso.get({account_id:l,sso_connector_id:s[`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 s=>{if(s.dryRun){i({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.sso.list({account_id:l})),{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 te={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async l=>{if(l.dryRun){i({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/sso_connectors/${l[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(l[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(l[`sso-connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]}):s(l.body)});return}let u=await n(l),d=l.local?o:await t();if(l.accountId=d,l.body){let e=s(l.body);r(await a(`Updating`,async()=>u.iam.sso.update({...e,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]});r(await a(`Updating`,async()=>u.iam.sso.update({...f,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`})}},z={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(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 V={command:`create`,describe:`Create a new user group under the specified account.`,builder:B,handler:async d=>{if(d.dryRun){i({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the User group.`));let m=c({name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function H(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 U={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:H,handler:async s=>{if(s.dryRun){i({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
5
5
  `);return}r(await a(`Deleting`,async()=>c.iam.userGroups.delete({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Deleted`})}};function W(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 G={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:W,handler:async s=>{if(s.dryRun){i({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.iam.userGroups.get({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Loaded`})}};function K(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 q={command:`list`,describe:`List all the user groups for an account.`,builder:f(K),handler:async s=>{let c={id:s.id,name:s.name,fuzzyName:s[`fuzzy-name`],page:s.page,per_page:s[`per-page`],direction:s.direction};if(s.dryRun){i({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.iam.userGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(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 Y={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:J,handler:async c=>{if(c.dryRun){i({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.iam.userGroups.members.create({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function X(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 Z={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:X,handler:async s=>{if(s.dryRun){i({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";import{t as h}from"./cli-types-CFw6Xygp.mjs";import{n as ee,t as te}from"./raw-fetch-DgezeshQ.mjs";function g(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 _={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:g,handler:async c=>{if(c.dryRun){a({command:`cf images create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file,creator:c.creator,id:c.id,metadata:c.metadata,"require-signed-urls":c[`require-signed-urls`],url:c.url}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.creator!==void 0||c.id!==void 0||c.metadata!==void 0||c[`require-signed-urls`]!==void 0||c.url!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);if(c.creator!==void 0&&e.append(`creator`,String(u(c.creator,`creator`,`text`)??``)),c.id!==void 0&&e.append(`id`,String(u(c.id,`id`,`text`)??``)),c.metadata!==void 0){let t=typeof c.metadata==`string`?u(c.metadata,`metadata`,`text`):c.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}c[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(c[`require-signed-urls`])),c.url!==void 0&&e.append(`url`,String(u(c.url,`url`,`text`)??``)),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v1`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.images.create({account_id:f})),{successLabel:`Created`})}};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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={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:v,handler:async n=>{if(n.dryRun){a({command:`cf images delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/${n[`image-id`]==null?`<image-id>`:encodeURIComponent(String(n[`image-id`]))}`,pathParams:{"image-id":String(n[`image-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DcfYBioA.mjs";import{t as h}from"./cli-types-CFw6Xygp.mjs";import{n as ee,t as te}from"./raw-fetch-CeW1mW_u.mjs";function g(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 _={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:g,handler:async c=>{if(c.dryRun){a({command:`cf images create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file,creator:c.creator,id:c.id,metadata:c.metadata,"require-signed-urls":c[`require-signed-urls`],url:c.url}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.creator!==void 0||c.id!==void 0||c.metadata!==void 0||c[`require-signed-urls`]!==void 0||c.url!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);if(c.creator!==void 0&&e.append(`creator`,String(u(c.creator,`creator`,`text`)??``)),c.id!==void 0&&e.append(`id`,String(u(c.id,`id`,`text`)??``)),c.metadata!==void 0){let t=typeof c.metadata==`string`?u(c.metadata,`metadata`,`text`):c.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}c[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(c[`require-signed-urls`])),c.url!==void 0&&e.append(`url`,String(u(c.url,`url`,`text`)??``)),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v1`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.images.create({account_id:f})),{successLabel:`Created`})}};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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={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:v,handler:async n=>{if(n.dryRun){a({command:`cf images delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/${n[`image-id`]==null?`<image-id>`:encodeURIComponent(String(n[`image-id`]))}`,pathParams:{"image-id":String(n[`image-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.images.delete({account_id:l,image_id:n[`image-id`]})),{successLabel:`Deleted`})}};function b(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 x={command:`direct-upload`,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:b,handler:async c=>{if(c.dryRun){a({command:`cf images direct-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file,creator:c.creator,expiry:c.expiry,id:c.id,metadata:c.metadata,"require-signed-urls":c[`require-signed-urls`]}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.creator!==void 0||c.expiry!==void 0||c.id!==void 0||c.metadata!==void 0||c[`require-signed-urls`]!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);if(c.creator!==void 0&&e.append(`creator`,String(u(c.creator,`creator`,`text`)??``)),c.expiry!==void 0&&e.append(`expiry`,String(u(c.expiry,`expiry`,`text`)??``)),c.id!==void 0&&e.append(`id`,String(u(c.id,`id`,`text`)??``)),c.metadata!==void 0){let t=typeof c.metadata==`string`?u(c.metadata,`metadata`,`text`):c.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}c[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(c[`require-signed-urls`])),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.images.directUpload({account_id:f})),{successLabel:`Created`})}};function S(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 C={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:S,handler:async n=>{if(n.dryRun){a({command:`cf images edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/${n[`image-id`]==null?`<image-id>`:encodeURIComponent(String(n[`image-id`]))}`,pathParams:{"image-id":String(n[`image-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({creator:u(n.creator,`creator`,`text`),requireSignedURLs:n[`require-signed-urls`]}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.images.edit({...e,account_id:f,image_id:n[`image-id`]})),{successLabel:`Updated`});return}let p=l({creator:u(n.creator,`creator`,`text`),requireSignedURLs:n[`require-signed-urls`]});i(await o(`Updating`,async()=>d.images.edit({...p,account_id:f,image_id:n[`image-id`]})),{successLabel:`Updated`})}};function w(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 T={command:`get-blob <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:w,handler:async n=>{if(n.dryRun){a({command:`cf images get-blob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/${n[`image-id`]==null?`<image-id>`:encodeURIComponent(String(n[`image-id`]))}/blob`,pathParams:{"image-id":String(n[`image-id`]??``)},bodyKind:`none`});return}await r(n);let i=n.local?s:await t();n.accountId=i;let c=await o(`Loading`,async()=>te(`/accounts/${i}/images/v1/${encodeURIComponent(String(n[`image-id`]))}/blob`,{method:`GET`,localEndpoint:n.local?n.localEndpoint:void 0}));ee(n.text===!0?c.toString(`utf-8`):c)}};function E(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 D={command:`get <image-id>`,describe:`Fetch details for a CF Images image.`,builder:E,handler:async n=>{if(n.dryRun){a({command:`cf images get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/${n[`image-id`]==null?`<image-id>`:encodeURIComponent(String(n[`image-id`]))}`,pathParams:{"image-id":String(n[`image-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.images.get({account_id:l,image_id:n[`image-id`]})),{successLabel:`Loaded`})}};function O(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 k={command:`create <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:O,handler:async n=>{if(n.dryRun){a({command:`cf images keys create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/keys/${n[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(n[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(n[`signing-key-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.images.keys.create({account_id:l,signing_key_name:n[`signing-key-name`]})),{successLabel:`Updated`})}};function A(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 j={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:A,handler:async n=>{if(n.dryRun){a({command:`cf images keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/keys/${n[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(n[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(n[`signing-key-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force,message:`This operation will delete this signing key. This will invalidate any URLs that are signed with this key.`})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.images.keys.delete({account_id:l,signing_key_name:n[`signing-key-name`]})),{successLabel:`Deleted`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List your CF Images signing keys.`,builder:M,handler:async n=>{if(n.dryRun){a({command:`cf images keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.images.keys.list({account_id:l})),{successLabel:`Loaded`})}},P={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(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 I={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(F),handler:async n=>{let c={continuation_token:n[`continuation-token`],per_page:n[`per-page`],sort_order:n[`sort-order`],creator:n.creator};if(n.dryRun){a({command:`cf images list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.images.list({account_id:u,...c})),{successLabel:`Loaded`})}};function L(e){return e.option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).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:`create`,describe:`Create a new migration from an existing source. The migration will import objects from the source bucket into Cloudflare Images.`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({conflictBehaviour:u(n[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:n[`excluded-content-types`],pathPrefix:u(n[`path-prefix`],`path-prefix`,`text`),rootDirectory:u(n[`root-directory`],`root-directory`,`text`),sourceId:u(n[`source-id`],`source-id`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.images.sourcingKit.migrations.create({...e,account_id:f})),{successLabel:`Created`});return}n[`source-id`]===void 0&&(n[`source-id`]=await p(`source-id`,`The identifier of the source to migrate from.`));let m=l({conflictBehaviour:u(n[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:n[`excluded-content-types`],pathPrefix:u(n[`path-prefix`],`path-prefix`,`text`),rootDirectory:u(n[`root-directory`],`root-directory`,`text`),sourceId:u(n[`source-id`],`source-id`,`text`)});i(await o(`Creating`,async()=>d.images.sourcingKit.migrations.create({...m,account_id:f})),{successLabel:`Created`})}};function z(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource 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 B={command:`delete <migration-id>`,describe:`Delete an existing migration. Only completed, errored, or aborted migrations can be deleted.`,builder:z,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}`,pathParams:{"migration-id":String(n[`migration-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>c.images.sourcingKit.migrations.delete({account_id:l,migration_id:n[`migration-id`]})),{successLabel:`Deleted`})}};function V(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <migration-id>`,describe:`Fetch details for a single migration.`,builder:V,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}`,pathParams:{"migration-id":String(n[`migration-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.images.sourcingKit.migrations.get({account_id:l,migration_id:n[`migration-id`]})),{successLabel:`Loaded`})}};function U(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`abort <migration-id>`,describe:`Abort a running migration. Objects already imported will not be removed.`,builder:U,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations lifecycle abort`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}/lifecycle/abort`,pathParams:{"migration-id":String(n[`migration-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.images.sourcingKit.migrations.lifecycle.abort({account_id:l,migration_id:n[`migration-id`]})),{successLabel:`Updated`})}};function G(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <migration-id>`,describe:`Get the current progress of a migration including counts of scanned, imported, skipped, and errored objects.`,builder:G,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}/lifecycle`,pathParams:{"migration-id":String(n[`migration-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.images.sourcingKit.migrations.lifecycle.get({account_id:l,migration_id:n[`migration-id`]})),{successLabel:`Loaded`})}};function q(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`logs <migration-id>`,describe:`List log entries for a specific migration.`,builder:q,handler:async n=>{let c={offset:n.offset,limit:n.limit};if(n.dryRun){a({command:`cf images sourcing-kit migrations lifecycle logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}/logs`,pathParams:{"migration-id":String(n[`migration-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.images.sourcingKit.migrations.lifecycle.logs({account_id:u,migration_id:n[`migration-id`],...c})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`start <migration-id>`,describe:`Start a pending migration. The migration will begin importing objects from the configured source.`,builder:Y,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit migrations lifecycle start`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations/${n[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(n[`migration-id`]))}/lifecycle/start`,pathParams:{"migration-id":String(n[`migration-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.images.sourcingKit.migrations.lifecycle.start({account_id:l,migration_id:n[`migration-id`]})),{successLabel:`Updated`})}},Z={command:`lifecycle`,describe:`Operations for sourcing-kit.migrations.lifecycle`,builder:e=>e.command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`List all migrations for the account.`,builder:Q,handler:async n=>{let c={offset:n.offset,limit:n.limit};if(n.dryRun){a({command:`cf images sourcing-kit migrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.images.sourcingKit.migrations.list({account_id:u,...c})),{successLabel:`Loaded`})}},re={command:`migrations`,describe:`Operations for sourcing-kit.migrations`,builder:e=>e.command(R).command(B).command(H).command(ne).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`connectivity <source-id>`,describe:`Check the current connectivity status of an existing migration source.`,builder:ie,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit sources connectivity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/sources/${n[`source-id`]==null?`<source-id>`:encodeURIComponent(String(n[`source-id`]))}/connectivity`,pathParams:{"source-id":String(n[`source-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.images.sourcingKit.sources.connectivity({account_id:l,source_id:n[`source-id`]})),{successLabel:`Loaded`})}};function oe(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`create`,describe:`Create a new migration source by providing storage credentials. The service will verify connectivity to the bucket before accepting the source.`,builder:oe,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({account:u(n.account,`account`,`text`),bucket:u(n.bucket,`bucket`,`text`),name:u(n.name,`name`,`text`),vendor:u(n.vendor,`vendor`,`text`)}):c(n.body)});return}let d=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.images.sourcingKit.sources.create({...e,account_id:m})),{successLabel:`Created`});return}n.bucket===void 0&&(n.bucket=await p(`bucket`,`The name of the storage bucket.`)),n.name===void 0&&(n.name=await p(`name`,`A human-readable name for the source.`)),n.vendor===void 0&&(n.vendor=await f(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let h=l({account:u(n.account,`account`,`text`),bucket:u(n.bucket,`bucket`,`text`),name:u(n.name,`name`,`text`),vendor:u(n.vendor,`vendor`,`text`)});i(await o(`Creating`,async()=>d.images.sourcingKit.sources.create({...h,account_id:m})),{successLabel:`Created`})}};function ce(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const le={command:`delete <source-id>`,describe:`Delete an existing migration source. Sources with active migrations cannot be deleted.`,builder:ce,handler:async n=>{if(n.dryRun){a({command:`cf images sourcing-kit sources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/images/v2/sourcingkit/sources/${n[`source-id`]==null?`<source-id>`:encodeURIComponent(String(n[`source-id`]))}`,pathParams:{"source-id":String(n[`source-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force})){process.stderr.write(`Aborted.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,n as t,r as n,t as r}from"./src-By-zTCHz.mjs";export{r as CliExit,t as buildCli,n as main,e as runMain};
2
+ import{i as e,n as t,r as n,t as r}from"./src-Bn0FyQIp.mjs";export{r as CliExit,t as buildCli,n as main,e as runMain};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{t as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";import{n as m,t as ee}from"./raw-fetch-DgezeshQ.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 n=>{if(n.dryRun){a({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/asn/${n.asn==null?`<asn>`:encodeURIComponent(String(n.asn))}`,pathParams:{asn:String(n.asn??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.asn.get({account_id:l,asn:n.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 n=>{if(n.dryRun){a({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/asn/${n.asn==null?`<asn>`:encodeURIComponent(String(n.asn))}/subnets`,pathParams:{asn:String(n.asn??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.asn.subnets.get({account_id:l,asn:n.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 n=>{if(n.dryRun){a({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.class({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/${n[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(n[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(n[`issue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dismiss:n.dismiss}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Updating`,async()=>u.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:n[`issue-id`]})),{successLabel:`Updated`});return}let f=l({dismiss:n.dismiss});i(await o(`Updating`,async()=>u.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:n[`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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject,page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.list({account_id:u,...c})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.severity({account_id:u,...c})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.type({account_id:u,...c})),{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 n=>{let c={start_end_params:n[`start-end-params`],ipv4:n.ipv4,page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/dns`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.dns.list({account_id:u,...c})),{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 n=>{let c={domain:n.domain};if(n.dryRun){a({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domainHistory.get({account_id:u,...c})),{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 n=>{let c={domain:n.domain,include_ranking:n[`include-ranking`],skip_ranking:n[`skip-ranking`]};if(n.dryRun){a({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domains.bulks.get({account_id:u,...c})),{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 n=>{let c={domain:n.domain,skip_dns:n[`skip-dns`],skip_ranking:n[`skip-ranking`]};if(n.dryRun){a({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domains.get({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.intel.indicatorFeeds.create({...p,account_id:f})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}/data`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}await r(n);let i=n.local?s:await t();n.accountId=i,m((await o(`Loading`,async()=>ee(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(n[`feed-id`]))}/data`,{method:`GET`,localEndpoint:n.local?n.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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}/download`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:n[`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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.get({account_id:l,feed_id:n[`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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.list({account_id:l})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]});i(await o(`Updating`,async()=>d.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,!await f({force:!!n.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{t as f}from"./prompt-DcfYBioA.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";import{n as m,t as ee}from"./raw-fetch-CeW1mW_u.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 n=>{if(n.dryRun){a({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/asn/${n.asn==null?`<asn>`:encodeURIComponent(String(n.asn))}`,pathParams:{asn:String(n.asn??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.asn.get({account_id:l,asn:n.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 n=>{if(n.dryRun){a({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/asn/${n.asn==null?`<asn>`:encodeURIComponent(String(n.asn))}/subnets`,pathParams:{asn:String(n.asn??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.asn.subnets.get({account_id:l,asn:n.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 n=>{if(n.dryRun){a({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.class({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/${n[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(n[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(n[`issue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dismiss:n.dismiss}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Updating`,async()=>u.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:n[`issue-id`]})),{successLabel:`Updated`});return}let f=l({dismiss:n.dismiss});i(await o(`Updating`,async()=>u.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:n[`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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject,page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.list({account_id:u,...c})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.severity({account_id:u,...c})),{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 n=>{let c={dismissed:n.dismissed,issue_class:n[`issue-class`],issue_type:n[`issue-type`],product:n.product,severity:n.severity,subject:n.subject};if(n.dryRun){a({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.attackSurfaceReport.issues.type({account_id:u,...c})),{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 n=>{let c={start_end_params:n[`start-end-params`],ipv4:n.ipv4,page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/dns`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.dns.list({account_id:u,...c})),{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 n=>{let c={domain:n.domain};if(n.dryRun){a({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domainHistory.get({account_id:u,...c})),{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 n=>{let c={domain:n.domain,include_ranking:n[`include-ranking`],skip_ranking:n[`skip-ranking`]};if(n.dryRun){a({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domains.bulks.get({account_id:u,...c})),{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 n=>{let c={domain:n.domain,skip_dns:n[`skip-dns`],skip_ranking:n[`skip-ranking`]};if(n.dryRun){a({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/domain`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.domains.get({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.intel.indicatorFeeds.create({...p,account_id:f})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}/data`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}await r(n);let i=n.local?s:await t();n.accountId=i,m((await o(`Loading`,async()=>ee(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(n[`feed-id`]))}/data`,{method:`GET`,localEndpoint:n.local?n.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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}/download`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:n[`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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.get({account_id:l,feed_id:n[`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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.list({account_id:l})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]});i(await o(`Updating`,async()=>d.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,!await f({force:!!n.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
3
3
  `);return}if(n.body){let e=c(n.body);i(await o(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:e,account_id:p})),{successLabel:`Deleted`});return}let m=l({account_tag:u(n[`account-tag`],`account-tag`,`text`),feed_id:n[`feed-id`]});i(await o(`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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.indicatorFeeds.permissions.list({account_id:l})),{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(`cf-async-upload`,{type:`string`,description:"Set to the literal value `1` to enqueue the upload and receive a\n`202` response with a polling URL. Any other value uses the legacy\nsynchronous response."}).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:me,handler:async c=>{let l={};if(c[`cf-async-upload`]!==void 0&&(l[`Cf-Async-Upload`]=String(c[`cf-async-upload`])),c.dryRun){a({command:`cf intel indicator-feeds snapshots update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${c[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(c[`feed-id`]))}/snapshot`,pathParams:{"feed-id":String(c[`feed-id`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,source:c.source}});return}let f=await r(c),p=c.local?s:await t();if(c.accountId=p,c.file!==void 0||c.body!==void 0||c.source!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);c.source!==void 0&&e.append(`source`,String(u(c.source,`source`,`text`)??``)),i(await o(`Updating`,async()=>n(f,`PUT`,`/accounts/${p}/intel/indicator-feeds/${encodeURIComponent(String(c[`feed-id`]))}/snapshot`,{body:e,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Updating`,async()=>n(f,`PUT`,`/accounts/${p}/intel/indicator-feeds/${encodeURIComponent(String(c[`feed-id`]))}/snapshot`,{body:e,headers:{"Content-Type":`multipart/form-data`,...l}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},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 n=>{if(n.dryRun){a({command:`cf intel indicator-feeds update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/indicator-feeds/${n[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(n[`feed-id`]))}`,pathParams:{"feed-id":String(n[`feed-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({description:u(n.description,`description`,`text`),is_attributable:n[`is-attributable`],is_downloadable:n[`is-downloadable`],is_public:n[`is-public`],name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.intel.indicatorFeeds.update({...e,account_id:f,feed_id:n[`feed-id`]})),{successLabel:`Updated`});return}let p=l({description:u(n.description,`description`,`text`),is_attributable:n[`is-attributable`],is_downloadable:n[`is-downloadable`],is_public:n[`is-public`],name:u(n.name,`name`,`text`)});i(await o(`Updating`,async()=>d.intel.indicatorFeeds.update({...p,account_id:f,feed_id:n[`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 n=>{if(n.dryRun){a({command:`cf intel ip-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/ip-lists`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.intel.ipLists.get({account_id:l})),{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 n=>{let c={ipv4:n.ipv4,ipv6:n.ipv6};if(n.dryRun){a({command:`cf intel ips get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/ip`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.ips.get({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf intel miscategorizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/miscategorization`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({content_adds:n[`content-adds`],content_removes:n[`content-removes`],indicator_type:u(n[`indicator-type`],`indicator-type`,`text`),ip:u(n.ip,`ip`,`text`),security_adds:n[`security-adds`],security_removes:n[`security-removes`],url:u(n.url,`url`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.intel.miscategorizations.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({content_adds:n[`content-adds`],content_removes:n[`content-removes`],indicator_type:u(n[`indicator-type`],`indicator-type`,`text`),ip:u(n.ip,`ip`,`text`),security_adds:n[`security-adds`],security_removes:n[`security-removes`],url:u(n.url,`url`,`text`)});i(await o(`Creating`,async()=>d.intel.miscategorizations.create({...p,account_id:f})),{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 n=>{let c={domain:n.domain};if(n.dryRun){a({command:`cf intel whois get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/intel/whois`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.intel.whois.get({account_id:u,...c})),{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,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./auth-CZ0E51rF.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-O88q63Bk.mjs";function i(e){return e.option(`networks`,{type:`string`,description:"Specified as `jdcloud` to list IPs used by JD Cloud data centers."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.`,builder:i,handler:async i=>{let a={networks:i.networks};if(i.dryRun){n({command:`cf ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/ips`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.ips.list(a)),{successLabel:`Loaded`})}},o={command:`ips`,describe:`List Cloudflare's IP ranges used for proxying traffic — useful for firewall allowlisting`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
2
+ import{n as e}from"./auth-B1CY5zpC.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-BLQ2xXwD.mjs";function i(e){return e.option(`networks`,{type:`string`,description:"Specified as `jdcloud` to list IPs used by JD Cloud data centers."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.`,builder:i,handler:async i=>{let a={networks:i.networks};if(i.dryRun){n({command:`cf ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/ips`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.ips.list(a)),{successLabel:`Loaded`})}},o={command:`ips`,describe:`List Cloudflare's IP ranges used for proxying traffic — useful for firewall allowlisting`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{r as c,t as l}from"./prompt-DTAWiEm2.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 l=>{if(l.dryRun){r({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.certificate===void 0&&(l.certificate=await c(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),l.host===void 0&&(l.host=await c(`host`,`The keyless SSL name.`)),l.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`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 a=>{if(a.dryRun){r({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
2
+ import{D as e}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{r as c,t as l}from"./prompt-DcfYBioA.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 l=>{if(l.dryRun){r({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.certificate===void 0&&(l.certificate=await c(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),l.host===void 0&&(l.host=await c(`host`,`The keyless SSL name.`)),l.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`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 a=>{if(a.dryRun){r({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.keylessCertificates.delete({zone_id:s,keyless_certificate_id:a[`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 c=>{if(c.dryRun){r({command:`cf keyless-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/keyless_certificates/${c[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(c[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(c[`keyless-certificate-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.keylessCertificates.edit({...e,zone_id:u,keyless_certificate_id:c[`keyless-certificate-id`]})),{successLabel:`Updated`});return}let d=o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`Updating`,async()=>l.keylessCertificates.edit({...d,zone_id:u,keyless_certificate_id:c[`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 a=>{if(a.dryRun){r({command:`cf keyless-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.get({zone_id:s,keyless_certificate_id:a[`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 a=>{if(a.dryRun){r({command:`cf keyless-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.list({zone_id:s})),{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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";import{n as h,t as g}from"./raw-fetch-DgezeshQ.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async l=>{if(l.dryRun){a({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await r(l),d=l.local?s:await t();if(l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DcfYBioA.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";import{n as h,t as g}from"./raw-fetch-CeW1mW_u.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async l=>{if(l.dryRun){a({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await r(l),d=l.local?s:await t();if(l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
3
3
  `);return}if(l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),r=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);r=await o(`Deleting: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>n(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:a}))}i(r,{successLabel:`Deleted`});return}i(await o(`Deleting`,async()=>n(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:e})),{successLabel:`Deleted`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`keys`,{type:`string`,array:!0,description:`Array of keys to retrieve (maximum of 100).`}).option(`type`,{type:`string`,description:`Whether to parse JSON values in the response.`,choices:[`text`,`json`],default:`text`}).option(`with-metadata`,{type:`boolean`,description:`Whether to include metadata in the response.`,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 b={command:`get <namespace-id>`,describe:"Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.",builder:y,handler:async n=>{if(n.dryRun){a({command:`cf kv bulk get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}/bulk/get`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({keys:n.keys,type:u(n.type,`type`,`text`),withMetadata:n[`with-metadata`]}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.kv.bulk.get({...e,account_id:f,namespace_id:n[`namespace-id`]})),{successLabel:`Created`});return}if(n.keys===void 0)throw Error(`--keys is required (or pass --body with this field set).`);let p=l({keys:n.keys,type:u(n.type,`type`,`text`),withMetadata:n[`with-metadata`]});i(await o(`Creating`,async()=>d.kv.bulk.get({...p,account_id:f,namespace_id:n[`namespace-id`]})),{successLabel:`Created`})}};function x(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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 S={command:`update <namespace-id>`,describe:"Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.",builder:x,handler:async l=>{if(l.dryRun){a({command:`cf kv bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await r(l),d=l.local?s:await t();if(l.accountId=d,l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),r=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);r=await o(`Updating: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>n(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:a}))}i(r,{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},C={command:`bulk`,describe:`Bulk read, write, and delete operations on multiple KV key-value pairs at once`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-name>`,describe:"Remove a KV pair from the namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:w,handler:async n=>{if(n.dryRun){a({command:`cf kv keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}/values/${n[`key-name`]==null?`<key-name>`:encodeURIComponent(String(n[`key-name`]))}`,pathParams:{"key-name":String(n[`key-name`]??``),"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.kv.keys.delete({account_id:l,namespace_id:n[`namespace-id`],key_name:n[`key-name`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,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 D={command:`get <key-name>`,describe:"Returns the value associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. If the KV-pair is set to expire at some point, the expiration time as measured in seconds since the UNIX epoch will be returned in the `expiration` response header.",builder:E,handler:async n=>{if(n.dryRun){a({command:`cf kv keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}/values/${n[`key-name`]==null?`<key-name>`:encodeURIComponent(String(n[`key-name`]))}`,pathParams:{"key-name":String(n[`key-name`]??``),"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`none`});return}await r(n);let i=n.local?s:await t();n.accountId=i;let c=await o(`Loading`,async()=>g(`/accounts/${i}/storage/kv/namespaces/${encodeURIComponent(String(n[`namespace-id`]))}/values/${encodeURIComponent(String(n[`key-name`]))}`,{method:`GET`,localEndpoint:n.local?n.localEndpoint:void 0}));h(n.text===!0?c.toString(`utf-8`):c)}};function O(e){return e.option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit.`}).option(`prefix`,{type:`string`,description:`Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.`}).option(`cursor`,{type:`string`,description:"Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. 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 k={command:`list`,describe:`Lists a namespace's keys.`,builder:O,handler:async n=>{let c={limit:n.limit,prefix:n.prefix,cursor:n.cursor};if(n.dryRun){a({command:`cf kv keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}/keys`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.kv.keys.list({account_id:u,namespace_id:n[`namespace-id`],...c})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`expiration`,{type:`number`,description:`Expires the key at a certain time, measured in number of seconds since the UNIX epoch.`}).option(`expiration-ttl`,{type:`number`,description:`Expires the key after a number of seconds. Must be at least 60.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A byte sequence to be stored, up to 25 MiB in length.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`The metadata`})}const j={command:`update <key-name>`,describe:"Write a value identified by a key. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. Body should be the value to be stored. If JSON metadata to be associated with the key/value pair is needed, use `multipart/form-data` content type for your PUT request (see dropdown below in `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.",builder:A,handler:async c=>{let l={expiration:c.expiration,expiration_ttl:c[`expiration-ttl`]};if(c.dryRun){a({command:`cf kv keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${c[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(c[`namespace-id`]))}/values/${c[`key-name`]==null?`<key-name>`:encodeURIComponent(String(c[`key-name`]))}`,pathParams:{"key-name":String(c[`key-name`]??``),"namespace-id":String(c[`namespace-id`]??``)},query:l,bodyKind:c.metadata===void 0?`octet-stream`:`multipart`,body:c.metadata===void 0?c.body:{body:c.body,file:c.file,metadata:c.metadata}});return}let f=await r(c),p=c.local?s:await t();if(c.accountId=p,c.metadata!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`value`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`value`,c.body);c.metadata!==void 0&&e.append(`metadata`,String(u(c.metadata,`metadata`,`text`)??``)),i(await o(`Updating`,async()=>n(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(c.file){let e=d(c.file);i(await o(`Updating`,async()=>n(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(c.body){let e=u(c.body,`body`,`binary`),t=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();i(await o(`Updating`,async()=>n(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},M={command:`keys`,describe:`Read, write, and delete individual key-value pairs in a KV namespace. Pass --namespace-id to scope.`,builder:e=>e.command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <key-name>`,describe:"Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:N,handler:async n=>{if(n.dryRun){a({command:`cf kv metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}/metadata/${n[`key-name`]==null?`<key-name>`:encodeURIComponent(String(n[`key-name`]))}`,pathParams:{"key-name":String(n[`key-name`]??``),"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.kv.metadata.get({account_id:l,namespace_id:n[`namespace-id`],key_name:n[`key-name`]})),{successLabel:`Loaded`})}},F={command:`metadata`,describe:`Read the metadata associated with a KV key without fetching its value`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`create`,describe:"Creates a namespace under the given title. A `400` is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.",builder:I,handler:async n=>{if(n.dryRun){a({command:`cf kv namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({title:u(n.title,`title`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.kv.namespaces.create({body:e,account_id:p})),{successLabel:`Created`});return}n.title===void 0&&(n.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({title:u(n.title,`title`,`text`)});i(await o(`Creating`,async()=>d.kv.namespaces.create({body:m,account_id:p})),{successLabel:`Created`})}};function R(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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 z={command:`delete <namespace-id>`,describe:`Deletes the namespace corresponding to the given ID.`,builder:R,handler:async n=>{if(n.dryRun){a({command:`cf kv namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>c.kv.namespaces.delete({account_id:l,namespace_id:n[`namespace-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <namespace-id>`,describe:`Get the namespace corresponding to the given ID.`,builder:B,handler:async n=>{if(n.dryRun){a({command:`cf kv namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.kv.namespaces.get({account_id:l,namespace_id:n[`namespace-id`]})),{successLabel:`Loaded`})}};function H(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(`order`,{type:`string`,description:`Field to order results by.`,choices:[`id`,`title`]}).option(`direction`,{type:`string`,description:`Direction to order namespaces.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Returns the namespaces owned by an account.`,builder:m(H),handler:async n=>{let c={page:n.page,per_page:n[`per-page`],order:n.order,direction:n.direction};if(n.dryRun){a({command:`cf kv namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.kv.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function W(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`update <namespace-id>`,describe:`Modifies a namespace's title.`,builder:W,handler:async n=>{if(n.dryRun){a({command:`cf kv namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({title:u(n.title,`title`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.kv.namespaces.update({body:e,account_id:p,namespace_id:n[`namespace-id`]})),{successLabel:`Updated`});return}n.title===void 0&&(n.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({title:u(n.title,`title`,`text`)});i(await o(`Updating`,async()=>d.kv.namespaces.update({body:m,account_id:p,namespace_id:n[`namespace-id`]})),{successLabel:`Updated`})}},K={command:`namespaces`,describe:`KV namespaces — create, read, rename, and delete the containers that hold your key-value pairs`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`kv`,describe:`Global, low-latency key-value storage for Workers — namespaces, keys, values, and bulk operations`,builder:e=>e.command(C).command(M).command(F).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{t as c}from"./prompt-DTAWiEm2.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 s=>{if(s.dryRun){r({command:`cf leaked-credential-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Creating`,async()=>c.leakedCredentialChecks.create({body:e,zone_id:l})),{successLabel:`Created`});return}let u=o({enabled:s.enabled});n(await i(`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 c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`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 a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
2
+ import{D as e}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{t as c}from"./prompt-DcfYBioA.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 s=>{if(s.dryRun){r({command:`cf leaked-credential-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Creating`,async()=>c.leakedCredentialChecks.create({body:e,zone_id:l})),{successLabel:`Created`});return}let u=o({enabled:s.enabled});n(await i(`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 c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`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 a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.leakedCredentialChecks.detections.delete({zone_id:s,detection_id:a[`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 a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.get({zone_id:s,detection_id:a[`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 a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.list({zone_id:s})),{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 c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections/${c[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(c[`detection-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"detection-id":String(c[`detection-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`})}},x={command:`detections`,describe:`Operations for detections`,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 a=>{if(a.dryRun){r({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.get({zone_id:s})),{successLabel:`Loaded`})}},w={command:`leaked-credential-checks`,describe:`leaked-credential-checks`,builder:e=>e.command(u).command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};