cf 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/_meta/agent-context.json +1 -1
  2. package/dist/_meta/commands.json +9 -112
  3. package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
  4. package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
  5. package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
  6. package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
  7. package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
  8. package/dist/ai-B4La9Oqk.mjs +8 -0
  9. package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
  10. package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
  11. package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
  12. package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
  13. package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
  14. package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
  15. package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
  16. package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
  17. package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
  18. package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
  19. package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
  20. package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
  21. package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
  22. package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
  23. package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
  24. package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
  25. package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
  26. package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
  27. package/dist/build-C1FOoThn.mjs +70 -0
  28. package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
  29. package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
  30. package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
  31. package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
  32. package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
  33. package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
  34. package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
  35. package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
  36. package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
  37. package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
  38. package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
  39. package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
  40. package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
  41. package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
  42. package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
  43. package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
  44. package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
  45. package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
  46. package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
  47. package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
  48. package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
  49. package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
  50. package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
  51. package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
  52. package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
  53. package/dist/deploy-D0_KIUpW.mjs +2 -0
  54. package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
  55. package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
  56. package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
  57. package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
  58. package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
  59. package/dist/dist-CnaLMpVH.mjs +18 -0
  60. package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
  61. package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
  62. package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
  63. package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
  64. package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
  65. package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
  66. package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
  67. package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
  68. package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
  69. package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
  70. package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
  71. package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
  72. package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
  73. package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
  74. package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
  75. package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
  76. package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
  77. package/dist/index.mjs +1 -1
  78. package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
  79. package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
  80. package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
  81. package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
  82. package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
  83. package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
  84. package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
  85. package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
  86. package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
  87. package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
  88. package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
  89. package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
  90. package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
  91. package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
  92. package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
  93. package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
  94. package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
  95. package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
  96. package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
  97. package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
  98. package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
  99. package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
  100. package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
  101. package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
  102. package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
  103. package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
  104. package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
  105. package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
  106. package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
  107. package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
  108. package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
  109. package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
  110. package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
  111. package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
  112. package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
  113. package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
  114. package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
  115. package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
  116. package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
  117. package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
  118. package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
  119. package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
  120. package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
  121. package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
  122. package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
  123. package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
  124. package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
  125. package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
  126. package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
  127. package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
  128. package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
  129. package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
  130. package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
  131. package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
  132. package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
  133. package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
  134. package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
  135. package/dist/shared-D0xvDsDl.mjs +2 -0
  136. package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
  137. package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
  138. package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
  139. package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
  140. package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
  141. package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
  142. package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
  143. package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
  144. package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
  145. package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
  146. package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
  147. package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
  148. package/dist/triggers-CYdZhJYr.mjs +2 -0
  149. package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
  150. package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
  151. package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
  152. package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
  153. package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
  154. package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
  155. package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
  156. package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
  157. package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
  158. package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
  159. package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
  160. package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
  161. package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
  162. package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
  163. package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
  164. package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
  165. package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
  166. package/package.json +5 -4
  167. package/dist/ai-BzJg0RIX.mjs +0 -3
  168. package/dist/build-CWuStmDi.mjs +0 -2
  169. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
  170. package/dist/deploy-CVvkZFjR.mjs +0 -2
  171. package/dist/lib-Og5sB51C.mjs +0 -68
  172. package/dist/shared-Bod3-Exx.mjs +0 -990
  173. /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
  174. /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{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,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";import{t as h}from"./cli-types-CFw6Xygp.mjs";import{n as g,t as _}from"./raw-fetch-DgezeshQ.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){a({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):c(m.body)});return}let g=await r(m),_=m.local?s:await t();if(m.accountId=_,m.body){let e=c(m.body);i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await f(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await p(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await f(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&l(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&l(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&l(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&l(v,[`update_mode`],d(m[`update-mode`],`update-mode`,`text`)),i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async n=>{let c={delete_destination:n[`delete-destination`]};if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}`,pathParams:{"sync-id":String(n[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,!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,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DcfYBioA.mjs";import{t as h}from"./cli-types-CFw6Xygp.mjs";import{n as g,t as _}from"./raw-fetch-CeW1mW_u.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){a({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):c(m.body)});return}let g=await r(m),_=m.local?s:await t();if(m.accountId=_,m.body){let e=c(m.body);i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await f(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await p(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await f(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&l(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&l(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&l(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&l(v,[`update_mode`],d(m[`update-mode`],`update-mode`,`text`)),i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async n=>{let c={delete_destination:n[`delete-destination`]};if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}`,pathParams:{"sync-id":String(n[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,!await m({force:!!n.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>l.magicCloudNetworking.catalogSyncs.delete({account_id:u,sync_id:n[`sync-id`],...c})),{successLabel:`Deleted`})}};function b(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}`,pathParams:{"sync-id":String(n[`sync-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),policy:d(n.policy,`policy`,`text`),update_mode:d(n[`update-mode`],`update-mode`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:f,sync_id:n[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),policy:d(n.policy,`policy`,`text`),update_mode:d(n[`update-mode`],`update-mode`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:f,sync_id:n[`sync-id`]})),{successLabel:`Updated`})}};function S(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}`,pathParams:{"sync-id":String(n[`sync-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.get({account_id:l,sync_id:n[`sync-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.list({account_id:l})),{successLabel:`Loaded`})}};function E(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async n=>{let c={destination_type:n[`destination-type`]};if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,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.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:u,...c})),{successLabel:`Loaded`})}},O={command:`prebuilt-policies`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(n[`sync-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.magicCloudNetworking.catalogSyncs.refresh({account_id:l,sync_id:n[`sync-id`]})),{successLabel:`Created`})}};function j(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/catalog-syncs/${n[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(n[`sync-id`]))}`,pathParams:{"sync-id":String(n[`sync-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),policy:d(n.policy,`policy`,`text`),update_mode:d(n[`update-mode`],`update-mode`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.catalogSyncs.update({body:e,account_id:f,sync_id:n[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),policy:d(n.policy,`policy`,`text`),update_mode:d(n[`update-mode`],`update-mode`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.update({body:p,account_id:f,sync_id:n[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_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 F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){a({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),friendly_name:d(m[`friendly-name`],`friendly-name`,`text`)}):c(m.body)});return}let g=await r(m),_=m.local?s:await t();if(m.accountId=_,m.body){let e=c(m.body);i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`cloud-type`]===void 0&&(m[`cloud-type`]=await f(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),m[`friendly-name`]===void 0&&(m[`friendly-name`]=await p(`friendly-name`,`The friendly_name field`));let v={};m[`cloud-type`]!==void 0&&l(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`friendly-name`]!==void 0&&l(v,[`friendly_name`],d(m[`friendly-name`],`friendly-name`,`text`)),i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(e){return e.positional(`provider-id`,{type:`string`,description:`Provider 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 L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}`,pathParams:{"provider-id":String(n[`provider-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.magicCloudNetworking.cloudIntegrations.delete({account_id:l,provider_id:n[`provider-id`]})),{successLabel:`Deleted`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:l})),{successLabel:`Created`})}};function B(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async n=>{let c={v2:n.v2};if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}/discover`,pathParams:{"provider-id":String(n[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Creating`,async()=>l.magicCloudNetworking.cloudIntegrations.discover({account_id:u,provider_id:n[`provider-id`],...c})),{successLabel:`Created`})}};function H(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email 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 U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}`,pathParams:{"provider-id":String(n[`provider-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({aws_arn:d(n[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(n[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(n[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(n.description,`description`,`text`),friendly_name:d(n[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(n[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(n[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:f,provider_id:n[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(n[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(n[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(n[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(n.description,`description`,`text`),friendly_name:d(n[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(n[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(n[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:f,provider_id:n[`provider-id`]})),{successLabel:`Updated`})}};function W(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async n=>{let c={status:n.status};if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}`,pathParams:{"provider-id":String(n[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.get({account_id:u,provider_id:n[`provider-id`],...c})),{successLabel:`Loaded`})}};function K(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(n[`provider-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:l,provider_id:n[`provider-id`]})),{successLabel:`Loaded`})}};function J(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async n=>{let c={status:n.status,order_by:n[`order-by`],desc:n.desc,cloudflare:n.cloudflare};if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers`,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.magicCloudNetworking.cloudIntegrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function X(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email 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 Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/providers/${n[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(n[`provider-id`]))}`,pathParams:{"provider-id":String(n[`provider-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({aws_arn:d(n[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(n[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(n[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(n.description,`description`,`text`),friendly_name:d(n[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(n[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(n[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:f,provider_id:n[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(n[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(n[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(n[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(n.description,`description`,`text`),friendly_name:d(n[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(n[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(n[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:f,provider_id:n[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Cloud provider credentials and integrations for resource discovery and on-ramp provisioning`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes 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 re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({prefixes:n.prefixes}):c(n.body)});return}let l=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:d})),{successLabel:`Updated`});return}if(n.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:n.prefixes});i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:d})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.list({account_id:l})),{successLabel:`Loaded`})}};function oe(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes 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 se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({prefixes:n.prefixes}):c(n.body)});return}let l=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:d})),{successLabel:`Updated`});return}if(n.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:n.prefixes});i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:d})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.magicCloudNetworking.onRamps.apply({account_id:l,onramp_id:n[`onramp-id`]})),{successLabel:`Created`})}};function de(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc 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 fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){a({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({adopted_hub_id:d(m[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:m[`attached-hubs`],attached_vpcs:m[`attached-vpcs`],cloud_asn:m[`cloud-asn`],cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),dynamic_routing:m[`dynamic-routing`],hub_provider_id:d(m[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:m[`install-routes-in-cloud`],install_routes_in_magic_wan:m[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:m[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:m[`manage-vpc-to-hub-attachments`],name:d(m.name,`name`,`text`),region:d(m.region,`region`,`text`),type:d(m.type,`type`,`text`),vpc:d(m.vpc,`vpc`,`text`)}):c(m.body)});return}let g=await r(m),_=m.local?s:await t();if(m.accountId=_,m.body){let e=c(m.body);i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(m[`cloud-type`]===void 0&&(m[`cloud-type`]=await f(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),m[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(m[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(m[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);m.name===void 0&&(m.name=await p(`name`,`The name field`)),m.type===void 0&&(m.type=await f(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};m[`adopted-hub-id`]!==void 0&&l(v,[`adopted_hub_id`],d(m[`adopted-hub-id`],`adopted-hub-id`,`text`)),m[`attached-hubs`]!==void 0&&l(v,[`attached_hubs`],m[`attached-hubs`]),m[`attached-vpcs`]!==void 0&&l(v,[`attached_vpcs`],m[`attached-vpcs`]),m[`cloud-asn`]!==void 0&&l(v,[`cloud_asn`],m[`cloud-asn`]),m[`cloud-type`]!==void 0&&l(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`dynamic-routing`]!==void 0&&l(v,[`dynamic_routing`],m[`dynamic-routing`]),m[`hub-provider-id`]!==void 0&&l(v,[`hub_provider_id`],d(m[`hub-provider-id`],`hub-provider-id`,`text`)),m[`install-routes-in-cloud`]!==void 0&&l(v,[`install_routes_in_cloud`],m[`install-routes-in-cloud`]),m[`install-routes-in-magic-wan`]!==void 0&&l(v,[`install_routes_in_magic_wan`],m[`install-routes-in-magic-wan`]),m[`manage-hub-to-hub-attachments`]!==void 0&&l(v,[`manage_hub_to_hub_attachments`],m[`manage-hub-to-hub-attachments`]),m[`manage-vpc-to-hub-attachments`]!==void 0&&l(v,[`manage_vpc_to_hub_attachments`],m[`manage-vpc-to-hub-attachments`]),m.name!==void 0&&l(v,[`name`],d(m.name,`name`,`text`)),m.region!==void 0&&l(v,[`region`],d(m.region,`region`,`text`)),m.type!==void 0&&l(v,[`type`],d(m.type,`type`,`text`)),m.vpc!==void 0&&l(v,[`vpc`],d(m.vpc,`vpc`,`text`)),i(await o(`Creating`,async()=>n(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async n=>{let c={destroy:n.destroy,force:n.force};if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,!await m({force:!!n.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>l.magicCloudNetworking.onRamps.delete({account_id:u,onramp_id:n[`onramp-id`],...c})),{successLabel:`Deleted`})}};function he(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc 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 ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({attached_hubs:n[`attached-hubs`],attached_vpcs:n[`attached-vpcs`],description:d(n.description,`description`,`text`),install_routes_in_cloud:n[`install-routes-in-cloud`],install_routes_in_magic_wan:n[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:n[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:n[`manage-vpc-to-hub-attachments`],name:d(n.name,`name`,`text`),vpc:d(n.vpc,`vpc`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.onRamps.edit({body:e,account_id:f,onramp_id:n[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:n[`attached-hubs`],attached_vpcs:n[`attached-vpcs`],description:d(n.description,`description`,`text`),install_routes_in_cloud:n[`install-routes-in-cloud`],install_routes_in_magic_wan:n[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:n[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:n[`manage-vpc-to-hub-attachments`],name:d(n.name,`name`,`text`),vpc:d(n.vpc,`vpc`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.edit({body:p,account_id:f,onramp_id:n[`onramp-id`]})),{successLabel:`Updated`})}};function _e(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},bodyKind:`none`});return}await r(n);let i=n.local?s:await t();n.accountId=i;let c=await o(`Loading`,async()=>_(`/accounts/${i}/magic/cloud/onramps/${encodeURIComponent(String(n[`onramp-id`]))}/export`,{method:`POST`,localEndpoint:n.local?n.localEndpoint:void 0}));g(n.text===!0?c.toString(`utf-8`):c)}};function ye(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async n=>{let c={status:n.status,vpcs:n.vpcs,post_apply_resources:n[`post-apply-resources`],planned_resources:n[`planned-resources`]};if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.magicCloudNetworking.onRamps.get({account_id:u,onramp_id:n[`onramp-id`],...c})),{successLabel:`Loaded`})}};function xe(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async n=>{let c={order_by:n[`order-by`],desc:n.desc,status:n.status,vpcs:n.vpcs};if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps`,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.magicCloudNetworking.onRamps.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.magicCloudNetworking.onRamps.plan({account_id:l,onramp_id:n[`onramp-id`]})),{successLabel:`Created`})}};function Te(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc 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 Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/onramps/${n[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(n[`onramp-id`]))}`,pathParams:{"onramp-id":String(n[`onramp-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({attached_hubs:n[`attached-hubs`],attached_vpcs:n[`attached-vpcs`],description:d(n.description,`description`,`text`),install_routes_in_cloud:n[`install-routes-in-cloud`],install_routes_in_magic_wan:n[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:n[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:n[`manage-vpc-to-hub-attachments`],name:d(n.name,`name`,`text`),vpc:d(n.vpc,`vpc`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.onRamps.update({body:e,account_id:f,onramp_id:n[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:n[`attached-hubs`],attached_vpcs:n[`attached-vpcs`],description:d(n.description,`description`,`text`),install_routes_in_cloud:n[`install-routes-in-cloud`],install_routes_in_magic_wan:n[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:n[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:n[`manage-vpc-to-hub-attachments`],name:d(n.name,`name`,`text`),vpc:d(n.vpc,`vpc`,`text`)});i(await o(`Updating`,async()=>l.magicCloudNetworking.onRamps.update({body:p,account_id:f,onramp_id:n[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async n=>{let i={provider_id:n[`provider-id`],resource_type:n[`resource-type`],resource_id:n[`resource-id`],region:n.region,resource_group:n[`resource-group`],search:n.search,order_by:n[`order-by`],desc:n.desc,v2:n.v2};if(n.dryRun){a({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:i,bodyKind:`none`});return}await r(n);let c=n.local?s:await t();n.accountId=c;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await o(`Loading`,async()=>_(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,localEndpoint:n.local?n.localEndpoint:void 0}));g(n.text===!0?u.toString(`utf-8`):u)}};function ke(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async n=>{let c={v2:n.v2};if(n.dryRun){a({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/resources/${n[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(n[`resource-id`]))}`,pathParams:{"resource-id":String(n[`resource-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.magicCloudNetworking.resources.get({account_id:u,resource_id:n[`resource-id`],...c})),{successLabel:`Loaded`})}};function je(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async n=>{let c={provider_id:n[`provider-id`],resource_type:n[`resource-type`],resource_id:n[`resource-id`],region:n.region,resource_group:n[`resource-group`],managed:n.managed,search:n.search,order_by:n[`order-by`],desc:n.desc,per_page:n[`per-page`],page:n.page,cloudflare:n.cloudflare,v2:n.v2};if(n.dryRun){a({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/resources`,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.magicCloudNetworking.resources.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ne(e){return e.option(`policy`,{type:`string`,description:`The policy 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 Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async n=>{if(n.dryRun){a({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({policy:d(n.policy,`policy`,`text`)}):c(n.body)});return}let l=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()=>l.magicCloudNetworking.resources.policyPreview({...e,account_id:f})),{successLabel:`Created`});return}n.policy===void 0&&(n.policy=await p(`policy`,`The policy field`));let m=u({policy:d(n.policy,`policy`,`text`)});i(await o(`Creating`,async()=>l.magicCloudNetworking.resources.policyPreview({...m,account_id:f})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Discovered cloud resources (VPCs, subnets, route tables) from connected cloud accounts`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
@@ -1,4 +1,4 @@
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";function p(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new network monitoring configuration.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.magicNetworkMonitoring.configs.create({...e,account_id:p})),{successLabel:`Created`});return}if(u[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);u.name===void 0&&(u.name=await d(`name`,`The account name.`));let m=c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]});r(await a(`Creating`,async()=>f.magicNetworkMonitoring.configs.create({...m,account_id:p})),{successLabel:`Created`})}};function h(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 g={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},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";function p(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new network monitoring configuration.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.magicNetworkMonitoring.configs.create({...e,account_id:p})),{successLabel:`Created`});return}if(u[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);u.name===void 0&&(u.name=await d(`name`,`The account name.`));let m=c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]});r(await a(`Creating`,async()=>f.magicNetworkMonitoring.configs.create({...m,account_id:p})),{successLabel:`Created`})}};function h(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 g={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},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.magicNetworkMonitoring.configs.delete({account_id:l})),{successLabel:`Deleted`})}};function _(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:_,handler:async u=>{if(u.dryRun){i({command:`cf magic-network-monitoring configs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]}):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.magicNetworkMonitoring.configs.edit({...e,account_id:f})),{successLabel:`Updated`});return}let p=c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]});r(await a(`Updating`,async()=>d.magicNetworkMonitoring.configs.edit({...p,account_id:f})),{successLabel:`Updated`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring configs full get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config/full`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.magicNetworkMonitoring.configs.full.get({account_id:l})),{successLabel:`Loaded`})}},x={command:`full`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,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 default sampling, router IPs and warp devices for account.`,builder:S,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.magicNetworkMonitoring.configs.get({account_id:l})),{successLabel:`Loaded`})}};function w(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:w,handler:async u=>{if(u.dryRun){i({command:`cf magic-network-monitoring configs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Updating`,async()=>f.magicNetworkMonitoring.configs.update({...e,account_id:p})),{successLabel:`Updated`});return}if(u[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);u.name===void 0&&(u.name=await d(`name`,`The account name.`));let m=c({default_sampling:u[`default-sampling`],name:l(u.name,`name`,`text`),router_ips:u[`router-ips`]});r(await a(`Updating`,async()=>f.magicNetworkMonitoring.configs.update({...m,account_id:p})),{successLabel:`Updated`})}},E={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(m).command(g).command(v).command(C).command(T).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:D,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring rules advertisements edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules/${s[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(s[`rule-id`]))}/advertisement`,pathParams:{"rule-id":String(s[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Updating`,async()=>c.magicNetworkMonitoring.rules.advertisements.edit({account_id:l,rule_id:s[`rule-id`]})),{successLabel:`Updated`})}},k={command:`advertisements`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`],default:`1m`}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:A,handler:async f=>{if(f.dryRun){i({command:`cf magic-network-monitoring rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)}):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.magicNetworkMonitoring.rules.create({body:e,account_id:m})),{successLabel:`Created`});return}if(f[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(f.name===void 0&&(f.name=await d(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),f.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);f.type===void 0&&(f.type=await u(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)});r(await a(`Creating`,async()=>p.magicNetworkMonitoring.rules.create({body:h,account_id:m})),{successLabel:`Created`})}};function M(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:M,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules/${s[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(s[`rule-id`]))}`,pathParams:{"rule-id":String(s[`rule-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.
4
4
  `);return}r(await a(`Deleting`,async()=>c.magicNetworkMonitoring.rules.delete({account_id:l,rule_id:s[`rule-id`]})),{successLabel:`Deleted`})}};function P(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).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:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:P,handler:async f=>{if(f.dryRun){i({command:`cf magic-network-monitoring rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules/${f[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(f[`rule-id`]))}`,pathParams:{"rule-id":String(f[`rule-id`]??``)},bodyKind:`json`,body:f.body===void 0?c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)}):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(`Updating`,async()=>p.magicNetworkMonitoring.rules.edit({body:e,account_id:m,rule_id:f[`rule-id`]})),{successLabel:`Updated`});return}if(f[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(f.name===void 0&&(f.name=await d(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),f.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);f.type===void 0&&(f.type=await u(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)});r(await a(`Updating`,async()=>p.magicNetworkMonitoring.rules.edit({body:h,account_id:m,rule_id:f[`rule-id`]})),{successLabel:`Updated`})}};function I(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <rule-id>`,describe:`List a single network monitoring rule for account.`,builder:I,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules/${s[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(s[`rule-id`]))}`,pathParams:{"rule-id":String(s[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.magicNetworkMonitoring.rules.get({account_id:l,rule_id:s[`rule-id`]})),{successLabel:`Loaded`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Lists network monitoring rules for account.`,builder:R,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.magicNetworkMonitoring.rules.list({account_id:l})),{successLabel:`Loaded`})}};function B(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).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:`update`,describe:`Update network monitoring rules for account.`,builder:B,handler:async f=>{if(f.dryRun){i({command:`cf magic-network-monitoring rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)}):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(`Updating`,async()=>p.magicNetworkMonitoring.rules.update({body:e,account_id:m})),{successLabel:`Updated`});return}if(f[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(f.name===void 0&&(f.name=await d(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),f.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);f.type===void 0&&(f.type=await u(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=c({automatic_advertisement:f[`automatic-advertisement`],bandwidth_threshold:f[`bandwidth-threshold`],duration:l(f.duration,`duration`,`text`),name:l(f.name,`name`,`text`),packet_threshold:f[`packet-threshold`],prefix_match:l(f[`prefix-match`],`prefix-match`,`text`),prefixes:f.prefixes,type:l(f.type,`type`,`text`),zscore_sensitivity:l(f[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:l(f[`zscore-target`],`zscore-target`,`text`)});r(await a(`Updating`,async()=>p.magicNetworkMonitoring.rules.update({body:h,account_id:m})),{successLabel:`Updated`})}},H={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(V).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:U,handler:async s=>{if(s.dryRun){i({command:`cf magic-network-monitoring vpc-flows tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mnm/vpc-flows/token`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.magicNetworkMonitoring.vpcFlows.tokens.create({account_id:l})),{successLabel:`Created`})}},G={command:`tokens`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`vpc-flows`,describe:`Operations for vpc-flows`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(E).command(H).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q 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,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";import{n as h,t as g}from"./raw-fetch-DgezeshQ.mjs";function _(e){return e.option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mode`,{type:`string`,description:`The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const ee={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:_,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),name:d(n.name,`name`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:d(n.scope,`scope`,`text`)}):c(n.body)});return}let l=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()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:f})),{successLabel:`Created`});return}n[`burst-sensitivity`]===void 0&&(n[`burst-sensitivity`]=await p(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),n.mode===void 0&&(n.mode=await p(`mode`,`The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'.`)),n.name===void 0&&(n.name=await p(`name`,`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),n[`profile-sensitivity`]===void 0&&(n[`profile-sensitivity`]=await p(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),n[`rate-sensitivity`]===void 0&&(n[`rate-sensitivity`]=await p(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),n.scope===void 0&&(n.scope=await p(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let m=u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),name:d(n.name,`name`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:d(n.scope,`scope`,`text`)});i(await o(`Creating`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...m,account_id:f})),{successLabel:`Created`})}};function te(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 v={command:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:te,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},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,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DcfYBioA.mjs";import{n as h,t as g}from"./raw-fetch-CeW1mW_u.mjs";function _(e){return e.option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mode`,{type:`string`,description:`The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const ee={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:_,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),name:d(n.name,`name`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:d(n.scope,`scope`,`text`)}):c(n.body)});return}let l=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()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:f})),{successLabel:`Created`});return}n[`burst-sensitivity`]===void 0&&(n[`burst-sensitivity`]=await p(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),n.mode===void 0&&(n.mode=await p(`mode`,`The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'.`)),n.name===void 0&&(n.name=await p(`name`,`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),n[`profile-sensitivity`]===void 0&&(n[`profile-sensitivity`]=await p(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),n[`rate-sensitivity`]===void 0&&(n[`rate-sensitivity`]=await p(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),n.scope===void 0&&(n.scope=await p(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let m=u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),name:d(n.name,`name`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:d(n.scope,`scope`,`text`)});i(await o(`Creating`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...m,account_id:f})),{successLabel:`Created`})}};function te(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 v={command:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:te,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.for.account({account_id:l})),{successLabel:`Deleted`})}},y={command:`for`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule 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 x={command:`rule <rule-id>`,describe:`Delete a DNS Protection rule specified by the given UUID.`,builder:b,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete protection rule`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.protection.rule({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Deleted`})}},S={command:`protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`delete`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete`,builder:e=>e.command(y).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <rule-id>`,describe:`Get a DNS Protection rule specified by the given UUID.`,builder:w,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.get({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List all DNS Protection rules for an account.`,builder:E,handler:async n=>{let c={page:n.page,per_page:n[`per-page`],order:n.order,direction:n.direction};if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.list({account_id:u,...c})),{successLabel:`Loaded`})}};function O(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to update.`,demandOption:!0}).option(`block-any-queries`,{type:`boolean`,description:`The new value for whether to block DNS ANY queries. Optional.`}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`mode`,{type:`string`,description:`The new mode for DNS Protection. Optional. Must be one of 'enabled', 'disabled', 'monitoring'.`}).option(`profile-sensitivity`,{type:`string`,description:`The new profile sensitivity. Optional. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the DNS Protection rule.`})}const k={command:`update <rule-id>`,describe:`Update a DNS Protection rule specified by the given UUID.`,builder:O,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-dns-protection configs dns protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`)}):c(n.body)});return}let l=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()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...e,account_id:f,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}let p=u({block_any_queries:n[`block-any-queries`],burst_sensitivity:d(n[`burst-sensitivity`],`burst-sensitivity`,`text`),mode:d(n.mode,`mode`,`text`),profile_sensitivity:d(n[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:d(n[`rate-sensitivity`],`rate-sensitivity`,`text`)});i(await o(`Updating`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...p,account_id:f,rule_id:n[`rule-id`]})),{successLabel:`Updated`})}},A={command:`rules`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(ee).command(T).command(D).command(k).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`advanced-dns-protection`,describe:`Operations for advanced-dns-protection`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const I={command:`create`,describe:`Create an allowlist prefix for an account.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-tcp-protection configs allowlist create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({comment:d(n.comment,`comment`,`text`),enabled:n.enabled,prefix:d(n.prefix,`prefix`,`text`)}):c(n.body)});return}let l=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()=>l.magicTransit.advancedTcpProtection.configs.allowlist.create({...e,account_id:f})),{successLabel:`Created`});return}if(n.comment===void 0&&(n.comment=await p(`comment`,`An comment describing the allowlist prefix.`)),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.prefix===void 0&&(n.prefix=await p(`prefix`,`The allowlist prefix to add in CIDR format.`));let m=u({comment:d(n.comment,`comment`,`text`),enabled:n.enabled,prefix:d(n.prefix,`prefix`,`text`)});i(await o(`Creating`,async()=>l.magicTransit.advancedTcpProtection.configs.allowlist.create({...m,account_id:f})),{successLabel:`Created`})}};function L(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix 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 R={command:`prefix <prefix-id>`,describe:`Delete the allowlist prefix for an account given a UUID.`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${n[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(n[`prefix-id`]))}`,pathParams:{"prefix-id":String(n[`prefix-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.magicTransit.advancedTcpProtection.configs.allowlist.delete.allowlist.prefix({account_id:l,prefix_id:n[`prefix-id`]})),{successLabel:`Deleted`})}},z={command:`allowlist`,describe:`Advanced Tcp Protection operations`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(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 V={command:`account`,describe:`Delete all allowlist prefixes for an account.`,builder:B,handler:async n=>{if(n.dryRun){a({command:`cf magic-transit advanced-tcp-protection configs allowlist delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},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.
@@ -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}from"./body-parser-BO6mfo_W.mjs";import{t as o}from"./prompt-DTAWiEm2.mjs";function s(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 c={command:`delete`,describe:`Disables all Managed Transforms.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});if(a.zoneId=c,!await o({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}from"./body-parser-BO6mfo_W.mjs";import{t as o}from"./prompt-DcfYBioA.mjs";function s(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 c={command:`delete`,describe:`Disables all Managed Transforms.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});if(a.zoneId=c,!await o({force:!!a.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>s.managedTransforms.delete({zone_id:c})),{successLabel:`Deleted`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const u={command:`edit`,describe:`Updates the status of one or more Managed Transforms.`,builder:l,handler:async o=>{if(o.dryRun){r({command:`cf managed-transforms edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/managed_headers`,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.managedTransforms.edit({...e,zone_id:c})),{successLabel:`Updated`});return}n(await i(`Updating`,async()=>s.managedTransforms.edit({zone_id:c})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,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.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}},p={command:`managed-transforms`,describe:`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,builder:e=>e.command(c).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";function s(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:s,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){i({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/matches/download`,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.matches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for string queries based on ID`,builder:u,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){i({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/matches`,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.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`matches`,describe:`matches`,builder:e=>e.command(d).command(l).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";function s(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:s,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){i({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/matches/download`,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.matches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for string queries based on ID`,builder:u,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){i({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/matches`,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.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`matches`,describe:`matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f 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{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.option(`name`,{type:`string`,description:`Human-readable name for the relay.`}).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:"Provisions a new MoQ relay instance. Auto-creates a publish+subscribe token and a subscribe-only token. Token values are included in the response (shown once). Config is always set to defaults (upstreams off) and cannot be supplied here — sending a non-empty `config` is rejected (21014); `null` or `{}` is accepted as absent. Use PUT to configure the relay after it exists.",builder:f,handler:async d=>{if(d.dryRun){i({command:`cf moq relays create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/moq/relays`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.moq.relays.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Human-readable name for the relay.`));let m=c({name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.moq.relays.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,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 <relay-id>`,describe:"Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.",builder:m,handler:async s=>{if(s.dryRun){i({command:`cf moq relays delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Deleting this relay revokes every token issued for it, so publishers and subscribers can no longer connect. This cannot be undone.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DcfYBioA.mjs";function f(e){return e.option(`name`,{type:`string`,description:`Human-readable name for the relay.`}).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:"Provisions a new MoQ relay instance. Auto-creates a publish+subscribe token and a subscribe-only token. Token values are included in the response (shown once). Config is always set to defaults (upstreams off) and cannot be supplied here — sending a non-empty `config` is rejected (21014); `null` or `{}` is accepted as absent. Use PUT to configure the relay after it exists.",builder:f,handler:async d=>{if(d.dryRun){i({command:`cf moq relays create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/moq/relays`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.moq.relays.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Human-readable name for the relay.`));let m=c({name:l(d.name,`name`,`text`)});r(await a(`Creating`,async()=>f.moq.relays.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,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 <relay-id>`,describe:"Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.",builder:m,handler:async s=>{if(s.dryRun){i({command:`cf moq relays delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Deleting this relay revokes every token issued for it, so publishers and subscribers can no longer connect. This cannot be undone.`})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.moq.relays.delete({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <relay-id>`,describe:`Retrieves a single MoQ relay including config and status. Tokens are NOT included.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf moq relays get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.moq.relays.get({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`created-before`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly before this
4
4
  RFC 3339 timestamp (typically the \`created\` value of the first item
5
5
  on the current page, to fetch the previous page).`}).option(`created-after`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly after this
@@ -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{r as u,t as d}from"./prompt-DTAWiEm2.mjs";import{t as f}from"./cli-types-CFw6Xygp.mjs";function p(e){return e.positional(`mtls-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 m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async s=>{if(s.dryRun){i({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async d=>{if(d.dryRun){i({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-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 y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({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{r as u,t as d}from"./prompt-DcfYBioA.mjs";import{t as f}from"./cli-types-CFw6Xygp.mjs";function p(e){return e.positional(`mtls-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 m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async s=>{if(s.dryRun){i({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async d=>{if(d.dryRun){i({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-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 y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.mtlsCertificates.delete({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-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 x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async s=>{if(s.dryRun){i({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.mtlsCertificates.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async s=>{let c={type:s.type};if(s.dryRun){i({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/mtls_certificates`,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.mtlsCertificates.list({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w 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{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DcfYBioA.mjs";function f(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
3
3
 
4
4
  Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
5
5
  key is not treated as a secret value. This is *only* supported for preventing
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,o as t,r as n,t as r}from"./chunk-DH-VkVmc.mjs";import{a as i,i as a,o,s,t as c}from"./session-B1ARgLG7.mjs";import{t as l}from"./resolve-Bs2sMRYS.mjs";import{i as u,o as d,s as f}from"./dist-B7hsuvbF.mjs";import{a as p,n as m,t as h}from"./cf-BLT7uKJF.mjs";import{statSync as g}from"node:fs";import _ from"node:os";import{dirname as v,join as y,resolve as b}from"node:path";import{styleText as x}from"node:util";import S,{stdin as C,stdout as w}from"node:process";import ee from"node:tty";import te from"node:readline";const ne=`cloudflare.config.ts`;let T;function re(e=process.cwd()){let t=b(e);for(;;){let e=y(t,ne);try{if(g(e).isFile())return e}catch{}let n=v(t);if(n===t)return null;t=n}}async function ie(e=process.cwd()){let t=b(e);T=void 0;let n=re(t);if(!n)return T={startDir:t,result:null},null;let{loadAndValidateConfig:r}=await import(`./dist-BH-4NQOV.mjs`).then(e=>e.i),i=await r(n,{mode:void 0},{include:[`settings`]});if(!i.result.success){let e=i.result.error.issues.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
2
+ import{i as e,o as t,r as n,t as r}from"./chunk-DH-VkVmc.mjs";import{a as i,i as a,o,s,t as c}from"./session-CQpgz61H.mjs";import{t as l}from"./resolve-Bs2sMRYS.mjs";import{i as u,o as d,s as f}from"./dist-B7hsuvbF.mjs";import{a as p,n as m,t as h}from"./cf-BhDnTcDR.mjs";import{statSync as g}from"node:fs";import _ from"node:os";import{dirname as v,join as y,resolve as b}from"node:path";import{styleText as x}from"node:util";import S,{stdin as C,stdout as w}from"node:process";import ee from"node:tty";import te from"node:readline";const ne=`cloudflare.config.ts`;let T;function re(e=process.cwd()){let t=b(e);for(;;){let e=y(t,ne);try{if(g(e).isFile())return e}catch{}let n=v(t);if(n===t)return null;t=n}}async function ie(e=process.cwd()){let t=b(e);T=void 0;let n=re(t);if(!n)return T={startDir:t,result:null},null;let{loadAndValidateConfig:r}=await import(`./dist-C-6VkMPZ.mjs`).then(e=>e.n),i=await r(n,{mode:void 0},{include:[`settings`]});if(!i.result.success){let e=i.result.error.issues.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
3
3
  `);throw Error(`Invalid ${ne}:\n${e}`)}let a=i.result.data.settings,o={path:n,settings:a?.type===`settings`?a:void 0};return T={startDir:t,result:o},o}function ae(e=process.cwd()){let t=b(e);return T?.startDir===t?T.result:void 0}function oe(e,t){if(t)return{value:t,source:`flag`};let n=process.env[e];if(n)return{value:n,source:`env`}}async function se(){let e=process.env.CLOUDFLARE_ACCOUNT_ID;if(e)return{value:e,source:`env`};let t=ae(),n=t===void 0?await ie():t;if(n?.settings?.accountId)return{value:n.settings.accountId,source:`settings`,path:n.path}}async function ce(){return(await se())?.value}async function le(){let e=await se();e&&ue(e.value,ve(e,`accountId`));let{getOrSelectAccountId:t}=await Promise.resolve().then(()=>dn);return t(e?.value)}function ue(e,t){if(!process.env.DEBUG)return;let n=e.length>12?e.slice(0,12)+`…`:e;process.stderr.write(`Using account: ${n} (${t})\n`)}async function de(e,t,n){if(e?.zoneId)return fe(e.zoneId,t);let r=oe(`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=ve(r);console.error(`Using zone: ${r.value} (from ${e})`)}return fe(r.value,t)}throw Error(`No zone specified.
4
4
 
5
5
  Please provide one of the following:
@@ -1,4 +1,4 @@
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(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck 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 h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async f=>{if(f.dryRun){i({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]}):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.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(f[`configuration-type`]===void 0&&(f[`configuration-type`]=await u(`configuration-type`,`The configuration.type field`,[`logpush`])),f[`configuration-url`]===void 0&&(f[`configuration-url`]=await d(`configuration-url`,`The configuration.url field`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f.name===void 0&&(f.name=await d(`name`,`The name field`));let h=c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]});r(await a(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,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 <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations/${s.slug==null?`<slug>`:encodeURIComponent(String(s.slug))}`,pathParams:{slug:String(s.slug??``)},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(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck 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 h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async f=>{if(f.dryRun){i({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]}):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.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(f[`configuration-type`]===void 0&&(f[`configuration-type`]=await u(`configuration-type`,`The configuration.type field`,[`logpush`])),f[`configuration-url`]===void 0&&(f[`configuration-url`]=await d(`configuration-url`,`The configuration.url field`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f.name===void 0&&(f.name=await d(`name`,`The name field`));let h=c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]});r(await a(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,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 <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations/${s.slug==null?`<slug>`:encodeURIComponent(String(s.slug))}`,pathParams:{slug:String(s.slug??``)},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.observability.destinations.delete({account_id:l,slug:s.slug})),{successLabel:`Deleted`})}};function v(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List your Workers Observability Telemetry Destinations.`,builder:p(v),handler:async s=>{let c={page:s.page,perPage:s[`per-page`],order:s.order,orderBy:s[`order-by`]};if(s.dryRun){i({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations`,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.observability.destinations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function b(e){return e.positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled 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:`update <slug>`,describe:`Update an existing Workers Observability Telemetry Destination.`,builder:b,handler:async f=>{if(f.dryRun){i({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/destinations/${f.slug==null?`<slug>`:encodeURIComponent(String(f.slug))}`,pathParams:{slug:String(f.slug??``)},bodyKind:`json`,body:f.body===void 0?c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled}):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(`Updating`,async()=>p.observability.destinations.update({...e,account_id:m,slug:f.slug})),{successLabel:`Updated`});return}if(f[`configuration-type`]===void 0&&(f[`configuration-type`]=await u(`configuration-type`,`The configuration.type field`,[`logpush`])),f[`configuration-url`]===void 0&&(f[`configuration-url`]=await d(`configuration-url`,`The configuration.url field`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled});r(await a(`Updating`,async()=>p.observability.destinations.update({...h,account_id:m,slug:f.slug})),{successLabel:`Updated`})}},S={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const w={command:`create`,describe:`Persist query for later use.`,builder:C,handler:async u=>{if(u.dryRun){i({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({description:l(u.description,`description`,`text`),name:l(u.name,`name`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}u.description===void 0&&(u.description=await d(`description`,`The description field`)),u.name===void 0&&(u.name=await d(`name`,`Query name`)),u[`parameters-order-by-value`]===void 0&&(u[`parameters-order-by-value`]=await d(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=c({description:l(u.description,`description`,`text`),name:l(u.name,`name`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});r(await a(`Creating`,async()=>f.observability.queries.create({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,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 E={command:`delete <queryId>`,describe:`Delete a saved query.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/queries/${s[`query-id`]==null?`<query-id>`:encodeURIComponent(String(s[`query-id`]))}`,pathParams:{"query-id":String(s[`query-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.
4
4
  `);return}r(await a(`Deleting`,async()=>c.observability.queries.delete({account_id:l,queryId:s[`query-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const O={command:`edit <queryId>`,describe:`Update saved query.`,builder:D,handler:async u=>{if(u.dryRun){i({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/queries/${u[`query-id`]==null?`<query-id>`:encodeURIComponent(String(u[`query-id`]))}`,pathParams:{"query-id":String(u[`query-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({description:l(u.description,`description`,`text`),name:l(u.name,`name`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Updating`,async()=>f.observability.queries.edit({...e,account_id:p,queryId:u[`query-id`]})),{successLabel:`Updated`});return}u.description===void 0&&(u.description=await d(`description`,`The description field`)),u.name===void 0&&(u.name=await d(`name`,`Query name`)),u[`parameters-order-by-value`]===void 0&&(u[`parameters-order-by-value`]=await d(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=c({description:l(u.description,`description`,`text`),name:l(u.name,`name`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});r(await a(`Updating`,async()=>f.observability.queries.edit({...m,account_id:p,queryId:u[`query-id`]})),{successLabel:`Updated`})}};function k(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <queryId>`,describe:`Retrieve a saved query.`,builder:k,handler:async s=>{if(s.dryRun){i({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/queries/${s[`query-id`]==null?`<query-id>`:encodeURIComponent(String(s[`query-id`]))}`,pathParams:{"query-id":String(s[`query-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.observability.queries.get({account_id:l,queryId:s[`query-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List saved queries.`,builder:p(j),handler:async s=>{let c={page:s.page,perPage:s[`per-page`],order:s.order,orderBy:s[`order-by`]};if(s.dryRun){i({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/queries`,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.observability.queries.list({account_id:u,...c})),{successLabel:`Loaded`})}},N={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const F={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:P,handler:async l=>{if(l.dryRun){i({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({datasets:l.datasets,from:l.from,keyNeedle:{isRegex:l[`key-needle-is-regex`],matchCase:l[`key-needle-match-case`]},limit:l.limit,needle:{isRegex:l[`needle-is-regex`],matchCase:l[`needle-match-case`]},to:l.to}):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.observability.telemetry.keys({...e,account_id:d})),{successLabel:`Created`});return}let f=c({datasets:l.datasets,from:l.from,keyNeedle:{isRegex:l[`key-needle-is-regex`],matchCase:l[`key-needle-match-case`]},limit:l.limit,needle:{isRegex:l[`needle-is-regex`],matchCase:l[`needle-match-case`]},to:l.to});r(await a(`Creating`,async()=>u.observability.telemetry.keys({...f,account_id:d})),{successLabel:`Created`})}};function I(e){return e.option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].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 --parameters-* flag is set`)}return!0})}const L={command:`query`,describe:`Run a temporary or saved query.`,builder:I,handler:async u=>{if(u.dryRun){i({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({chart:u.chart,chartType:l(u[`chart-type`],`chart-type`,`text`),compare:u.compare,dry:u.dry,granularity:u.granularity,ignoreSeries:u[`ignore-series`],limit:u.limit,offset:l(u.offset,`offset`,`text`),offsetBy:u[`offset-by`],offsetDirection:l(u[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(u[`query-id`],`query-id`,`text`),timeframe:{from:u[`timeframe-from`],to:u[`timeframe-to`]},view:l(u.view,`view`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Loading`,async()=>f.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(u[`query-id`]===void 0&&(u[`query-id`]=await d(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),u[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(u[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=c({chart:u.chart,chartType:l(u[`chart-type`],`chart-type`,`text`),compare:u.compare,dry:u.dry,granularity:u.granularity,ignoreSeries:u[`ignore-series`],limit:u.limit,offset:l(u.offset,`offset`,`text`),offsetBy:u[`offset-by`],offsetDirection:l(u[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:u[`parameters-datasets`],filterCombination:l(u[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:u[`parameters-limit`],needle:{isRegex:u[`parameters-needle-is-regex`],matchCase:u[`parameters-needle-match-case`]},orderBy:{order:l(u[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(u[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(u[`query-id`],`query-id`,`text`),timeframe:{from:u[`timeframe-from`],to:u[`timeframe-to`]},view:l(u.view,`view`,`text`)});r(await a(`Loading`,async()=>f.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function R(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const z={command:`values`,describe:`List unique values found in your events.`,builder:R,handler:async f=>{if(f.dryRun){i({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({datasets:f.datasets,key:l(f.key,`key`,`text`),limit:f.limit,needle:{isRegex:f[`needle-is-regex`],matchCase:f[`needle-match-case`]},timeframe:{from:f[`timeframe-from`],to:f[`timeframe-to`]},type:l(f.type,`type`,`text`)}):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.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(f.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(f.key===void 0&&(f.key=await d(`key`,`The key field`)),f[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(f[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);f.type===void 0&&(f.type=await u(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=c({datasets:f.datasets,key:l(f.key,`key`,`text`),limit:f.limit,needle:{isRegex:f[`needle-is-regex`],matchCase:f[`needle-match-case`]},timeframe:{from:f[`timeframe-from`],to:f[`timeframe-to`]},type:l(f.type,`type`,`text`)});r(await a(`Creating`,async()=>p.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},B={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`observability`,describe:`observability`,builder:e=>e.command(S).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./chunk-6IEM75FG-BEjRFMGh.mjs";import t from"node:fs";import n from"node:os";import r from"node:path";import i,{execFile as a}from"node:child_process";import{promisify as o}from"node:util";import{Buffer as s}from"node:buffer";import{fileURLToPath as c}from"node:url";import l,{constants as u}from"node:fs/promises";import d from"node:process";var f;function p(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}e(p,`hasDockerEnv`);function m(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}e(m,`hasDockerCGroup`);function h(){return f===void 0&&(f=p()||m()),f}e(h,`isDocker`);var g,_=e(()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}},`hasContainerEnv`);function v(){return g===void 0&&(g=_()||h()),g}e(v,`isInsideContainer`);var y=e(()=>{if(d.platform!==`linux`)return!1;if(n.release().toLowerCase().includes(`microsoft`))return!v();try{return t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!v():!1}catch{return!1}},`isWsl`),b=d.env.__IS_WSL_TEST__?y:y(),ee=o(i.execFile),x=e(()=>`${d.env.SYSTEMROOT||d.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,`powerShellPath`),S=e(async(e,t={})=>{let{powerShellPath:n,...r}=t,i=S.encodeCommand(e);return ee(n??x(),[...S.argumentsPrefix,i],{encoding:`utf8`,...r})},`executePowerShell`);S.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],S.encodeCommand=e=>s.from(e,`utf16le`).toString(`base64`),S.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function C(e){for(let t of e.split(`
2
+ import{r as e}from"./chunk-Q72B4Q5Z-B-N_eqrM.mjs";import t from"node:fs";import n from"node:os";import r from"node:path";import i,{execFile as a}from"node:child_process";import{promisify as o}from"node:util";import{Buffer as s}from"node:buffer";import{fileURLToPath as c}from"node:url";import l,{constants as u}from"node:fs/promises";import d from"node:process";var f;function p(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}e(p,`hasDockerEnv`);function m(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}e(m,`hasDockerCGroup`);function h(){return f===void 0&&(f=p()||m()),f}e(h,`isDocker`);var g,_=e(()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}},`hasContainerEnv`);function v(){return g===void 0&&(g=_()||h()),g}e(v,`isInsideContainer`);var y=e(()=>{if(d.platform!==`linux`)return!1;if(n.release().toLowerCase().includes(`microsoft`))return!v();try{return t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!v():!1}catch{return!1}},`isWsl`),b=d.env.__IS_WSL_TEST__?y:y(),ee=o(i.execFile),x=e(()=>`${d.env.SYSTEMROOT||d.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,`powerShellPath`),S=e(async(e,t={})=>{let{powerShellPath:n,...r}=t,i=S.encodeCommand(e);return ee(n??x(),[...S.argumentsPrefix,i],{encoding:`utf8`,...r})},`executePowerShell`);S.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],S.encodeCommand=e=>s.from(e,`utf16le`).toString(`base64`),S.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function C(e){for(let t of e.split(`
3
3
  `)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}e(C,`parseMountPointFromConfig`);var te=o(i.execFile),ne=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await l.access(n,u.F_OK),r=!0}catch{}if(!r)return e;let i=C(await l.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),w=b?e(async()=>`${await ne()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,`powerShellPathFromWsl`):x,T,E=e(async()=>(T??=(async()=>{try{let e=await w();return await l.access(e,u.X_OK),!0}catch{return!1}})(),T),`canAccessPowerShell`),D=e(async()=>{let e=await w(),{stdout:t}=await S(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},`wslDefaultBrowser`),O=e(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await te(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}},`convertWslPathToWindows`);function k(t,n,r){let i=e(e=>Object.defineProperty(t,n,{value:e,enumerable:!0,writable:!0}),`define`);return Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let e=r();return i(e),e},set(e){i(e)}}),t}e(k,`defineLazyProperty`);var A=o(a);async function j(){if(d.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await A(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}e(j,`defaultBrowserId`);var M=o(a);async function N(e,{humanReadableOutput:t=!0,signal:n}={}){if(d.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await M(`osascript`,[`-e`,e,r],i);return a.trim()}e(N,`runAppleScript`);async function P(e){return N(`tell application "Finder" to set app_path to application file id "${e}" as string
4
4
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}e(P,`bundleName`);var F=o(a),I={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},L=new Map(Object.entries(I)),R=class extends Error{static{e(this,`UnknownBrowserError`)}};async function z(e=F){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new R(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=I[r];if(!i)throw new R(`Unknown browser ID: ${r}`);return i}e(z,`defaultBrowser`);var B=o(a),V=e(e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),`titleize`);async function H(){if(d.platform===`darwin`){let e=await j();return{name:await P(e),id:e}}if(d.platform===`linux`){let{stdout:e}=await B(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:V(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(d.platform===`win32`)return z();throw Error(`Only macOS, Linux, and Windows are supported`)}e(H,`defaultBrowser`);var U=!!(d.env.SSH_CONNECTION||d.env.SSH_CLIENT||d.env.SSH_TTY),W=Symbol(`fallbackAttempt`),G=import.meta.url?r.dirname(c(import.meta.url)):``,K=r.join(G,`xdg-open`),{platform:q,arch:J}=d,Y=e(async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},`tryEachApp`),X=e(async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[W]===!0;if(delete e[W],Array.isArray(e.app))return Y(e.app,t=>X({...e,app:t,[W]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Y(n,t=>X({...e,app:{name:t,arguments:r},[W]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(b){let e=await D();a=L.get(e)??{}}else a=await H();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return X({...e,app:{name:$[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let a,o=[],s={},c=!1;if(b&&!v()&&!U&&!n&&(c=await E()),q===`darwin`)a=`open`,e.wait&&o.push(`--wait-apps`),e.background&&o.push(`--background`),e.newInstance&&o.push(`--new`),n&&o.push(`-a`,n);else if(q===`win32`||c){a=await w(),o.push(...S.argumentsPrefix),b||(s.windowsVerbatimArguments=!0),b&&e.target&&(e.target=await O(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(S.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(S.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>S.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=S.encodeCommand(t.join(` `)),e.wait||(s.stdio=`ignore`)}else{if(n)a=n;else{let e=!G||G===`/`,t=!1;try{await l.access(K,u.X_OK),t=!0}catch{}a=d.versions.electron??(q===`android`||e||!t)?`xdg-open`:K}r.length>0&&o.push(...r),e.wait||(s.stdio=`ignore`,s.detached=!0)}q===`darwin`&&r.length>0&&o.push(`--args`,...r),e.target&&o.push(e.target);let f=i.spawn(a,o,s);return e.wait?new Promise((t,n)=>{f.once(`error`,n),f.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(f)})}):t?new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.once(`close`,n=>{if(f.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}f.unref(),e(f)})})}):(f.unref(),new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.off(`error`,t),e(f)})}))},`baseOpen`),re=e((e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return X({...t,target:e})},`open`);function Z(e){if(typeof e==`string`||Array.isArray(e))return e;let{[J]:t}=e;if(!t)throw Error(`${J} is not supported`);return t}e(Z,`detectArchBinary`);function Q({[q]:e},{wsl:t}={}){if(t&&b)return Z(t);if(!e)throw Error(`${q} is not supported`);return Z(e)}e(Q,`detectPlatformBinary`);var $={browser:`browser`,browserPrivate:`browserPrivate`};k($,`chrome`,()=>Q({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),k($,`brave`,()=>Q({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),k($,`firefox`,()=>Q({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),k($,`edge`,()=>Q({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),k($,`safari`,()=>Q({darwin:`Safari`}));var ie=re;export{ie as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./auth-CZ0E51rF.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-O88q63Bk.mjs";import{n as i,t as a}from"./body-parser-BO6mfo_W.mjs";import{n as o}from"./input-validation-BwUR9z8e.mjs";import{r as s,t as c}from"./prompt-DTAWiEm2.mjs";import{t as l}from"./cli-types-CFw6Xygp.mjs";function u(e){return e.option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
2
+ import{n as e}from"./auth-B1CY5zpC.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-BLQ2xXwD.mjs";import{n as i,t as a}from"./body-parser-BO6mfo_W.mjs";import{n as o}from"./input-validation-BwUR9z8e.mjs";import{r as s,t as c}from"./prompt-DcfYBioA.mjs";import{t as l}from"./cli-types-CFw6Xygp.mjs";function u(e){return e.option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
3
3
  a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
4
4
  a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
5
5
  a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains