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,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./chunk-DH-VkVmc.mjs";import{createRequire as t}from"node:module";var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>r(e,`name`,{value:t,configurable:!0}),l=e===void 0?t(import.meta.url):e,u=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},f=(e,t,i)=>(i=e==null?{}:n(o(e)),d(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e));export{f as i,c as n,l as r,u as t};
2
+ import{i as e}from"./chunk-DH-VkVmc.mjs";import{createRequire as t}from"node:module";var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>r(e,`name`,{value:t,configurable:!0}),l=e===void 0?t(import.meta.url):e,u=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},p=(e,t,i)=>(i=e==null?{}:n(o(e)),f(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e));export{p as a,l as i,d as n,c as r,u as t};
@@ -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";import{t as u}from"./cli-types-CFw6Xygp.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create a new API Shield mTLS Client Certificate.`,builder:d,handler:async l=>{if(l.dryRun){r({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({csr:s(l.csr,`csr`,`text`),validity_days:l[`validity-days`]}):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.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=o({csr:s(l.csr,`csr`,`text`),validity_days:l[`validity-days`]});n(await i(`Creating`,async()=>u.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function p(e){return e.positional(`client-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 m={command:`delete <client-certificate-id>`,describe:`Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/client_certificates/${a[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(a[`client-certificate-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"client-certificate-id":String(a[`client-certificate-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";import{t as u}from"./cli-types-CFw6Xygp.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create a new API Shield mTLS Client Certificate.`,builder:d,handler:async l=>{if(l.dryRun){r({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({csr:s(l.csr,`csr`,`text`),validity_days:l[`validity-days`]}):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.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=o({csr:s(l.csr,`csr`,`text`),validity_days:l[`validity-days`]});n(await i(`Creating`,async()=>u.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function p(e){return e.positional(`client-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 m={command:`delete <client-certificate-id>`,describe:`Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/client_certificates/${a[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(a[`client-certificate-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"client-certificate-id":String(a[`client-certificate-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.clientCertificates.delete({zone_id:s,client_certificate_id:a[`client-certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`reactivate`,{type:`boolean`,description:`The reactivate 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 g={command:`edit <client-certificate-id>`,describe:`If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`,builder:h,handler:async s=>{if(s.dryRun){r({command:`cf client-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/client_certificates/${s[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(s[`client-certificate-id`]))}`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``),"client-certificate-id":String(s[`client-certificate-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({reactivate:s.reactivate}):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(`Updating`,async()=>c.clientCertificates.edit({...e,zone_id:l,client_certificate_id:s[`client-certificate-id`]})),{successLabel:`Updated`});return}let u=o({reactivate:s.reactivate});n(await i(`Updating`,async()=>c.clientCertificates.edit({...u,zone_id:l,client_certificate_id:s[`client-certificate-id`]})),{successLabel:`Updated`})}};function _(e){return e.positional(`client-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 v={command:`get <client-certificate-id>`,describe:`Get Details for a single mTLS API Shield Client Certificate.`,builder:_,handler:async a=>{if(a.dryRun){r({command:`cf client-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/client_certificates/${a[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(a[`client-certificate-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"client-certificate-id":String(a[`client-certificate-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.clientCertificates.get({zone_id:s,client_certificate_id:a[`client-certificate-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`status`,{type:`string`,description:`Client Certitifcate Status to filter results by.`,choices:[`all`,`active`,`pending_reactivation`,`pending_revocation`,`revoked`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`,builder:u(y),handler:async a=>{let o={status:a.status,page:a.page,per_page:a[`per-page`],limit:a.limit,offset:a.offset};if(a.dryRun){r({command:`cf client-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.clientCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}},x={command:`client-certificates`,describe:`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{x as default};
@@ -1,2 +1,2 @@
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}from"./body-parser-BO6mfo_W.mjs";function o(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`list`,describe:`Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`,builder:o,handler:async a=>{if(a.dryRun){r({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cloud_connector/rules`,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.cloudConnector.rules.list({zone_id:s})),{successLabel:`Loaded`})}};function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const l={command:`update`,describe:`Updates Cloud Connector rules for a zone, replacing the existing rule configuration.`,builder:c,handler:async o=>{if(o.dryRun){r({command:`cf cloud-connector rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Updating`,async()=>s.cloudConnector.rules.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},u={command:`rules`,describe:`Routing rules that map request patterns to cloud provider endpoints`,builder:e=>e.command(s).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`cloud-connector`,describe:`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
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}from"./body-parser-BO6mfo_W.mjs";function o(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`list`,describe:`Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`,builder:o,handler:async a=>{if(a.dryRun){r({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cloud_connector/rules`,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.cloudConnector.rules.list({zone_id:s})),{successLabel:`Loaded`})}};function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const l={command:`update`,describe:`Updates Cloud Connector rules for a zone, replacing the existing rule configuration.`,builder:c,handler:async o=>{if(o.dryRun){r({command:`cf cloud-connector rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Updating`,async()=>s.cloudConnector.rules.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},u={command:`rules`,describe:`Routing rules that map request patterns to cloud provider endpoints`,builder:e=>e.command(s).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`cloud-connector`,describe:`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d 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{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";import{t as h}from"./cli-types-CFw6Xygp.mjs";function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`create`,describe:`Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`,builder:ee,handler:async c=>{if(c.dryRun){a({command:`cf cloudforce-one binary-storage create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/binary`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==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);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/cloudforce-one/binary`,{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}/cloudforce-one/binary`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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 g(e){return e.positional(`hash`,{type:`string`,description:`hash of the binary`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <hash>`,describe:`Retrieves a binary file from the Cloudforce One binary storage for analysis.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one binary-storage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/binary/${n.hash==null?`<hash>`:encodeURIComponent(String(n.hash))}`,pathParams:{hash:String(n.hash??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.binaryStorage.get({account_id:l,hash:n.hash})),{successLabel:`Loaded`})}},v={command:`binary-storage`,describe:`Upload and retrieve malware samples and suspicious binaries for analysis`,builder:e=>e.command(te).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`aggregate-by`,{type:`string`,description:`Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry')`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID(s) to filter by. Can be a single dataset ID, comma-separated list, or array. If not provided, uses default dataset`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Aggregate threat events by one or more columns (e.g., attacker, targetIndustry) with optional date filtering and daily grouping. Supports multi-dimensional aggregation for cross-analysis.`,builder:y,handler:async n=>{let c={aggregateBy:n[`aggregate-by`],datasetId:n[`dataset-id`],startDate:n[`start-date`],endDate:n[`end-date`],groupByDate:n[`group-by-date`],limit:n.limit};if(n.dryRun){a({command:`cf cloudforce-one events aggregate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/aggregate`,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.cloudforceOne.events.aggregate.get({account_id:u,...c})),{successLabel:`Loaded`})}},x={command:`aggregate`,describe:`Events operations`,builder:e=>e.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:`Lists categories`,builder:S,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events categories catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/categories/catalog`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.categories.catalog.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`catalog`,describe:`Events operations`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`kill-chain`,{type:`number`,description:`The killChain field`}).option(`mitre-attack`,{type:`string`,array:!0,description:`The mitreAttack field`}).option(`mitre-capec`,{type:`string`,array:!0,description:`The mitreCapec field`}).option(`name`,{type:`string`,description:`The name field`}).option(`shortname`,{type:`string`,description:`The shortname 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 E={command:`create <category-id>`,describe:`Updates a category`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({killChain:n[`kill-chain`],mitreAttack:n[`mitre-attack`],mitreCapec:n[`mitre-capec`],name:u(n.name,`name`,`text`),shortname:u(n.shortname,`shortname`,`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.cloudforceOne.events.categories.create({...e,account_id:f,category_id:n[`category-id`]})),{successLabel:`Created`});return}let p=l({killChain:n[`kill-chain`],mitreAttack:n[`mitre-attack`],mitreCapec:n[`mitre-capec`],name:u(n.name,`name`,`text`),shortname:u(n.shortname,`shortname`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.categories.create({...p,account_id:f,category_id:n[`category-id`]})),{successLabel:`Created`})}},D={command:`categories`,describe:`Events operations`,builder:e=>e.command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`attacker`,{type:`string`,description:`The attacker field`}).option(`attacker-country`,{type:`string`,description:`The attackerCountry field`}).option(`category`,{type:`string`,description:`The category field`}).option(`created-at`,{type:`string`,description:`The createdAt field`}).option(`dataset-id`,{type:`string`,description:`Dataset ID containing the event to update.`}).option(`date`,{type:`string`,description:`The date field`}).option(`event`,{type:`string`,description:`The event field`}).option(`indicator`,{type:`string`,description:`The indicator field`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`insight`,{type:`string`,description:`The insight field`}).option(`raw-source`,{type:`string`,description:`The raw.source field`}).option(`raw-tlp`,{type:`string`,description:`The raw.tlp field`}).option(`target-country`,{type:`string`,description:`The targetCountry field`}).option(`target-industry`,{type:`string`,description:`The targetIndustry field`}).option(`tlp`,{type:`string`,description:`The tlp 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 k={command:`create <event-id>`,describe:`Updates an event`,builder:O,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/${n[`event-id`]==null?`<event-id>`:encodeURIComponent(String(n[`event-id`]))}`,pathParams:{"event-id":String(n[`event-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({attacker:u(n.attacker,`attacker`,`text`),attackerCountry:u(n[`attacker-country`],`attacker-country`,`text`),category:u(n.category,`category`,`text`),createdAt:u(n[`created-at`],`created-at`,`text`),datasetId:u(n[`dataset-id`],`dataset-id`,`text`),date:u(n.date,`date`,`text`),event:u(n.event,`event`,`text`),indicator:u(n.indicator,`indicator`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),insight:u(n.insight,`insight`,`text`),raw:{source:u(n[`raw-source`],`raw-source`,`text`),tlp:u(n[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:u(n[`target-country`],`target-country`,`text`),targetIndustry:u(n[`target-industry`],`target-industry`,`text`),tlp:u(n.tlp,`tlp`,`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.cloudforceOne.events.create({...e,account_id:f,event_id:n[`event-id`]})),{successLabel:`Created`});return}n[`dataset-id`]===void 0&&(n[`dataset-id`]=await p(`dataset-id`,`Dataset ID containing the event to update.`));let m=l({attacker:u(n.attacker,`attacker`,`text`),attackerCountry:u(n[`attacker-country`],`attacker-country`,`text`),category:u(n.category,`category`,`text`),createdAt:u(n[`created-at`],`created-at`,`text`),datasetId:u(n[`dataset-id`],`dataset-id`,`text`),date:u(n.date,`date`,`text`),event:u(n.event,`event`,`text`),indicator:u(n.indicator,`indicator`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),insight:u(n.insight,`insight`,`text`),raw:{source:u(n[`raw-source`],`raw-source`,`text`),tlp:u(n[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:u(n[`target-country`],`target-country`,`text`),targetIndustry:u(n[`target-industry`],`target-industry`,`text`),tlp:u(n.tlp,`tlp`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.create({...m,account_id:f,event_id:n[`event-id`]})),{successLabel:`Created`})}};function A(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`keep-raw-data`,{type:`boolean`,description:`If true, copies raw data to the destination dataset. Default is false (raw data is stripped/not copied).`}).option(`dest-dataset-id`,{type:`string`,description:`The destDatasetId field`}).option(`event-ids`,{type:`string`,array:!0,description:`The eventIds 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 j={command:`create <dataset-id>`,describe:`Copies specified events from one dataset to another dataset`,builder:A,handler:async n=>{let d={keepRawData:n[`keep-raw-data`]};if(n.dryRun){a({command:`cf cloudforce-one events dataset copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/copy`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},query:d,bodyKind:`json`,body:n.body===void 0?l({destDatasetId:u(n[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:n[`event-ids`]}):c(n.body)});return}let f=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...e,account_id:m,dataset_id:n[`dataset-id`],...d})),{successLabel:`Created`});return}if(n[`dest-dataset-id`]===void 0&&(n[`dest-dataset-id`]=await p(`dest-dataset-id`,`The destDatasetId field`)),n[`event-ids`]===void 0)throw Error(`--event-ids is required (or pass --body with this field set).`);let h=l({destDatasetId:u(n[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:n[`event-ids`]});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...h,account_id:m,dataset_id:n[`dataset-id`],...d})),{successLabel:`Created`})}},M={command:`copy`,describe:`Events operations`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <dataset-id>`,describe:`Updates an existing dataset`,builder:N,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({isPublic: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(`Creating`,async()=>d.cloudforceOne.events.dataset.create({...e,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`});return}if(n[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await p(`name`,`Used to describe the dataset within the account context.`));let m=l({isPublic:n[`is-public`],name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.create({...m,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})}};function F(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID to delete`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const I={command:`delete <dataset-id>`,describe:`Soft-deletes a dataset given a datasetId.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-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.
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";function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`create`,describe:`Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`,builder:ee,handler:async c=>{if(c.dryRun){a({command:`cf cloudforce-one binary-storage create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/binary`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==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);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/cloudforce-one/binary`,{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}/cloudforce-one/binary`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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 g(e){return e.positional(`hash`,{type:`string`,description:`hash of the binary`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <hash>`,describe:`Retrieves a binary file from the Cloudforce One binary storage for analysis.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one binary-storage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/binary/${n.hash==null?`<hash>`:encodeURIComponent(String(n.hash))}`,pathParams:{hash:String(n.hash??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.binaryStorage.get({account_id:l,hash:n.hash})),{successLabel:`Loaded`})}},v={command:`binary-storage`,describe:`Upload and retrieve malware samples and suspicious binaries for analysis`,builder:e=>e.command(te).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`aggregate-by`,{type:`string`,description:`Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry')`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID(s) to filter by. Can be a single dataset ID, comma-separated list, or array. If not provided, uses default dataset`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Aggregate threat events by one or more columns (e.g., attacker, targetIndustry) with optional date filtering and daily grouping. Supports multi-dimensional aggregation for cross-analysis.`,builder:y,handler:async n=>{let c={aggregateBy:n[`aggregate-by`],datasetId:n[`dataset-id`],startDate:n[`start-date`],endDate:n[`end-date`],groupByDate:n[`group-by-date`],limit:n.limit};if(n.dryRun){a({command:`cf cloudforce-one events aggregate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/aggregate`,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.cloudforceOne.events.aggregate.get({account_id:u,...c})),{successLabel:`Loaded`})}},x={command:`aggregate`,describe:`Events operations`,builder:e=>e.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:`Lists categories`,builder:S,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events categories catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/categories/catalog`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.categories.catalog.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`catalog`,describe:`Events operations`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`kill-chain`,{type:`number`,description:`The killChain field`}).option(`mitre-attack`,{type:`string`,array:!0,description:`The mitreAttack field`}).option(`mitre-capec`,{type:`string`,array:!0,description:`The mitreCapec field`}).option(`name`,{type:`string`,description:`The name field`}).option(`shortname`,{type:`string`,description:`The shortname 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 E={command:`create <category-id>`,describe:`Updates a category`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({killChain:n[`kill-chain`],mitreAttack:n[`mitre-attack`],mitreCapec:n[`mitre-capec`],name:u(n.name,`name`,`text`),shortname:u(n.shortname,`shortname`,`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.cloudforceOne.events.categories.create({...e,account_id:f,category_id:n[`category-id`]})),{successLabel:`Created`});return}let p=l({killChain:n[`kill-chain`],mitreAttack:n[`mitre-attack`],mitreCapec:n[`mitre-capec`],name:u(n.name,`name`,`text`),shortname:u(n.shortname,`shortname`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.categories.create({...p,account_id:f,category_id:n[`category-id`]})),{successLabel:`Created`})}},D={command:`categories`,describe:`Events operations`,builder:e=>e.command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`attacker`,{type:`string`,description:`The attacker field`}).option(`attacker-country`,{type:`string`,description:`The attackerCountry field`}).option(`category`,{type:`string`,description:`The category field`}).option(`created-at`,{type:`string`,description:`The createdAt field`}).option(`dataset-id`,{type:`string`,description:`Dataset ID containing the event to update.`}).option(`date`,{type:`string`,description:`The date field`}).option(`event`,{type:`string`,description:`The event field`}).option(`indicator`,{type:`string`,description:`The indicator field`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`insight`,{type:`string`,description:`The insight field`}).option(`raw-source`,{type:`string`,description:`The raw.source field`}).option(`raw-tlp`,{type:`string`,description:`The raw.tlp field`}).option(`target-country`,{type:`string`,description:`The targetCountry field`}).option(`target-industry`,{type:`string`,description:`The targetIndustry field`}).option(`tlp`,{type:`string`,description:`The tlp 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 k={command:`create <event-id>`,describe:`Updates an event`,builder:O,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/${n[`event-id`]==null?`<event-id>`:encodeURIComponent(String(n[`event-id`]))}`,pathParams:{"event-id":String(n[`event-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({attacker:u(n.attacker,`attacker`,`text`),attackerCountry:u(n[`attacker-country`],`attacker-country`,`text`),category:u(n.category,`category`,`text`),createdAt:u(n[`created-at`],`created-at`,`text`),datasetId:u(n[`dataset-id`],`dataset-id`,`text`),date:u(n.date,`date`,`text`),event:u(n.event,`event`,`text`),indicator:u(n.indicator,`indicator`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),insight:u(n.insight,`insight`,`text`),raw:{source:u(n[`raw-source`],`raw-source`,`text`),tlp:u(n[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:u(n[`target-country`],`target-country`,`text`),targetIndustry:u(n[`target-industry`],`target-industry`,`text`),tlp:u(n.tlp,`tlp`,`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.cloudforceOne.events.create({...e,account_id:f,event_id:n[`event-id`]})),{successLabel:`Created`});return}n[`dataset-id`]===void 0&&(n[`dataset-id`]=await p(`dataset-id`,`Dataset ID containing the event to update.`));let m=l({attacker:u(n.attacker,`attacker`,`text`),attackerCountry:u(n[`attacker-country`],`attacker-country`,`text`),category:u(n.category,`category`,`text`),createdAt:u(n[`created-at`],`created-at`,`text`),datasetId:u(n[`dataset-id`],`dataset-id`,`text`),date:u(n.date,`date`,`text`),event:u(n.event,`event`,`text`),indicator:u(n.indicator,`indicator`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),insight:u(n.insight,`insight`,`text`),raw:{source:u(n[`raw-source`],`raw-source`,`text`),tlp:u(n[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:u(n[`target-country`],`target-country`,`text`),targetIndustry:u(n[`target-industry`],`target-industry`,`text`),tlp:u(n.tlp,`tlp`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.create({...m,account_id:f,event_id:n[`event-id`]})),{successLabel:`Created`})}};function A(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`keep-raw-data`,{type:`boolean`,description:`If true, copies raw data to the destination dataset. Default is false (raw data is stripped/not copied).`}).option(`dest-dataset-id`,{type:`string`,description:`The destDatasetId field`}).option(`event-ids`,{type:`string`,array:!0,description:`The eventIds 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 j={command:`create <dataset-id>`,describe:`Copies specified events from one dataset to another dataset`,builder:A,handler:async n=>{let d={keepRawData:n[`keep-raw-data`]};if(n.dryRun){a({command:`cf cloudforce-one events dataset copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/copy`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},query:d,bodyKind:`json`,body:n.body===void 0?l({destDatasetId:u(n[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:n[`event-ids`]}):c(n.body)});return}let f=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...e,account_id:m,dataset_id:n[`dataset-id`],...d})),{successLabel:`Created`});return}if(n[`dest-dataset-id`]===void 0&&(n[`dest-dataset-id`]=await p(`dest-dataset-id`,`The destDatasetId field`)),n[`event-ids`]===void 0)throw Error(`--event-ids is required (or pass --body with this field set).`);let h=l({destDatasetId:u(n[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:n[`event-ids`]});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...h,account_id:m,dataset_id:n[`dataset-id`],...d})),{successLabel:`Created`})}},M={command:`copy`,describe:`Events operations`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <dataset-id>`,describe:`Updates an existing dataset`,builder:N,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({isPublic: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(`Creating`,async()=>d.cloudforceOne.events.dataset.create({...e,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`});return}if(n[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await p(`name`,`Used to describe the dataset within the account context.`));let m=l({isPublic:n[`is-public`],name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.create({...m,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})}};function F(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID to delete`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const I={command:`delete <dataset-id>`,describe:`Soft-deletes a dataset given a datasetId.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-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.
3
3
  `);return}i(await o(`Deleting`,async()=>c.cloudforceOne.events.dataset.delete({account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Deleted`})}};function L(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <event-id>`,describe:`Retrieves a specific event by its UUID.`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/events/${n[`event-id`]==null?`<event-id>`:encodeURIComponent(String(n[`event-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``),"event-id":String(n[`event-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.dataset.events.get({account_id:l,dataset_id:n[`dataset-id`],event_id:n[`event-id`]})),{successLabel:`Loaded`})}},z={command:`events`,describe:`Events operations`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name 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 V={command:`create`,describe:`Create a group`,builder:B,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups`,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.cloudforceOne.events.dataset.groups.create({...e,account_id:f})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await p(`description`,`The description field`)),n.name===void 0&&(n.name=await p(`name`,`The name field`));let m=l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.groups.create({...m,account_id:f})),{successLabel:`Created`})}};function H(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`delete <group-id>`,describe:`Delete a group for an account`,builder:H,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-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.
4
4
  `);return}i(await o(`Deleting`,async()=>c.cloudforceOne.events.dataset.groups.delete({account_id:l,group_id:n[`group-id`]})),{successLabel:`Deleted`})}};function W(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`group`,describe:`List groups for an account`,builder:W,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups get group`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.get.group({account_id:l})),{successLabel:`Loaded`})}};function K(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`v2 <group-id>`,describe:`Read a group for an account`,builder:K,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.get.v2({account_id:l,group_id:n[`group-id`]})),{successLabel:`Loaded`})}},J={command:`get`,describe:`Events operations`,builder:e=>e.command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`The accountTag 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 X={command:`create <group-id>`,describe:`Create a group member`,builder:Y,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}/members`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({accountTag:u(n[`account-tag`],`account-tag`,`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.cloudforceOne.events.dataset.groups.members.create({...e,account_id:f,group_id:n[`group-id`]})),{successLabel:`Created`});return}let p=l({accountTag:u(n[`account-tag`],`account-tag`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.groups.members.create({...p,account_id:f,group_id:n[`group-id`]})),{successLabel:`Created`})}};function Z(e){return e.positional(`member-id`,{type:`string`,description:`Member ID`,demandOption:!0}).option(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Q={command:`delete <member-id>`,describe:`Delete a group member`,builder:Z,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}/members/${n[`member-id`]==null?`<member-id>`:encodeURIComponent(String(n[`member-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``),"member-id":String(n[`member-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.cloudforceOne.events.dataset.groups.members.delete({account_id:l,group_id:n[`group-id`],member_id:n[`member-id`]})),{successLabel:`Deleted`})}};function ne(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <group-id>`,describe:`List group members`,builder:ne,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}/members`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.members.get({account_id:l,group_id:n[`group-id`]})),{successLabel:`Loaded`})}},ie={command:`members`,describe:`Events operations`,builder:e=>e.command(X).command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name 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 oe={command:`update <group-id>`,describe:`Update a group`,builder:ae,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},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(`Updating`,async()=>d.cloudforceOne.events.dataset.groups.update({...e,account_id:f,group_id:n[`group-id`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await p(`description`,`The description field`)),n.name===void 0&&(n.name=await p(`name`,`The name field`));let m=l({description:u(n.description,`description`,`text`),name:u(n.name,`name`,`text`)});i(await o(`Updating`,async()=>d.cloudforceOne.events.dataset.groups.update({...m,account_id:f,group_id:n[`group-id`]})),{successLabel:`Updated`})}},se={command:`groups`,describe:`Events operations`,builder:e=>e.command(V).command(U).command(oe).command(J).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description for the indicator type`}).option(`indicator-type`,{type:`string`,description:`The indicator type to create (e.g., 'DOMAIN', 'IP', 'URL', 'HASH', 'EMAIL')`}).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 le={command:`create <dataset-id>`,describe:`Creates a new indicator type and initializes its dedicated Durable Object`,builder:ce,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset indicator types create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/indicatorTypes/create`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({description:u(n.description,`description`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`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.cloudforceOne.events.dataset.indicator.types.create.create({...e,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`});return}n[`indicator-type`]===void 0&&(n[`indicator-type`]=await p(`indicator-type`,`The indicator type to create (e.g., 'DOMAIN', 'IP', 'URL', 'HASH', 'EMAIL')`));let m=l({description:u(n.description,`description`,`text`),indicatorType:u(n[`indicator-type`],`indicator-type`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.indicator.types.create.create({...m,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})}},ue={command:`create`,describe:`Events operations`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`types`,describe:`Operations for events.dataset.indicator.types`,builder:e=>e.command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`indicator`,describe:`Operations for events.dataset.indicator`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`auto-create-type`,{type:`boolean`,description:`Global flag to automatically create indicator types if they don't exist. Individual indicators can override this with their own autoCreateType flag.`}).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 me={command:`create <dataset-id>`,describe:`Creates multiple indicators at once with their respective types and related datasets.`,builder:pe,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset indicators bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/indicators/bulk`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({autoCreateType:n[`auto-create-type`]}):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(`Creating`,async()=>u.cloudforceOne.events.dataset.indicators.bulk.create({...e,account_id:d,dataset_id:n[`dataset-id`]})),{successLabel:`Created`});return}let f=l({autoCreateType:n[`auto-create-type`]});i(await o(`Creating`,async()=>u.cloudforceOne.events.dataset.indicators.bulk.create({...f,account_id:d,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})}},he={command:`bulk`,describe:`Events operations`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`auto-create-type`,{type:`boolean`,description:`If true, automatically create the indicator type if it doesn't exist. If false (default), throw an error when the indicator type doesn't exist.`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`value`,{type:`string`,description:`The value 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 _e={command:`create <dataset-id>`,describe:`Creates a new indicator with the specified type and related datasets.`,builder:ge,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset indicators create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/indicators/create`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({autoCreateType:n[`auto-create-type`],indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),value:u(n.value,`value`,`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.cloudforceOne.events.dataset.indicators.create.create({...e,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`});return}n[`indicator-type`]===void 0&&(n[`indicator-type`]=await p(`indicator-type`,`The indicatorType field`)),n.value===void 0&&(n.value=await p(`value`,`The value field`));let m=l({autoCreateType:n[`auto-create-type`],indicatorType:u(n[`indicator-type`],`indicator-type`,`text`),value:u(n.value,`value`,`text`)});i(await o(`Creating`,async()=>d.cloudforceOne.events.dataset.indicators.create.create({...m,account_id:f,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})}},ve={command:`create`,describe:`Events operations`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.positional(`indicator-id`,{type:`string`,description:`Indicator UUID.`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const be={command:`delete <indicator-id>`,describe:`Deletes a specific indicator by its UUID.`,builder:ye,handler:async n=>{if(n.dryRun){a({command:`cf cloudforce-one events dataset indicators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/cloudforce-one/events/dataset/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/indicators/${n[`indicator-id`]==null?`<indicator-id>`:encodeURIComponent(String(n[`indicator-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``),"indicator-id":String(n[`indicator-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.
@@ -796,6 +796,6 @@ complete -k -c ${e} -n '__${n}_requires_order_preservation && __${n}_prepare_com
796
796
  }
797
797
 
798
798
  Register-ArgumentCompleter -CommandName '${e}' -ScriptBlock $__${n}CompleterBlock
799
- `}const s={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,shellCompDirectiveMaxValue:64,ShellCompDirectiveDefault:0};var c=class{name;variadic;command;handler;constructor(e,t,n,r=!1){this.command=e,this.name=t,this.handler=n,this.variadic=r}},l=class{value;description;command;handler;alias;isBoolean;constructor(e,t,n,r,i,a){this.command=e,this.value=t,this.description=n,this.handler=r,this.alias=i,this.isBoolean=a}},u=class{value;description;options=new Map;arguments=new Map;parent;constructor(e,t){this.value=e,this.description=t}option(e,t,n,r){let i,a,o;typeof n==`function`?(i=n,a=r,o=!1):typeof n==`string`?(i=void 0,a=n,o=!0):(i=void 0,a=void 0,o=!0);let s=new l(this,e,t,i,a,o);return this.options.set(e,s),this}argument(e,t,n=!1){let r=new c(this,e,t,n);return this.arguments.set(e,r),this}};const d=new class extends u{commands=new Map;completions=[];directive=s.ShellCompDirectiveDefault;constructor(){super(``,``)}command(e,t){let n=new u(e,t);return this.commands.set(e,n),n}stripOptions(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.startsWith(`-`)){n++;let t=!1,i=this.findOption(this,r);if(i)t=i.isBoolean??!1;else for(let[,e]of this.commands){let n=this.findOption(e,r);if(n){t=n.isBoolean??!1;break}}!t&&n<e.length&&!e[n].startsWith(`-`)&&n++}else t.push(r),n++}return t}matchCommand(e){e=this.stripOptions(e);let t=[],n=[],r=null;for(let i=0;i<e.length;i++){let a=e[i];t.push(a);let o=this.commands.get(t.join(` `));if(o)r=o;else{n=e.slice(i,e.length);break}}return[r||this,n]}shouldCompleteFlags(e,t){if(t.startsWith(`-`))return!0;if(e?.startsWith(`-`)){let t=this.findOption(this,e);if(!t){for(let[,n]of this.commands)if(t=this.findOption(n,e),t)break}return!(t&&t.isBoolean)}return!1}shouldCompleteCommands(e){return!e.startsWith(`-`)}handleFlagCompletion(e,t,n,r){let i;if(n.includes(`=`)){let[e]=n.split(`=`);i=e}else if(r?.startsWith(`-`)){let t=this.findOption(e,r);t&&!t.isBoolean&&(i=r)}if(i){let t=this.findOption(e,i);if(t?.handler){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions=n}return}if(n.startsWith(`-`)){let t=n.startsWith(`-`)&&!n.startsWith(`--`),r=n.replace(/^-+/,``);for(let[i,a]of e.options)t&&a.alias&&`-${a.alias}`.startsWith(n)?this.completions.push({value:`-${a.alias}`,description:a.description}):!t&&i.startsWith(r)&&this.completions.push({value:`--${i}`,description:a.description})}}findOption(e,t){let n=e.options.get(t);if(n||(n=e.options.get(t.replace(/^-+/,``)),n))return n;for(let[n,r]of e.options)if(r.alias&&`-${r.alias}`===t)return r}handleCommandCompletion(e,t){let n=this.stripOptions(e);for(let[e,r]of this.commands){if(e===``)continue;let i=e.split(` `);i.slice(0,n.length).every((e,t)=>e===n[t])&&i[n.length]?.startsWith(t)&&this.completions.push({value:i[n.length],description:r.description})}}handlePositionalCompletion(e,t){let n=this.stripOptions(t),r=e.value.split(` `).length,i=Math.max(0,n.length-r),a=Array.from(e.arguments.entries());if(a.length>0){let t;if(i<a.length){let[e,n]=a[i];t=n}else{let e=a[a.length-1][1];e.variadic&&(t=e)}if(t&&t.handler&&typeof t.handler==`function`){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions.push(...n)}}}complete(e){this.directive=s.ShellCompDirectiveNoFileComp;let t=new Set;this.completions.filter(e=>t.has(e.value)?!1:(t.add(e.value),!0)).filter(t=>{if(e.includes(`=`)){let[,n]=e.split(`=`);return t.value.startsWith(n)}return t.value.startsWith(e)}).forEach(e=>console.log(`${e.value}\t${e.description??``}`)),console.log(`:${this.directive}`)}parse(e){this.completions=[];let t=e[e.length-1]===``;t&&e.pop();let n=e[e.length-1]||``,r=e.slice(0,-1);t&&(n!==``&&r.push(n),n=``);let[i]=this.matchCommand(r),a=r[r.length-1];this.shouldCompleteFlags(a,n)?this.handleFlagCompletion(i,r,n,a):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(r,n),i&&i.arguments.size>0&&this.handlePositionalCompletion(i,r)),this.complete(n)}setup(e,t,s){switch(n(s===`zsh`||s===`bash`||s===`fish`||s===`powershell`,`Unsupported shell`),s){case`zsh`:{let n=r(e,t);console.log(n);break}case`bash`:{let n=i(e,t);console.log(n);break}case`fish`:{let n=a(e,t);console.log(n);break}case`powershell`:{let n=o(e,t);console.log(n);break}}}},f={"":[`auth`,`complete`,`dev`,`schema`,`agent-context`],auth:[`login`,`logout`,`whoami`,`create`,`delete`,`activate`,`deactivate`,`list`]},p=[{name:`quiet`,alias:`q`,desc:`Suppress non-essential output`},{name:`zone`,alias:`z`,desc:`Zone ID or domain name`},{name:`profile`,desc:`Use a specific auth profile`},{name:`local`,desc:`Route to a local wrangler dev / cf dev Miniflare session`},{name:`local-endpoint`,desc:`Local Miniflare endpoint URL (required with --local)`},{name:`help`,alias:`h`,desc:`Show help`},{name:`version`,alias:`v`,desc:`Show version`}];function m(){return e(import.meta.url,`commands.json`,t)?.commands??[]}function h(){for(let e of p)d.option(e.name,e.desc),e.alias&&d.option(e.alias,`Alias for --${e.name}`);let e=new Set;function t(t){let n=t.join(` `);e.has(n)||(e.add(n),d.command(n,``))}for(let[e,n]of Object.entries(f)){let r=e?e.split(` `):[];for(let e of n)t([...r,e])}let n=m();for(let t of n){if(t.hideCommand)continue;for(let n=1;n<t.fullPath.length;n++){let r=t.fullPath.slice(0,n).join(` `);e.has(r)||(e.add(r),d.command(r,``))}let n=t.fullPath.join(` `);e.add(n);let r=d.command(n,t.description??``);for(let e of t.options??[])e.enum&&e.enum.length>0?r.option(e.name,e.description??``,t=>{for(let n of e.enum??[])t(n,n)}):r.option(e.name,e.description??``)}}const g={command:`complete [shell]`,describe:`Generate and handle shell completions`,builder:e=>e.positional(`shell`,{type:`string`,choices:[`bash`,`zsh`,`fish`,`powershell`],description:`Shell type to generate completions for`}).example(`cf complete bash >> ~/.bashrc`,`Install bash completions (then restart your shell)`).example(`cf complete zsh >> ~/.zshrc`,`Install zsh completions (then restart your shell)`).example(`cf complete fish > ~/.config/fish/completions/cf.fish`,`Install fish completions`),handler:e=>{let t=(e._??[]).map(String),n=t.slice(+(t[0]===`complete`));if(n.length>0){h(),d.parse(n);return}if(!e.shell){process.stderr.write(`Usage: cf complete <bash|zsh|fish|powershell>
799
+ `}const s={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,shellCompDirectiveMaxValue:64,ShellCompDirectiveDefault:0};var c=class{name;variadic;command;handler;constructor(e,t,n,r=!1){this.command=e,this.name=t,this.handler=n,this.variadic=r}},l=class{value;description;command;handler;alias;isBoolean;constructor(e,t,n,r,i,a){this.command=e,this.value=t,this.description=n,this.handler=r,this.alias=i,this.isBoolean=a}},u=class{value;description;options=new Map;arguments=new Map;parent;constructor(e,t){this.value=e,this.description=t}option(e,t,n,r){let i,a,o;typeof n==`function`?(i=n,a=r,o=!1):typeof n==`string`?(i=void 0,a=n,o=!0):(i=void 0,a=void 0,o=!0);let s=new l(this,e,t,i,a,o);return this.options.set(e,s),this}argument(e,t,n=!1){let r=new c(this,e,t,n);return this.arguments.set(e,r),this}};const d=new class extends u{commands=new Map;completions=[];directive=s.ShellCompDirectiveDefault;constructor(){super(``,``)}command(e,t){let n=new u(e,t);return this.commands.set(e,n),n}stripOptions(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.startsWith(`-`)){n++;let t=!1,i=this.findOption(this,r);if(i)t=i.isBoolean??!1;else for(let[,e]of this.commands){let n=this.findOption(e,r);if(n){t=n.isBoolean??!1;break}}!t&&n<e.length&&!e[n].startsWith(`-`)&&n++}else t.push(r),n++}return t}matchCommand(e){e=this.stripOptions(e);let t=[],n=[],r=null;for(let i=0;i<e.length;i++){let a=e[i];t.push(a);let o=this.commands.get(t.join(` `));if(o)r=o;else{n=e.slice(i,e.length);break}}return[r||this,n]}shouldCompleteFlags(e,t){if(t.startsWith(`-`))return!0;if(e?.startsWith(`-`)){let t=this.findOption(this,e);if(!t){for(let[,n]of this.commands)if(t=this.findOption(n,e),t)break}return!(t&&t.isBoolean)}return!1}shouldCompleteCommands(e){return!e.startsWith(`-`)}handleFlagCompletion(e,t,n,r){let i;if(n.includes(`=`)){let[e]=n.split(`=`);i=e}else if(r?.startsWith(`-`)){let t=this.findOption(e,r);t&&!t.isBoolean&&(i=r)}if(i){let t=this.findOption(e,i);if(t?.handler){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions=n}return}if(n.startsWith(`-`)){let t=n.startsWith(`-`)&&!n.startsWith(`--`),r=n.replace(/^-+/,``);for(let[i,a]of e.options)t&&a.alias&&`-${a.alias}`.startsWith(n)?this.completions.push({value:`-${a.alias}`,description:a.description}):!t&&i.startsWith(r)&&this.completions.push({value:`--${i}`,description:a.description})}}findOption(e,t){let n=e.options.get(t);if(n||(n=e.options.get(t.replace(/^-+/,``)),n))return n;for(let[n,r]of e.options)if(r.alias&&`-${r.alias}`===t)return r}handleCommandCompletion(e,t){let n=this.stripOptions(e);for(let[e,r]of this.commands){if(e===``)continue;let i=e.split(` `);i.slice(0,n.length).every((e,t)=>e===n[t])&&i[n.length]?.startsWith(t)&&this.completions.push({value:i[n.length],description:r.description})}}handlePositionalCompletion(e,t){let n=this.stripOptions(t),r=e.value.split(` `).length,i=Math.max(0,n.length-r),a=Array.from(e.arguments.entries());if(a.length>0){let t;if(i<a.length){let[e,n]=a[i];t=n}else{let e=a[a.length-1][1];e.variadic&&(t=e)}if(t&&t.handler&&typeof t.handler==`function`){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions.push(...n)}}}complete(e){this.directive=s.ShellCompDirectiveNoFileComp;let t=new Set;this.completions.filter(e=>t.has(e.value)?!1:(t.add(e.value),!0)).filter(t=>{if(e.includes(`=`)){let[,n]=e.split(`=`);return t.value.startsWith(n)}return t.value.startsWith(e)}).forEach(e=>console.log(`${e.value}\t${e.description??``}`)),console.log(`:${this.directive}`)}parse(e){this.completions=[];let t=e[e.length-1]===``;t&&e.pop();let n=e[e.length-1]||``,r=e.slice(0,-1);t&&(n!==``&&r.push(n),n=``);let[i]=this.matchCommand(r),a=r[r.length-1];this.shouldCompleteFlags(a,n)?this.handleFlagCompletion(i,r,n,a):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(r,n),i&&i.arguments.size>0&&this.handlePositionalCompletion(i,r)),this.complete(n)}setup(e,t,s){switch(n(s===`zsh`||s===`bash`||s===`fish`||s===`powershell`,`Unsupported shell`),s){case`zsh`:{let n=r(e,t);console.log(n);break}case`bash`:{let n=i(e,t);console.log(n);break}case`fish`:{let n=a(e,t);console.log(n);break}case`powershell`:{let n=o(e,t);console.log(n);break}}}},f={"":[`auth`,`complete`,`dev`,`schema`,`agent-context`,`triggers`],auth:[`login`,`logout`,`whoami`,`create`,`delete`,`activate`,`deactivate`,`list`],triggers:[`deploy`]},p=[{name:`quiet`,alias:`q`,desc:`Suppress non-essential output`},{name:`zone`,alias:`z`,desc:`Zone ID or domain name`},{name:`profile`,desc:`Use a specific auth profile`},{name:`local`,desc:`Route to a local wrangler dev / cf dev Miniflare session`},{name:`local-endpoint`,desc:`Local Miniflare endpoint URL (required with --local)`},{name:`help`,alias:`h`,desc:`Show help`},{name:`version`,alias:`v`,desc:`Show version`}];function m(){return e(import.meta.url,`commands.json`,t)?.commands??[]}function h(){for(let e of p)d.option(e.name,e.desc),e.alias&&d.option(e.alias,`Alias for --${e.name}`);let e=new Set;function t(t){let n=t.join(` `);e.has(n)||(e.add(n),d.command(n,``))}for(let[e,n]of Object.entries(f)){let r=e?e.split(` `):[];for(let e of n)t([...r,e])}let n=m();for(let t of n){if(t.hideCommand)continue;for(let n=1;n<t.fullPath.length;n++){let r=t.fullPath.slice(0,n).join(` `);e.has(r)||(e.add(r),d.command(r,``))}let n=t.fullPath.join(` `);e.add(n);let r=d.command(n,t.description??``);for(let e of t.options??[])e.enum&&e.enum.length>0?r.option(e.name,e.description??``,t=>{for(let n of e.enum??[])t(n,n)}):r.option(e.name,e.description??``)}}const g={command:`complete [shell]`,describe:`Generate and handle shell completions`,builder:e=>e.positional(`shell`,{type:`string`,choices:[`bash`,`zsh`,`fish`,`powershell`],description:`Shell type to generate completions for`}).example(`cf complete bash >> ~/.bashrc`,`Install bash completions (then restart your shell)`).example(`cf complete zsh >> ~/.zshrc`,`Install zsh completions (then restart your shell)`).example(`cf complete fish > ~/.config/fish/completions/cf.fish`,`Install fish completions`),handler:e=>{let t=(e._??[]).map(String),n=t.slice(+(t[0]===`complete`));if(n.length>0){h(),d.parse(n);return}if(!e.shell){process.stderr.write(`Usage: cf complete <bash|zsh|fish|powershell>
800
800
  cf complete bash >> ~/.bashrc
801
801
  `),process.exitCode=1;return}h(),d.setup(`cf`,`cf`,e.shell)}};export{g as default};
@@ -1,3 +1,3 @@
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.option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all',choices:[`verify_full`,`verify_ca`,`disabled`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port 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)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-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 --host-* flag is set`)}return!0})}const h={command:`create`,describe:`Creates a new Workers VPC connectivity service in the account.`,builder:m,handler:async f=>{if(f.dryRun){i({command:`cf connectivity directory services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`The name field`)),f.type===void 0&&(f.type=await u(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <service-id>`,describe:`Removes a single Workers VPC connectivity service by its ID.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf connectivity directory services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){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{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.option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all',choices:[`verify_full`,`verify_ca`,`disabled`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port 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)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-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 --host-* flag is set`)}return!0})}const h={command:`create`,describe:`Creates a new Workers VPC connectivity service in the account.`,builder:m,handler:async f=>{if(f.dryRun){i({command:`cf connectivity directory services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`The name field`)),f.type===void 0&&(f.type=await u(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <service-id>`,describe:`Removes a single Workers VPC connectivity service by its ID.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf connectivity directory services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.connectivity.directory.services.delete({account_id:l,service_id:s[`service-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <service-id>`,describe:`Fetches a single Workers VPC connectivity service by its ID.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf connectivity directory services get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectivity.directory.services.get({account_id:l,service_id:s[`service-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`type`,{type:`string`,description:`Type`,choices:[`tcp`,`http`]}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists the Workers VPC connectivity services in the account.`,builder:p(b),handler:async s=>{let c={type:s.type,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf connectivity directory services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services`,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.connectivity.directory.services.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all',choices:[`verify_full`,`verify_ca`,`disabled`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port 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)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-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 --host-* flag is set`)}return!0})}const C={command:`update <service-id>`,describe:`Updates an existing Workers VPC connectivity service by its ID.`,builder:S,handler:async u=>{if(u.dryRun){i({command:`cf connectivity directory services update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${u[`service-id`]==null?`<service-id>`:encodeURIComponent(String(u[`service-id`]))}`,pathParams:{"service-id":String(u[`service-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({host:{ipv4:l(u[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(u[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(u[`host-ipv6`],`host-ipv6`,`text`),hostname:l(u[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:u[`host-resolver-network-resolver-ips`],tunnel_id:l(u[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(u.name,`name`,`text`),tls_settings:{cert_verification_mode:l(u[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(u.type,`type`,`text`),http_port:u[`http-port`],https_port:u[`https-port`],app_protocol:l(u[`app-protocol`],`app-protocol`,`text`),tcp_port:u[`tcp-port`]}):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.connectivity.directory.services.update({body:e,account_id:f,service_id:u[`service-id`]})),{successLabel:`Updated`});return}let p=c({host:{ipv4:l(u[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(u[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(u[`host-ipv6`],`host-ipv6`,`text`),hostname:l(u[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:u[`host-resolver-network-resolver-ips`],tunnel_id:l(u[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(u.name,`name`,`text`),tls_settings:{cert_verification_mode:l(u[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(u.type,`type`,`text`),http_port:u[`http-port`],https_port:u[`https-port`],app_protocol:l(u[`app-protocol`],`app-protocol`,`text`),tcp_port:u[`tcp-port`]});r(await a(`Updating`,async()=>d.connectivity.directory.services.update({body:p,account_id:f,service_id:u[`service-id`]})),{successLabel:`Updated`})}},w={command:`services`,describe:`Connectivity service entries that define available network endpoints and their properties`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`directory`,describe:`Operations for directory`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`connectivity`,describe:`Service directory for network connectivity endpoints and their configurations`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
@@ -1,2 +1,2 @@
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";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){i({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):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(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});r(await a(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){i({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`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.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
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";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){i({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):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(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});r(await a(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){i({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`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.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +1,2 @@
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{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){i({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
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{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){i({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,2 +1,2 @@
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{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
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{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,3 +1,3 @@
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{t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone 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 p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async u=>{if(u.dryRun){i({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`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(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)});r(await a(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async s=>{if(s.dryRun){i({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await u({force:!!s.force})){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{t as u}from"./prompt-DcfYBioA.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone 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 p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async u=>{if(u.dryRun){i({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`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(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)});r(await a(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async s=>{if(s.dryRun){i({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await u({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.connectors.delete({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <connector-id>`,describe:`Edits properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:g,handler:async u=>{if(u.dryRun){i({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):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.connectors.edit({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});r(await a(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <connector-id>`,describe:`Gets a Magic WAN Connector.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`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.connectors.get({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`device-type`,{type:`string`,description:`Filter connectors by device type.`,choices:[`MANAGED`,`LICENSED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists Magic WAN Connectors.`,builder:d(b),handler:async s=>{let c={device_type:s[`device-type`]};if(s.dryRun){i({command:`cf connectors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors`,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.connectors.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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:`update <connector-id>`,describe:`Updates properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:S,handler:async u=>{if(u.dryRun){i({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):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.connectors.update({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});r(await a(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}},w={command:`connectors`,describe:`connectors`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,4 +1,4 @@
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{n as c,t as l}from"./prompt-DTAWiEm2.mjs";function u(e){return e.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 d={command:`disable`,describe:`Disable Content Scanning.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/disable`,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});if(a.zoneId=s,!await l({force:!!a.force,message:`This operation turns off WAF content scanning for a zone.`})){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{n as c,t as l}from"./prompt-DcfYBioA.mjs";function u(e){return e.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 d={command:`disable`,describe:`Disable Content Scanning.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/disable`,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});if(a.zoneId=s,!await l({force:!!a.force,message:`This operation turns off WAF content scanning for a zone.`})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.contentScanning.disable({zone_id:s})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`enable`,describe:`Enable Content Scanning.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/enable`,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(`Creating`,async()=>o.contentScanning.enable({zone_id:s})),{successLabel:`Created`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of custom scan expressions to add.`})}const h={command:`create`,describe:`Add custom scan expressions for Content Scanning.`,builder:m,handler:async o=>{if(o.dryRun){r({command:`cf content-scanning payloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Creating`,async()=>s.contentScanning.payloads.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`expression-id`,{type:`string`,description:`defines the unique ID for this custom scan expression.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <expression-id>`,describe:`Delete a Content Scan Custom Expression.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning payloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads/${a[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(a[`expression-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"expression-id":String(a[`expression-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.
4
4
  `);return}n(await i(`Deleting`,async()=>o.contentScanning.payloads.delete({zone_id:s,expression_id:a[`expression-id`]})),{successLabel:`Deleted`})}};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:`Get a list of existing custom scan expressions for Content Scanning.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning payloads list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads`,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.contentScanning.payloads.list({zone_id:s})),{successLabel:`Loaded`})}},b={command:`payloads`,describe:`Operations for payloads`,builder:e=>e.command(h).command(_).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:`Retrieve the current status of Content Scanning.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/settings`,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.contentScanning.settings.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning settings to update.`})}const T={command:`update`,describe:`Update the Content Scanning status.`,builder:w,handler:async l=>{if(l.dryRun){r({command:`cf content-scanning update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`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(`Updating`,async()=>u.contentScanning.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.contentScanning.update({...f,zone_id:d})),{successLabel:`Updated`})}},E={command:`content-scanning`,describe:`content-scanning`,builder:e=>e.command(d).command(p).command(T).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E 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";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:`Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ct/alerting`,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.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})}};function l(e){return e.option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
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";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:`Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ct/alerting`,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.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})}};function l(e){return e.option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
3
3
  `}).option(`enabled`,{type:`boolean`,description:`Whether CT alerting is enabled for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CT alerting subscription settings.`})}const u={command:`update`,describe:"Create or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. The `enabled` field is required on every request and controls whether the subscription is active. The `emails` field is optional and, when provided, replaces the stored recipient list for the zone. When `emails` is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit `enabled` are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.",builder:l,handler:async s=>{if(s.dryRun){r({command:`cf ct-alerting update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({emails:s.emails,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(`Updating`,async()=>c.ctAlerting.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({emails:s.emails,enabled:s.enabled});n(await i(`Updating`,async()=>c.ctAlerting.update({...u,zone_id:l})),{successLabel:`Updated`})}},d={command:`ct-alerting`,describe:`ct-alerting`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{D as e}from"./oauth-DBJ5GSFk.mjs";import{i as t,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{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(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 certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
2
+ import{D as e}from"./oauth-DC9g9uK_.mjs";import{i as t,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{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DcfYBioA.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(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 certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
3
3
  Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)});r(await a(`Creating`,async()=>u.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-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 h={command:`delete <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>o.customCertificates.delete({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
5
5
  Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=o(t.body);r(await a(`Updating`,async()=>l.customCertificates.edit({...e,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Updating`,async()=>l.customCertificates.edit({...d,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-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 y={command:`get <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.customCertificates.get({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async t=>{let o={page:t.page,per_page:t[`per-page`],match:t.match,status:t.status};if(t.dryRun){i({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.customCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async s=>{if(s.dryRun){i({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.customCertificates.prioritize.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/custom_certificates/prioritize`)),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{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}from"./input-validation-BwUR9z8e.mjs";import{r as d,t as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const h={command:`customCsrsForAnAccountCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)}):c(e.body)});return}let f=await r(e),p=e.local?s:await n();if(e.accountId=p,e.body){let t=c(e.body);i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...t,account_id:p})),{successLabel:`Created`});return}if(e[`common-name`]===void 0&&(e[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),e.country===void 0&&(e.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),e.locality===void 0&&(e.locality=await d(`locality`,`City or locality name.`)),e.organization===void 0&&(e.organization=await d(`organization`,`Organization name.`)),e.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);e.state===void 0&&(e.state=await d(`state`,`State or province name.`));let m=l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)});i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`customCsrsForAnAccountCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customCsrs.customCsrsForAnAccountCustomCsrDetails({account_id:l,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Loaded`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`customCsrsForAnAccountDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:v,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();if(e.accountId=l,!await f({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{D as e,O as t,w as n}from"./oauth-DC9g9uK_.mjs";import{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}from"./input-validation-BwUR9z8e.mjs";import{r as d,t as f}from"./prompt-DcfYBioA.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const h={command:`customCsrsForAnAccountCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)}):c(e.body)});return}let f=await r(e),p=e.local?s:await n();if(e.accountId=p,e.body){let t=c(e.body);i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...t,account_id:p})),{successLabel:`Created`});return}if(e[`common-name`]===void 0&&(e[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),e.country===void 0&&(e.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),e.locality===void 0&&(e.locality=await d(`locality`,`City or locality name.`)),e.organization===void 0&&(e.organization=await d(`organization`,`Organization name.`)),e.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);e.state===void 0&&(e.state=await d(`state`,`State or province name.`));let m=l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)});i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`customCsrsForAnAccountCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customCsrs.customCsrsForAnAccountCustomCsrDetails({account_id:l,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Loaded`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`customCsrsForAnAccountDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:v,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();if(e.accountId=l,!await f({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.customCsrs.customCsrsForAnAccountDeleteCustomCsr({account_id:l,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Deleted`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`customCsrsForAnAccountListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for an account.`,builder:p(b),handler:async e=>{let c={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.customCsrs.customCsrsForAnAccountListCustomCsrs({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required. The list should include the common name.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const C={command:`customCsrsForAZoneCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for a zone. Cloudflare generates and securely stores the private key associated with the CSR. The CSR can then be provided to a Certificate Authority for signing. Once signed, the certificate is uploaded via the Custom SSL endpoint using the CSR ID.`,builder:S,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({common_name:u(t[`common-name`],`common-name`,`text`),country:u(t.country,`country`,`text`),key_type:u(t[`key-type`],`key-type`,`text`),locality:u(t.locality,`locality`,`text`),organization:u(t.organization,`organization`,`text`),organizational_unit:u(t[`organizational-unit`],`organizational-unit`,`text`),sans:t.sans,state:u(t.state,`state`,`text`)}):c(t.body)});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,t.body){let e=c(t.body);i(await o(`Creating`,async()=>n.customCsrs.customCsrsForAZoneCreateCustomCsr({...e,zone_id:s})),{successLabel:`Created`});return}if(t[`common-name`]===void 0&&(t[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),t.country===void 0&&(t.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),t.locality===void 0&&(t.locality=await d(`locality`,`City or locality name.`)),t.organization===void 0&&(t.organization=await d(`organization`,`Organization name.`)),t.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);t.state===void 0&&(t.state=await d(`state`,`State or province name.`));let f=l({common_name:u(t[`common-name`],`common-name`,`text`),country:u(t.country,`country`,`text`),key_type:u(t[`key-type`],`key-type`,`text`),locality:u(t.locality,`locality`,`text`),organization:u(t.organization,`organization`,`text`),organizational_unit:u(t[`organizational-unit`],`organizational-unit`,`text`),sans:t.sans,state:u(t.state,`state`,`text`)});i(await o(`Creating`,async()=>n.customCsrs.customCsrsForAZoneCreateCustomCsr({...f,zone_id:s})),{successLabel:`Created`})}};function w(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`customCsrsForAZoneCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:w,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs/${t[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(t[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(t[`custom-csr-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.customCsrs.customCsrsForAZoneCustomCsrDetails({zone_id:s,custom_csr_id:t[`custom-csr-id`]})),{successLabel:`Loaded`})}};function E(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR 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 D={command:`customCsrsForAZoneDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key. A CSR cannot be deleted if any custom certificates still reference it.`,builder:E,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs/${t[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(t[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(t[`custom-csr-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>n.customCsrs.customCsrsForAZoneDeleteCustomCsr({zone_id:s,custom_csr_id:t[`custom-csr-id`]})),{successLabel:`Deleted`})}};function O(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`customCsrsForAZoneListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for a zone.`,builder:O,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let s=await r(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,i(await o(`Loading`,async()=>s.customCsrs.customCsrsForAZoneListCustomCsrs({zone_id:c,...n})),{successLabel:`Loaded`})}},A={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(C).command(T).command(D).command(k).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};