cf 1.0.0-beta.30 → 1.0.0-beta.31
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.
- package/README.md +1 -1
- package/dist/_meta/commands.json +1029 -1113
- package/dist/_meta/schemas.json +672 -702
- package/dist/{abuse-reports-Dzop8iDe.mjs → abuse-reports-B8vD22yf.mjs} +1 -1
- package/dist/{access-2NeD3Gu8.mjs → access-BkZlZPER.mjs} +1 -1
- package/dist/{accounts-CeJbhhX4.mjs → accounts-CG6_1Bfa.mjs} +3 -3
- package/dist/{acm-Dub0B14J.mjs → acm-B5VvmBfE.mjs} +1 -1
- package/dist/{addressing-BzWJU8m6.mjs → addressing-Db9Z1P-r.mjs} +1 -1
- package/dist/{agent-memory-2l9zyQFA.mjs → agent-memory-nzAUPSmC.mjs} +1 -1
- package/dist/{ai-laLv3daG.mjs → ai-RTQ-iZFq.mjs} +1 -1
- package/dist/{ai-audit-rgNePq5W.mjs → ai-audit-BGipueRC.mjs} +1 -1
- package/dist/{ai-gateway-e9b8CcL6.mjs → ai-gateway-F2pW8d5j.mjs} +1 -1
- package/dist/{ai-search-DZ0AqoPe.mjs → ai-search-CKM-K1Hm.mjs} +1 -1
- package/dist/{ai-security-CQuBTtmw.mjs → ai-security-CS2VJd4V.mjs} +1 -1
- package/dist/{alerting-_4ra-f_v.mjs → alerting-DNqXDY_7.mjs} +1 -1
- package/dist/{analytics-DLNn4bJ4.mjs → analytics-DM85HHka.mjs} +1 -1
- package/dist/{analytics-engine-CY45yWuL.mjs → analytics-engine-CxnuZwEx.mjs} +1 -1
- package/dist/{api-security-BSvJAjJV.mjs → api-security-BwLSP_5v.mjs} +1 -1
- package/dist/{argo-xzl0p--1.mjs → argo-DZM2SJFd.mjs} +1 -1
- package/dist/{artifacts-DAS14gcM.mjs → artifacts-CKbQsn4H.mjs} +1 -1
- package/dist/{audit-logs-3nYyCGQA.mjs → audit-logs-CG76HATH.mjs} +1 -1
- package/dist/auth-BBUZyJJx.mjs +2 -0
- package/dist/{auth-B0mFB6nU.mjs → auth-DBM4EcdJ.mjs} +1 -1
- package/dist/{auth-cj71dGxS.mjs → auth-NIRm11Ab.mjs} +1 -1
- package/dist/{auth-token-D9MnaZ-L.mjs → auth-token-Cp_u44cF.mjs} +1 -1
- package/dist/{autoconfig-DoLQ5ct8.mjs → autoconfig-CQjvJ8Rp.mjs} +386 -120
- package/dist/{basin-catalog-BbCsAKyZ.mjs → basin-catalog-BMKr8hFw.mjs} +1 -1
- package/dist/{billing-BsiLsjWJ.mjs → billing-LiyUCn9n.mjs} +1 -1
- package/dist/{blocks-DK5qAzLe.mjs → blocks-DdIA5quB.mjs} +1 -1
- package/dist/{bot-management-DkErOsIO.mjs → bot-management-ATqDTT08.mjs} +1 -1
- package/dist/{botnet-feed-CK4_PKrf.mjs → botnet-feed-Dk3eMSZo.mjs} +1 -1
- package/dist/{brand-protection-Czt-2Ei5.mjs → brand-protection-B82xx9X5.mjs} +2 -2
- package/dist/{browser-run-DLMdEaSJ.mjs → browser-run-DEVs2X54.mjs} +1 -1
- package/dist/build-CjqOmQjC.mjs +2 -0
- package/dist/{build-DiEXOgHH.mjs → build-D18S0p87.mjs} +1 -1
- package/dist/{builds-D--zUbR2.mjs → builds-kZaYZiQn.mjs} +1 -1
- package/dist/{cache-C8PQmkjD.mjs → cache-BSkT4mhb.mjs} +1 -1
- package/dist/{cli-BBv5YMan.mjs → cli-dk6sJFtN.mjs} +1 -1
- package/dist/{client-side-security-CFxePUL9.mjs → client-side-security-90cX3xFX.mjs} +1 -1
- package/dist/{cloud-connector-BitfLQ3s.mjs → cloud-connector-CtJhvxoD.mjs} +1 -1
- package/dist/{cloudforce-one-D2dzA7VD.mjs → cloudforce-one-DOf-Y51V.mjs} +2 -2
- package/dist/{command-iwrZ2Sb1.mjs → command-B2dfzTXs.mjs} +1 -1
- package/dist/{command-Xqidhyr_.mjs → command-BAzptjLF.mjs} +1 -1
- package/dist/{command-n7QausoH.mjs → command-BUYlzx4J.mjs} +1 -1
- package/dist/{command-BwcAuPBr.mjs → command-BUbUtS1f.mjs} +1 -1
- package/dist/{command-CQhD3Q1t.mjs → command-CTpn87uz.mjs} +1 -1
- package/dist/{command-BC_nezLE.mjs → command-DPo7r1PT.mjs} +1 -1
- package/dist/command-DuCT0YaL.mjs +2 -0
- package/dist/{command-DoXuskBZ.mjs → command-MWbvYsQH.mjs} +1 -1
- package/dist/{command-D5FrTb2N.mjs → command-QInwUVT5.mjs} +1 -1
- package/dist/{command-s15KaL-x.mjs → command-V0dODmT-.mjs} +1 -1
- package/dist/{completions-BAUSggys.mjs → completions-4aAl8vcF.mjs} +1 -1
- package/dist/{connector-interrupts-D9tI84Fk.mjs → connector-interrupts-qEMhlWeV.mjs} +1 -1
- package/dist/{connector-telemetry-events-Bs9wLYwc.mjs → connector-telemetry-events-CdqnrxRp.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-CbwE4lrE.mjs → connector-telemetry-snapshots-BRvmHAEM.mjs} +1 -1
- package/dist/{connectors-LyJN1htu.mjs → connectors-BqShaonQ.mjs} +1 -1
- package/dist/{containers-CKs7ZyZq.mjs → containers-BNuGwLRK.mjs} +2 -2
- package/dist/{content-scan-BQRz7C7Z.mjs → content-scan-02SOIW_1.mjs} +1 -1
- package/dist/{context-DlFhI9cN.mjs → context-CroqTqbk.mjs} +1 -1
- package/dist/{cps-DYlXx89C.mjs → cps-DvEG2eZl.mjs} +1 -1
- package/dist/{csam-scanner-BFANxGD-.mjs → csam-scanner-Bvklah8m.mjs} +1 -1
- package/dist/{custom-csrs-BX4aCeof.mjs → custom-csrs-BVcDWpY-.mjs} +1 -1
- package/dist/{custom-hostnames-BRYABKN3.mjs → custom-hostnames-IgjZmeJc.mjs} +1 -1
- package/dist/{custom-nameservers-CP1Vf1TD.mjs → custom-nameservers-0EYFPBz2.mjs} +1 -1
- package/dist/{custom-pages-BNL69ToU.mjs → custom-pages-W2weASNg.mjs} +1 -1
- package/dist/{d1-D4AZsUKn.mjs → d1-Df4t1noM.mjs} +1 -1
- package/dist/{delegate-BKlomUk6.mjs → delegate-CEaYc4br.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-LbXgSfAd.mjs → deploy-CGx9aUuj.mjs} +1 -1
- package/dist/{deploy-context-BYw6gbl-.mjs → deploy-context-DzSmuU32.mjs} +1 -1
- package/dist/deploy-input-DA70GC4o.mjs +2 -0
- package/dist/{dev-DaFSd8WC.mjs → dev-BDls_bK6.mjs} +1 -1
- package/dist/{diagnostics-Dk3pyWx_.mjs → diagnostics-C8V1G64d.mjs} +1 -1
- package/dist/{discover-DGsMj9ZN.mjs → discover-DtcZCeSh.mjs} +1 -1
- package/dist/discover-Dxb5yh9L.mjs +2 -0
- package/dist/{disk-cache-nbuwH1Dh.mjs → disk-cache-D6xHBTAA.mjs} +1 -1
- package/dist/{dls-DU6EdhQK.mjs → dls-BpU_jtuh.mjs} +1 -1
- package/dist/{dns-3QDtCu6f.mjs → dns-BlgfnRkG.mjs} +25 -25
- package/dist/{dns-firewall-Bbrr_0_a.mjs → dns-firewall-DtkcaFQ0.mjs} +1 -1
- package/dist/{docs-lLLKcLr_.mjs → docs-BI2ZoYmm.mjs} +1 -1
- package/dist/{durable-objects-DPf1DMeq.mjs → durable-objects-BPTzK6Xh.mjs} +1 -1
- package/dist/{email-auth-DOlEoi8q.mjs → email-auth-BSoYwLs1.mjs} +1 -1
- package/dist/{email-routing-D56SPGty.mjs → email-routing-3AIhCb7w.mjs} +1 -1
- package/dist/{email-security-CSawx0kD.mjs → email-security-INhnV4tT.mjs} +1 -1
- package/dist/{email-sending-CgFi0cLA.mjs → email-sending-BJ3OLfN3.mjs} +1 -1
- package/dist/{errors-CilNjDVk.mjs → errors-CBngn9n1.mjs} +1 -1
- package/dist/{field-extractors-FvIgySB4.mjs → field-extractors-lSqk5ySb.mjs} +1 -1
- package/dist/{firewall-BrTvywhW.mjs → firewall-CdXsS4Cc.mjs} +1 -1
- package/dist/{flagship-BGFN1Epo.mjs → flagship-CtnQ4Emf.mjs} +1 -1
- package/dist/{fraud-DzK6OIO3.mjs → fraud-CAZdLc_4.mjs} +1 -1
- package/dist/{google-tag-gateway-Cd9v8A7Z.mjs → google-tag-gateway-CBMNbgeM.mjs} +1 -1
- package/dist/{healthchecks-Cm7EHaBA.mjs → healthchecks-DdPEo0GC.mjs} +1 -1
- package/dist/{hyperdrive-CVaSt0qX.mjs → hyperdrive-DxHbVnyO.mjs} +1 -1
- package/dist/{iam-CWN62Mi4.mjs → iam-CISZzLLr.mjs} +1 -1
- package/dist/{images-Bo_pdvQC.mjs → images-DeMHqQHl.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-Dwmpc_S-.mjs → init-DKADNnPy.mjs} +1 -1
- package/dist/{intel-CQFYeGEA.mjs → intel-BYvnwlXr.mjs} +1 -1
- package/dist/{ips-jTSzoqMU.mjs → ips-CS5SkxUL.mjs} +1 -1
- package/dist/{k2-utE2lCYd.mjs → k2-isJz0-93.mjs} +1 -1
- package/dist/{kv-Cdh5hHte.mjs → kv-Beih-nj_.mjs} +1 -1
- package/dist/{lazy-command-QoHlmXHW.mjs → lazy-command-Dfv2jIGz.mjs} +1 -1
- package/dist/{leaked-credential-checks-CqApscD3.mjs → leaked-credential-checks-CP_8DWAX.mjs} +1 -1
- package/dist/{load-balancers-w_4Uz9Gi.mjs → load-balancers-fhAs7LaH.mjs} +1 -1
- package/dist/{login-CS3KxVbk.mjs → login-BdTYP5Xw.mjs} +1 -1
- package/dist/login-Bux329zM.mjs +2 -0
- package/dist/{logpush-C76I5dgN.mjs → logpush-fHQiJ9eI.mjs} +1 -1
- package/dist/{logs-B5aCYVCv.mjs → logs-Bquc4oxR.mjs} +1 -1
- package/dist/{magic-network-monitoring-CGf7cVQ9.mjs → magic-network-monitoring-DqQUEtPW.mjs} +1 -1
- package/dist/{magic-transit-CN5noqOR.mjs → magic-transit-py-CXbOl.mjs} +1 -1
- package/dist/{managed-defense-DAGr0UGm.mjs → managed-defense-nFm4rVCR.mjs} +1 -1
- package/dist/{managed-transforms-_SuwzZ-5.mjs → managed-transforms-2k6tV3U-.mjs} +1 -1
- package/dist/{mcp-CzedsjOf.mjs → mcp-BCtJ76cJ.mjs} +1 -1
- package/dist/{mesh-DXX1S3pX.mjs → mesh-D2V3ITA7.mjs} +1 -1
- package/dist/{migrate-CvRQ4x3_.mjs → migrate-CqUzEP9-.mjs} +1 -1
- package/dist/{monetization-8nt9PYln.mjs → monetization-CQL4WEtz.mjs} +1 -1
- package/dist/{network-CaiRDY2e.mjs → network-1oR1_5Ak.mjs} +1 -1
- package/dist/{network-interconnects-Ad6JbAVd.mjs → network-interconnects-BKRa6OaY.mjs} +1 -1
- package/dist/{o11y-DD2Hfnzi.mjs → o11y-B2hny1eT.mjs} +4 -4
- package/dist/{oauth-BUcV_xbm.mjs → oauth-CQiiWvag.mjs} +1 -1
- package/dist/{oauth-CQRlNgt5.mjs → oauth-Dp9VNyOf.mjs} +1 -1
- package/dist/{observability-BzKBUUSf.mjs → observability-ByzMkD8L.mjs} +1 -1
- package/dist/{ohttp-gateway-Sej9-GCm.mjs → ohttp-gateway-B67P-f_M.mjs} +1 -1
- package/dist/{organizations-DwYsCbYD.mjs → organizations-Dk5cbMB5.mjs} +1 -1
- package/dist/package-CcmyQJFT.mjs +2 -0
- package/dist/{page-rules-CjufEmIt.mjs → page-rules-hRzoq6WZ.mjs} +1 -1
- package/dist/{pages-Dj0Cdf3G.mjs → pages-D_0y5Pbg.mjs} +1 -1
- package/dist/{pay-per-crawl-DPVlluRA.mjs → pay-per-crawl-C0ZDkVH8.mjs} +1 -1
- package/dist/{pay-per-use-DhuLjaoo.mjs → pay-per-use-Z_LlZyxh.mjs} +1 -1
- package/dist/{pipelines-D2pM69oq.mjs → pipelines-B8-zUXTD.mjs} +1 -1
- package/dist/{precursor-DzuA1m8D.mjs → precursor-vlW9-fma.mjs} +1 -1
- package/dist/{previews-CHHd5Rx7.mjs → previews-DZX0vwDU.mjs} +3 -3
- package/dist/{progress-AML-AVs4.mjs → progress-DQfZZwit.mjs} +1 -1
- package/dist/{prompt-Bnon9lfK.mjs → prompt-e6K5lhdE.mjs} +1 -1
- package/dist/{queues-GDwznw0o.mjs → queues-6WHCb5qi.mjs} +1 -1
- package/dist/{r2-B3Xkb0S4.mjs → r2-C9xL1Rcg.mjs} +2 -2
- package/dist/{radar-fBT7VIO2.mjs → radar-DN1PIWRf.mjs} +150 -150
- package/dist/{raw-fetch-0T1SwPa1.mjs → raw-fetch-DXSBORQI.mjs} +1 -1
- package/dist/{realtime-B7mR3XtY.mjs → realtime-CcOSBEFJ.mjs} +1 -1
- package/dist/{registrar-DOoxlZc7.mjs → registrar-BjBA2lbF.mjs} +1 -1
- package/dist/{registrar-sandbox-DC7xAqqc.mjs → registrar-sandbox-DVeWO8gt.mjs} +1 -1
- package/dist/{reporting-DlD7J6Pq.mjs → reporting-cOY97XSy.mjs} +1 -1
- package/dist/{request-headers-BEYXy4JN.mjs → request-headers-xtY5gOlq.mjs} +1 -1
- package/dist/{request-tracers-DYCGkszp.mjs → request-tracers-bHnQoIpS.mjs} +1 -1
- package/dist/{resource-sharing-D_bUv7E8.mjs → resource-sharing-CQMP1o3F.mjs} +1 -1
- package/dist/{rules-C4cu3_jr.mjs → rules-CrevxzXm.mjs} +1 -1
- package/dist/{rulesets-Bl4mLnXA.mjs → rulesets-DzGcmiGs.mjs} +1 -1
- package/dist/{rum-DE_uJb09.mjs → rum-edoW7i0P.mjs} +1 -1
- package/dist/run-B6k0nZU4.mjs +2 -0
- package/dist/{run-DAg7dfIW.mjs → run-DhU17ztU.mjs} +1 -1
- package/dist/{schema-cache-CTVUtkAl.mjs → schema-cache-BFMBra5w.mjs} +1 -1
- package/dist/{scim-Dz4r0fnH.mjs → scim-BC31cTiV.mjs} +1 -1
- package/dist/{secrets-store-C2GwCUKs.mjs → secrets-store-DJlRawQ0.mjs} +1 -1
- package/dist/{security-insights-DZCm5D3U.mjs → security-insights-jHGuq15c.mjs} +1 -1
- package/dist/{security-txt-Dbi9KxNc.mjs → security-txt-D1vV2ySL.mjs} +1 -1
- package/dist/{session-BEsQIuwP.mjs → session-Py5R3Tdx.mjs} +1 -1
- package/dist/shared-C50J5uEm.mjs +2 -0
- package/dist/{smart-shield-C2uSFcGN.mjs → smart-shield-YI9Y6xhz.mjs} +1 -1
- package/dist/{snippets-BoaGEAC6.mjs → snippets-SKlEbP3W.mjs} +1 -1
- package/dist/{spawn-B4y5Urjv.mjs → spawn-BXaiweDp.mjs} +1 -1
- package/dist/{spectrum-Bb0KXA8R.mjs → spectrum-CFl8kTtP.mjs} +1 -1
- package/dist/{speed-zKYgLTHA.mjs → speed-DekTJTgw.mjs} +1 -1
- package/dist/{sql-pjWozuvl.mjs → sql-tkIoPSbE.mjs} +1 -1
- package/dist/{src-B8i6_XGg.mjs → src-COKSSJwa.mjs} +5 -5
- package/dist/{ssl-C5bg1X0i.mjs → ssl-DRGNVUlP.mjs} +1 -1
- package/dist/{static-assets-CTv7XwIQ.mjs → static-assets-pAj1uSDU.mjs} +1 -1
- package/dist/{stream-C_FiNrLV.mjs → stream-WHdFw1o1.mjs} +1 -1
- package/dist/{tags-CXlivF3y.mjs → tags-CNEWjoac.mjs} +1 -1
- package/dist/{telemetry-CtQWhsmy.mjs → telemetry-BCQMv5dO.mjs} +1 -1
- package/dist/telemetry-CruYXv5e.mjs +2 -0
- package/dist/{tenant-custom-nameservers-DBg9Hzvn.mjs → tenant-custom-nameservers-BCJoh-yz.mjs} +1 -1
- package/dist/{tenants-89Q0u5_Q.mjs → tenants-Coo3-wTg.mjs} +1 -1
- package/dist/{tunnels-CL2fIINH.mjs → tunnels-Cy3byznJ.mjs} +2 -2
- package/dist/{turnstile-D6GtQULo.mjs → turnstile-DvkuMuTq.mjs} +1 -1
- package/dist/ui-CA_2sliN.mjs +2 -0
- package/dist/{update-check-0kpbTLvy.mjs → update-check-Buyg_Zyb.mjs} +1 -1
- package/dist/{update-check-D3axIoUi.mjs → update-check-CV30Z3FO.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization--iS57OT_.mjs → url-normalization-DJzp3oJN.mjs} +1 -1
- package/dist/{url-scanner-C6AtXGc2.mjs → url-scanner-C28ADWWB.mjs} +1 -1
- package/dist/{user-C5vRYIta.mjs → user-CiFGo-51.mjs} +1 -1
- package/dist/{vectorize-C1Kxb1Ou.mjs → vectorize-DZ-VBQjl.mjs} +1 -1
- package/dist/version--BAAeBma.mjs +2 -0
- package/dist/{waiting-rooms-BCVZY9vI.mjs → waiting-rooms-mLG31NWt.mjs} +1 -1
- package/dist/{web-assets-D2gXqKZS.mjs → web-assets-Caubyaqz.mjs} +1 -1
- package/dist/{web3-CJDZQCOk.mjs → web3-Ctcb6rxj.mjs} +1 -1
- package/dist/{whoami-BEad9QUB.mjs → whoami-DBZfITBb.mjs} +3 -3
- package/dist/whoami-rfo2jx0r.mjs +2 -0
- package/dist/{workers-DzXSJMv9.mjs → workers-ClK3WFQg.mjs} +18 -18
- package/dist/{workers-for-platforms-CvazgrqD.mjs → workers-for-platforms-D6fknsnw.mjs} +1 -1
- package/dist/{workers-vpc-DP4QC6UC.mjs → workers-vpc-B7wRAn-K.mjs} +1 -1
- package/dist/{workflows-BSOj56io.mjs → workflows-B0UzguVf.mjs} +1 -1
- package/dist/{wrangler-migration-DZ9Oelof.mjs → wrangler-migration-u2oXOk-L.mjs} +2 -2
- package/dist/{zaraz-BnQvKXFy.mjs → zaraz-p9rNptt3.mjs} +1 -1
- package/dist/{zero-trust-DsslXRub.mjs → zero-trust-Dw5CvLQD.mjs} +1 -1
- package/dist/{zones-DQ3SjGsZ.mjs → zones-DzPc0thm.mjs} +1 -1
- package/package.json +6 -6
- package/dist/auth-CXR2vsII.mjs +0 -2
- package/dist/build-ByjJ6yIB.mjs +0 -2
- package/dist/command-ycXauMSv.mjs +0 -2
- package/dist/deploy-input-BFWpjDVr.mjs +0 -2
- package/dist/discover-D9FNaCDK.mjs +0 -2
- package/dist/internal-CYrPZ9IX.mjs +0 -4
- package/dist/live-hZgMkXJf.mjs +0 -4
- package/dist/login-BBSJytOt.mjs +0 -2
- package/dist/package-DXaRIx2f.mjs +0 -2
- package/dist/ready-BkXNDNTd.mjs +0 -4
- package/dist/run-Cg9utScS.mjs +0 -2
- package/dist/shared-DqW2vICA.mjs +0 -2
- package/dist/signed-url-BhHSAUam.mjs +0 -4
- package/dist/telemetry-DDs3zhdw.mjs +0 -2
- package/dist/ui-CY75N4Tm.mjs +0 -2
- package/dist/version-pcpa_kv3.mjs +0 -2
- package/dist/whoami-2eFTt0-Y.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{r as n,t as r}from"./body-parser-HN91kAf0.mjs";import{a as i,t as a}from"./context-CroqTqbk.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{n as s}from"./input-validation-D7z60HJH.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./run-DhU17ztU.mjs";import{t as u}from"./output-PRKYaJuo.mjs";import{t as d}from"./progress-DQfZZwit.mjs";import{a as f,n as p}from"./prompt-e6K5lhdE.mjs";import"./telemetry-CruYXv5e.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/basin-catalog/${t.bucket_name}/credential`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function h(e){return e.usage(`$0 basin-catalog credentials create <bucket-name>
|
|
3
3
|
|
|
4
4
|
Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`).positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const g={command:`create <bucket-name>`,describe:`Store catalog credentials`,builder:h,handler:async e=>l({command:`basin-catalog credentials create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();o({command:`cf basin-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/basin-catalog/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?r({token:s(e.token,`token`,`text`)}):n(e.body),sensitiveBodyPaths:[[`token`]]});return}let l=e.body===void 0?void 0:n(e.body),p=await t(e),h=e.local?c:await a();if(e.accountId=h,e.body!==void 0){let t=l,n=await d(`Creating`,async()=>p.send(m,{body:t,account_id:h,bucket_name:e[`bucket-name`]}));u(n,{successLabel:`Created`});return}e.token===void 0&&(e.token=await f(`token`,`Provides the Cloudflare API token for accessing R2.`,{kind:`secret`}));let g=r({token:s(e.token,`token`,`text`)}),_=await d(`Creating`,async()=>p.send(m,{body:g,account_id:h,bucket_name:e[`bucket-name`]}));u(_,{successLabel:`Created`})})};var _={method:`GET`,path:t=>e`/accounts/${t.account_id}/basin-catalog/${t.bucket_name}/credential/status`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 basin-catalog credentials status <bucket-name>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t}from"./auth-
|
|
2
|
+
import{i as e,n as t}from"./auth-NIRm11Ab.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{c as r,o as i,r as a,t as o}from"./body-parser-HN91kAf0.mjs";import{t as s}from"./dry-run-mrA7FFLR.mjs";import{a as c,t as l}from"./context-CroqTqbk.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{t as d}from"./output-PRKYaJuo.mjs";import{t as f}from"./progress-DQfZZwit.mjs";import{t as p}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import"./api-Dnt6lRJG.mjs";import{t as m}from"./local-B3zt9PXR.mjs";import{a as h,i as g,n as _}from"./prompt-e6K5lhdE.mjs";var v={method:`POST`,path:()=>`/billing/address-validation`,body:`json`};function y(e){return e.usage(`$0 billing addresses validate
|
|
3
3
|
|
|
4
4
|
Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.`).option(`address`,{type:`string`,description:`Address line 1.`}).option(`address2`,{type:`string`,description:`Address line 2.`}).option(`city`,{type:`string`,description:`City.`}).option(`country`,{type:`string`,description:`Country code.`}).option(`state`,{type:`string`,description:`State or province.`}).option(`zipcode`,{type:`string`,description:`Postal or zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`validate`,describe:`Validate Billing Address`,builder:y,handler:async e=>p({command:`billing addresses validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf billing addresses validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/billing/address-validation`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)}):a(e.body)});return}let n=e.body===void 0?void 0:a(e.body),r=await t(e);if(e.body!==void 0){let e=n,t=await f(`Validating`,async()=>r.send(v,{body:e}));d(t,{successLabel:`Validated`});return}let i=o({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)}),c=await f(`Validating`,async()=>r.send(v,{body:i}));d(c,{successLabel:`Validated`})})},ee={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:e=>n`/accounts/${e.account_id}/billing/profile/payment-method`};function S(e){return e.usage(`$0 billing profiles create-payment-intent
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,r as t}from"./theme-BGHWSKCw.mjs";import"./delegate-
|
|
2
|
+
import{n as e,r as t}from"./theme-BGHWSKCw.mjs";import"./delegate-CEaYc4br.mjs";import{stripVTControlCharacters as n}from"node:util";function r(n){return`${t.success(e.success)} ${n}`}function i(n){return`${t.warning(e.warning)} ${n}`}function a(n){return`${t.muted(e.arrow)} ${t.muted(n)}`}function o(e,r){let a=process.env.CF_DELEGATION?` ${t.muted(`·`)} ${t.muted(`local version`)}`:``,o=r?` ${t.muted(`·`)} ${t.warning(`update available: v${r.latestVersion}`)}`:``,s=`🍊☁️ ${t.brand(t.bold(`cf`))} ${t.muted(`·`)} ${t.muted(`v${e}`)}${a}${o}`,c=n(s).length,l=`─`.repeat(c);return`${s}\n${t.brand(l)}${r?.isMajor?`\n${i(`A new major version of cf is available. Updating is recommended.`)}`:``}`}const s={bar:`│`,top:`┌`,bottom:`└`};function c(e,n,r){let i=r?.title??`Error`,a=t.error(s.bar),o=t.error(s.top),c=t.error(s.bottom),u=Math.max(20,(process.stderr.columns||80)-2),d=[];if(d.push(``),d.push(`${o} ${t.error(t.bold(i))}`),r?.rawMessage)for(let t of e.split(`
|
|
3
3
|
`))d.push(t.length>0?`${a} ${t}`:a);else for(let n of l(e,u))d.push(n.length>0?`${a} ${t.error(t.bold(n))}`:a);if(n){d.push(a);for(let e of l(n,u))d.push(e.length>0?`${a} ${t.muted(e)}`:a)}return d.push(c),d.join(`
|
|
4
4
|
`)}function l(e,t){let n=[];for(let r of e.split(`
|
|
5
5
|
`)){if(r.length<=t){n.push(r);continue}let e=r.split(/\s+/),i=``;for(let r of e)i?i.length+1+r.length<=t?i+=` `+r:(n.push(i),i=r):i=r;i&&n.push(i)}return n}export{r as a,a as i,l as n,i as o,o as r,c as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{i as n}from"./context-CroqTqbk.mjs";import{i as r,r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{n as s}from"./input-validation-D7z60HJH.mjs";import{t as c}from"./run-DhU17ztU.mjs";import{t as l}from"./output-PRKYaJuo.mjs";import{t as u}from"./progress-DQfZZwit.mjs";import{a as d,i as f}from"./prompt-e6K5lhdE.mjs";import"./telemetry-CruYXv5e.mjs";var p={method:`POST`,path:t=>e`/zones/${t.zone_id}/bot_management/feedback`,body:`json`,response:!1};function m(e){return e.usage("$0 bot-management feedback create\n\nSubmit a feedback report for the specified zone. Use `type` to indicate whether the report is a false positive (good traffic flagged as bot) or a false negative (bot traffic missed). Furthermore, you can also use `expression` as a wirefilter to identify the affected traffic sample. See more accepted API fields and expression types at https://developers.cloudflare.com/bots/concepts/feedback-loop/#api-fields and https://developers.cloudflare.com/bots/concepts/feedback-loop/#expression-fields, respectively.").option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`Wirefilter expression describing the traffic being reported.`}).option(`first-request-seen-at`,{type:`string`,description:`The first_request_seen_at field`}).option(`last-request-seen-at`,{type:`string`,description:`The last_request_seen_at field`}).option(`requests`,{type:`number`,description:`The requests field`}).option(`requests-by-attribute`,{type:`string`,description:`Top attributes contributing to the feedback sample. Keys include topASNs, topCountries, topHosts, topIPs, topJA3Hashes, topJA4s, topPaths, topUserAgents. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [{...}]}.`}).option(`requests-by-score`,{type:`string`,description:'Map of bot scores (1-99) to request counts. Sum must equal `requests`. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": number}.'}).option(`requests-by-score-src`,{type:`string`,description:'Map of score source to request counts. Sum must equal `requests`. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": number}.'}).option(`subtype`,{type:`string`,description:`The subtype field`}).option(`type`,{type:`string`,description:`Type of feedback report.`,choices:[`false_positive`,`false_negative`]}).coerce(`type`,e=>s(e,`type`,`text`)).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:`Submit a feedback report`,builder:m,handler:async e=>c({command:`bot-management feedback create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf bot-management feedback create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({description:s(e.description,`description`,`text`),expression:s(e.expression,`expression`,`text`),first_request_seen_at:s(e[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(e[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:e.requests,requests_by_attribute:r(e[`requests-by-attribute`],`requests-by-attribute`,!0),requests_by_score:r(e[`requests-by-score`],`requests-by-score`,!0),requests_by_score_src:r(e[`requests-by-score-src`],`requests-by-score-src`,!0),subtype:s(e.subtype,`subtype`,`text`),type:e.type},[[`requests_by_attribute`],[`requests_by_score`],[`requests_by_score_src`]]):i(e.body,[{path:[`requests_by_attribute`],flag:`requests-by-attribute`},{path:[`requests_by_score`],flag:`requests-by-score`},{path:[`requests_by_score_src`],flag:`requests-by-score-src`}])});return}let c=e.body===void 0?void 0:i(e.body,[{path:[`requests_by_attribute`],flag:`requests-by-attribute`},{path:[`requests_by_score`],flag:`requests-by-score`},{path:[`requests_by_score_src`],flag:`requests-by-score-src`}]),m=await t(e),h=await n({zone:e.zone},m,{quiet:e.quiet});if(e.zoneId=h,e.body!==void 0){let e=c,t=await u(`Creating`,async()=>m.send(p,{body:e,zone_id:h}));l(t,{successLabel:`Created`});return}if(e.description===void 0&&(e.description=await d(`description`,`The description field`)),e.expression===void 0&&(e.expression=await d(`expression`,`Wirefilter expression describing the traffic being reported.`)),e[`first-request-seen-at`]===void 0&&(e[`first-request-seen-at`]=await d(`first-request-seen-at`,`The first_request_seen_at field`)),e[`last-request-seen-at`]===void 0&&(e[`last-request-seen-at`]=await d(`last-request-seen-at`,`The last_request_seen_at field`)),e.requests===void 0)throw Error(`--requests is required (or pass --body with this field set).`);if(e[`requests-by-attribute`]===void 0)throw Error(`--requests-by-attribute is required (or pass --body with this field set).`);if(e[`requests-by-score`]===void 0)throw Error(`--requests-by-score is required (or pass --body with this field set).`);if(e[`requests-by-score-src`]===void 0)throw Error(`--requests-by-score-src is required (or pass --body with this field set).`);e.type===void 0&&(e.type=await f(`type`,`Type of feedback report.`,[`false_positive`,`false_negative`]));let g=a({description:s(e.description,`description`,`text`),expression:s(e.expression,`expression`,`text`),first_request_seen_at:s(e[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(e[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:e.requests,requests_by_attribute:r(e[`requests-by-attribute`],`requests-by-attribute`,!0),requests_by_score:r(e[`requests-by-score`],`requests-by-score`,!0),requests_by_score_src:r(e[`requests-by-score-src`],`requests-by-score-src`,!0),subtype:s(e.subtype,`subtype`,`text`),type:e.type},[[`requests_by_attribute`],[`requests_by_score`],[`requests_by_score_src`]]),_=await u(`Creating`,async()=>m.send(p,{body:g,zone_id:h}));l(_,{successLabel:`Created`})})};var g={method:`GET`,path:t=>e`/zones/${t.zone_id}/bot_management/feedback`};function _(e){return e.usage(`$0 bot-management feedback list
|
|
3
3
|
|
|
4
4
|
Returns all feedback reports previously submitted for the specified zone. Feedback reports help improve detection by sharing samples of traffic that were misclassified as bots or humans.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List zone feedback reports`,builder:_,handler:async e=>c({command:`bot-management feedback list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf bot-management feedback list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i;let a=await u(`Loading`,async()=>r.send(g,{zone_id:i}));l(a,{successLabel:`Loaded`})})},y={command:`feedback`,describe:`Operations for feedback`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`GET`,path:t=>e`/zones/${t.zone_id}/bot_management`};function x(e){return e.usage(`$0 bot-management get
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{t as n}from"./dry-run-mrA7FFLR.mjs";import{a as r,t as i}from"./context-CroqTqbk.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-PRKYaJuo.mjs";import{t as s}from"./progress-DQfZZwit.mjs";import{t as c}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import{n as l}from"./prompt-e6K5lhdE.mjs";var u={method:`GET`,path:t=>e`/accounts/${t.account_id}/botnet_feed/asn/${t.asn_id}/day_report`,query:[`date`]};function d(e){return e.usage(`$0 botnet-feed asn day-report <asn-id>
|
|
3
3
|
|
|
4
4
|
Gets all the data the botnet tracking database has for a given ASN registered to user account for given date. If no date is given, it will return results for the previous day.`).positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`date`,{type:`string`,description:`Date`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`day-report <asn-id>`,describe:`Get daily report`,builder:d,handler:async e=>c({command:`botnet-feed asn day-report`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={date:e.date};if(e.dryRun){let t=await r();n({command:`cf botnet-feed asn day-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/botnet_feed/asn/${e[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(e[`asn-id`]))}/day_report`,pathParams:{"asn-id":String(e[`asn-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(e),d=e.local?a:await i();e.accountId=d;let f=await s(`Loading`,async()=>l.send(u,{account_id:d,asn_id:e[`asn-id`],...c}));o(f,{successLabel:`Loaded`})})};var p={method:`GET`,path:t=>e`/accounts/${t.account_id}/botnet_feed/asn/${t.asn_id}/full_report`};function m(e){return e.usage(`$0 botnet-feed asn full-report <asn-id>
|
|
5
5
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{t as n}from"./dry-run-mrA7FFLR.mjs";import{a as r,t as i}from"./context-CroqTqbk.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-PRKYaJuo.mjs";import{t as s}from"./progress-DQfZZwit.mjs";import{t as c}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import{o as l,r as u,t as d}from"./body-parser-HN91kAf0.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-e6K5lhdE.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/matches`,query:[`offset`,`limit`,`query_id`,`download`,`orderBy`,`order`]};function _(e){return e.usage(`$0 brand-protection logo-matches get
|
|
3
3
|
|
|
4
4
|
Lists images that matched a saved logo query, most recently matched first by default. Set \`download=true\` to include each matched image as base64 data.`).option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,description:`ID of the logo query whose matches to list.`,demandOption:!0}).option(`download`,{type:`string`,description:"Set to `true` to include each matched image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`order-by`,{type:`string`,description:"Field to sort by: `matchedAt`, `domain`, `similarityScore`, or `registrar`. Defaults to `matchedAt`.",choices:[`matchedAt`,`domain`,`similarityScore`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`List logo matches`,builder:_,handler:async e=>c({command:`brand-protection logo-matches get`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],download:e.download,orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(g,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},y={command:`logo-matches`,describe:`Operations for logo-matches`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,body:`json`};function x(e){return e.usage(`$0 brand-protection logos create
|
|
5
5
|
|
|
6
6
|
Uploads a logo and creates a saved logo query that finds visually similar images on scanned websites. The tag must be unique among the account's logo queries. By default, the new query also searches previously scanned images (see \`search_lookback\`). Creation fails when the account has reached its Brand Protection query limit, which counts domain and logo queries together.`).option(`image-data`,{type:`string`,description:"Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string. Supported formats: PNG, JPEG, GIF, WebP, BMP, and SVG. ICO is also accepted when the data includes a `data:image/x-icon;base64,` prefix."}).option(`search-lookback`,{type:`boolean`,description:"If true, also search previously scanned images for matches above the similarity threshold. Defaults to `true`.",default:!0}).option(`similarity-threshold`,{type:`number`,description:`Minimum similarity score (0-1) required for visual matches`}).option(`tag`,{type:`string`,description:`Name of the logo query. Must be unique among the account's logo queries.`}).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 logo query`,builder:x,handler:async e=>c({command:`brand-protection logos create`,classification:{safeFlags:[`search-lookback`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({image_data:f(e[`image-data`],`image-data`,`text`),search_lookback:e[`search-lookback`],similarity_threshold:e[`similarity-threshold`],tag:f(e.tag,`tag`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await t(e),m=e.local?a:await i();if(e.accountId=m,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>l.send(b,{body:e,account_id:m}));o(t,{successLabel:`Created`});return}if(e[`image-data`]===void 0&&(e[`image-data`]=await p(`image-data`,"Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string. Supported formats: PNG, JPEG, GIF, WebP, BMP, and SVG. ICO is also accepted when the data includes a `data:image/x-icon;base64,` prefix.")),e[`similarity-threshold`]===void 0)throw Error(`--similarity-threshold is required (or pass --body with this field set).`);e.tag===void 0&&(e.tag=await p(`tag`,`Name of the logo query. Must be unique among the account's logo queries.`));let h=d({image_data:f(e[`image-data`],`image-data`,`text`),search_lookback:e[`search-lookback`],similarity_threshold:e[`similarity-threshold`],tag:f(e.tag,`tag`,`text`)}),g=await s(`Creating`,async()=>l.send(b,{body:h,account_id:m}));o(g,{successLabel:`Created`})})};var S={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries/${t.query_id}`};function C(e){return e.usage(`$0 brand-protection logos delete <query-id>
|
|
7
7
|
|
|
8
|
-
Permanently deletes a saved logo query and all of its matches. If the query does not exist in this account, the request fails with error code 404.`).positional(`query-id`,{type:`string`,description:`ID of the logo query.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <query-id>`,describe:`Delete logo query`,builder:C,handler:async e=>c({command:`brand-protection logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await h({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(S,{account_id:l,query_id:e[`query-id`]}));o(u,{successLabel:`Deleted`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,query:[`id`,`download`]};function E(e){return e.usage("$0 brand-protection logos get\n\nLists the account's saved logo queries. Set `id` to return a single query object instead of an array. Set `download=true` to include each logo image as base64 data.").option(`id`,{type:`string`,description:"ID of a logo query. When set, `result` is that single query object instead of an array."}).option(`download`,{type:`string`,description:"Set to `true` to include each logo image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`List logo queries`,builder:E,handler:async e=>c({command:`brand-protection logos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,download:e.download};if(e.dryRun){let e=await r();n({command:`cf brand-protection logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(T,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},O={command:`logos`,describe:`Operations for logos`,builder:e=>e.command(ee).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,body:`json`};function A(e){return e.usage("$0 brand-protection matches bulk-dismiss\n\nDismisses or undismisses up to 100 domain matches in one request and returns a result for each item. Send `matches` as (`query_id`, `domain_id`) pairs to change each match for one query. The legacy `match_ids` format is still accepted, but it changes each match for every query that shares it; prefer `matches`.").option(`action`,{type:`string`,description:"`dismiss` to dismiss the matches, or `undismiss` to restore them.",choices:[`dismiss`,`undismiss`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`match-ids`,{type:`string`,array:!0,description:"Legacy format; prefer `matches`. Match IDs to update. Each ID changes the match for every query that shares it, not just one query. 1 to 100 items; duplicate IDs are rejected."}).option(`matches`,{type:`string`,description:'Matches to update, as (`query_id`, `domain_id`) pairs. Each pair changes the match for that query only. 1 to 100 items; duplicate pairs are rejected. Send only one format. If both are supplied, `match_ids` takes precedence and `matches` is ignored. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"domain_id": number, "query_id": number}].'}).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:`bulk-dismiss`,describe:`Bulk dismiss or undismiss matches`,builder:A,handler:async e=>c({command:`brand-protection matches bulk-dismiss`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection matches bulk-dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await t(e),p=e.local?a:await i();if(e.accountId=p,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>f.send(k,{body:e,account_id:p}));o(t,{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,"`dismiss` to dismiss the matches, or `undismiss` to restore them.",[`dismiss`,`undismiss`]));let h=d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}),g=await s(`Creating`,async()=>f.send(k,{body:h,account_id:p}));o(g,{successLabel:`Created`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches`,query:[`offset`,`limit`,`query_id`,`include_domain_id`,`include_dismissed`,`domain_search`,`orderBy`,`order`]};function N(e){return e.usage("$0 brand-protection matches get\n\nLists domains that matched one or more saved domain queries, most recently matched first by default. When you pass several comma-separated `query_id` values, matches are deduplicated by domain and each match includes a `match_details` array with per-query dismissed state. Set `include_domain_id=true` to get the `domain_id` needed to dismiss or undismiss a match.").option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,array:!0,description:"ID of a domain query, or a comma-separated list of domain query IDs. When you pass several IDs, matches are deduplicated by domain and each match includes a `match_details` array with per-query metadata and dismissed state.",demandOption:!0}).option(`include-domain-id`,{type:`string`,description:"Set to `true` to include `domain_id` on each match. Required to dismiss or undismiss a match. Defaults to `false`."}).option(`include-dismissed`,{type:`string`,description:"Set to `false` to exclude dismissed matches. Dismissed matches are included when this is omitted or `true`."}).option(`domain-search`,{type:`string`,description:`Return only matches whose domain contains this text (case-insensitive).`}).option(`order-by`,{type:`string`,description:"Field to sort by: `domain`, `first_seen`, or `registrar`. Defaults to `first_seen`.",choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`. For single-query requests, `asc` applies only when `orderBy` is set.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`List domain matches`,builder:N,handler:async e=>c({command:`brand-protection matches get`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`],domain_search:e[`domain-search`],orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(M,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},F={command:`matches`,describe:`Operations for matches`,builder:e=>e.command(j).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var I={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/dismiss`};function L(e){return e.usage("$0 brand-protection queries dismiss <domain-id>\n\nMarks a matched domain as dismissed for one domain query. Dismissals are per query: dismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Dismissing an already dismissed match succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`dismiss <domain-id>`,describe:`Dismiss a domain match`,builder:L,handler:async e=>c({command:`brand-protection queries dismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/dismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(I,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})};var z={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/queries`,query:[`id`,`page`,`per_page`]};function B(e){return e.usage("$0 brand-protection queries get\n\nLists the account's saved domain queries, most recently updated first. Set `id` to return a single query object instead of an array. Set `page` or `per_page` to paginate the list; the response then includes `result_info`. Without them, every query is returned.").option(`id`,{type:`string`,description:"ID of a domain query. When set, `result` is that single query object instead of an array, and `page` and `per_page` are ignored."}).option(`page`,{type:`number`,description:`Page number for paginated list requests. Defaults to 1 when only per_page is supplied. Omit page and per_page to return every query.`}).option(`per-page`,{type:`number`,description:`Number of queries per page for paginated list requests. Defaults to 100 when only page is supplied. Maximum 100. Omit page and per_page to return every query.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`List domain queries`,builder:B,handler:async e=>c({command:`brand-protection queries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();n({command:`cf brand-protection queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(z,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})};var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/undismiss`};function H(e){return e.usage("$0 brand-protection queries undismiss <domain-id>\n\nRemoves the dismissed status from a matched domain for one domain query. Undismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Undismissing a match that is not dismissed succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`undismiss <domain-id>`,describe:`Undismiss a domain match`,builder:H,handler:async e=>c({command:`brand-protection queries undismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries undismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/undismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(te,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})},W={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(R).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/search`,query:[`showHistoric`,`download`],body:`json`};function K(e){return e.usage(`$0 brand-protection submit
|
|
8
|
+
Permanently deletes a saved logo query and all of its matches. If the query does not exist in this account, the request fails with error code 404.`).positional(`query-id`,{type:`string`,description:`ID of the logo query.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <query-id>`,describe:`Delete logo query`,builder:C,handler:async e=>c({command:`brand-protection logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await h({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(S,{account_id:l,query_id:e[`query-id`]}));o(u,{successLabel:`Deleted`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,query:[`id`,`download`]};function E(e){return e.usage("$0 brand-protection logos get\n\nLists the account's saved logo queries. Set `id` to return a single query object instead of an array. Set `download=true` to include each logo image as base64 data.").option(`id`,{type:`string`,description:"ID of a logo query. When set, `result` is that single query object instead of an array."}).option(`download`,{type:`string`,description:"Set to `true` to include each logo image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`List logo queries`,builder:E,handler:async e=>c({command:`brand-protection logos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,download:e.download};if(e.dryRun){let e=await r();n({command:`cf brand-protection logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(T,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},O={command:`logos`,describe:`Operations for logos`,builder:e=>e.command(ee).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,body:`json`};function A(e){return e.usage("$0 brand-protection matches bulk-dismiss\n\nDismisses or undismisses up to 100 domain matches in one request and returns a result for each item. Send `matches` as (`query_id`, `domain_id`) pairs to change each match for one query. The legacy `match_ids` format is still accepted, but it changes each match for every query that shares it; prefer `matches`.").option(`action`,{type:`string`,description:"`dismiss` to dismiss the matches, or `undismiss` to restore them.",choices:[`dismiss`,`undismiss`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`match-ids`,{type:`string`,array:!0,description:"Legacy format; prefer `matches`. Match IDs to update. Each ID changes the match for every query that shares it, not just one query. 1 to 100 items; duplicate IDs are rejected."}).option(`matches`,{type:`string`,description:'Matches to update, as (`query_id`, `domain_id`) pairs. Each pair changes the match for that query only. 1 to 100 items; duplicate pairs are rejected. Send only one format. If both are supplied, `match_ids` takes precedence and `matches` is ignored. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"domain_id": number, "query_id": number}].'}).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:`bulk-dismiss`,describe:`Bulk dismiss or undismiss matches`,builder:A,handler:async e=>c({command:`brand-protection matches bulk-dismiss`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection matches bulk-dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await t(e),p=e.local?a:await i();if(e.accountId=p,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>f.send(k,{body:e,account_id:p}));o(t,{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,"`dismiss` to dismiss the matches, or `undismiss` to restore them.",[`dismiss`,`undismiss`]));let h=d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}),g=await s(`Creating`,async()=>f.send(k,{body:h,account_id:p}));o(g,{successLabel:`Created`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches`,query:[`offset`,`limit`,`query_id`,`include_domain_id`,`include_dismissed`,`domain_search`,`quality`,`orderBy`,`order`]};function N(e){return e.usage("$0 brand-protection matches get\n\nLists domains that matched one or more saved domain queries, most recently matched first by default. When you pass several comma-separated `query_id` values, matches are deduplicated by domain and each match includes a `match_details` array with per-query dismissed state. Set `include_domain_id=true` to get the `domain_id` needed to dismiss or undismiss a match.").option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,array:!0,description:"ID of a domain query, or a comma-separated list of domain query IDs. When you pass several IDs, matches are deduplicated by domain and each match includes a `match_details` array with per-query metadata and dismissed state.",demandOption:!0}).option(`include-domain-id`,{type:`string`,description:"Set to `true` to include `domain_id` on each match. Required to dismiss or undismiss a match. Defaults to `false`."}).option(`include-dismissed`,{type:`string`,description:"Set to `false` to exclude dismissed matches. Dismissed matches are included when this is omitted or `true`."}).option(`domain-search`,{type:`string`,description:`Return only matches whose domain contains this text (case-insensitive).`}).option(`quality`,{type:`string`,description:`Filter matches by quality. Options: 'high' or 'low'`,choices:[`high`,`low`]}).option(`order-by`,{type:`string`,description:"Field to sort by: `domain`, `first_seen`, or `registrar`. Defaults to `first_seen`.",choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`. For single-query requests, `asc` applies only when `orderBy` is set.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`List domain matches`,builder:N,handler:async e=>c({command:`brand-protection matches get`,classification:{safeFlags:[`quality`,`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`],domain_search:e[`domain-search`],quality:e.quality,orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(M,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},F={command:`matches`,describe:`Operations for matches`,builder:e=>e.command(j).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var I={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/dismiss`};function L(e){return e.usage("$0 brand-protection queries dismiss <domain-id>\n\nMarks a matched domain as dismissed for one domain query. Dismissals are per query: dismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Dismissing an already dismissed match succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`dismiss <domain-id>`,describe:`Dismiss a domain match`,builder:L,handler:async e=>c({command:`brand-protection queries dismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/dismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(I,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})};var z={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/queries`,query:[`id`,`page`,`per_page`]};function B(e){return e.usage("$0 brand-protection queries get\n\nLists the account's saved domain queries, most recently updated first. Set `id` to return a single query object instead of an array. Set `page` or `per_page` to paginate the list; the response then includes `result_info`. Without them, every query is returned.").option(`id`,{type:`string`,description:"ID of a domain query. When set, `result` is that single query object instead of an array, and `page` and `per_page` are ignored."}).option(`page`,{type:`number`,description:`Page number for paginated list requests. Defaults to 1 when only per_page is supplied. Omit page and per_page to return every query.`}).option(`per-page`,{type:`number`,description:`Number of queries per page for paginated list requests. Defaults to 100 when only page is supplied. Maximum 100. Omit page and per_page to return every query.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`List domain queries`,builder:B,handler:async e=>c({command:`brand-protection queries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();n({command:`cf brand-protection queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(z,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})};var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/undismiss`};function H(e){return e.usage("$0 brand-protection queries undismiss <domain-id>\n\nRemoves the dismissed status from a matched domain for one domain query. Undismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Undismissing a match that is not dismissed succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`undismiss <domain-id>`,describe:`Undismiss a domain match`,builder:H,handler:async e=>c({command:`brand-protection queries undismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries undismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/undismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(te,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})},W={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(R).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/search`,query:[`showHistoric`,`download`],body:`json`};function K(e){return e.usage(`$0 brand-protection submit
|
|
9
9
|
|
|
10
10
|
Submit an image and find the n closest matches from the scanned images index without creating any match records. Returns similarity scores and metadata for each match.`).option(`show-historic`,{type:`string`,description:`Include scanned images without domain metadata (historic data). Default: false (only show images with domain)`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score threshold for matches (0-1, default: 0)`,default:0}).option(`top-k`,{type:`number`,description:`Number of closest matches to return. Defaults to 10. Accepts 1 to 100, but values above 50 are treated as 50.`,default:10}).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 q={command:`submit`,describe:`Search scanned images`,builder:K,handler:async e=>c({command:`brand-protection submit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={showHistoric:e[`show-historic`],download:e.download};if(e.dryRun){let t=await r();n({command:`cf brand-protection submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/search`,pathParams:{},query:c,bodyKind:`json`,body:e.body===void 0?d({image_data:f(e[`image-data`],`image-data`,`text`),score_threshold:e[`score-threshold`],top_k:e[`top-k`]}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),m=await t(e),h=e.local?a:await i();if(e.accountId=h,e.body!==void 0){let e=l;new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>m.send(G,{body:e,account_id:h,...c}));o(t,{successLabel:`Created`});return}e[`image-data`]===void 0&&(e[`image-data`]=await p(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`));let g=d({image_data:f(e[`image-data`],`image-data`,`text`),score_threshold:e[`score-threshold`],top_k:e[`top-k`]});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await s(`Creating`,async()=>m.send(G,{body:g,account_id:h,...c}));o(_,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/trial`,body:`json`,errors:{403:`ForbiddenError`,502:`BadGatewayError`,503:`ServiceUnavailableError`}};function Y(e){return e.usage(`$0 brand-protection trial create
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-NIRm11Ab.mjs";import{c as r,i,o as a,r as o,s,t as c}from"./body-parser-HN91kAf0.mjs";import{a as l,t as u}from"./context-CroqTqbk.mjs";import{t as d}from"./dry-run-mrA7FFLR.mjs";import{t as f}from"./local-B3zt9PXR.mjs";import{t as p}from"./output-PRKYaJuo.mjs";import{t as m}from"./run-DhU17ztU.mjs";import{t as h}from"./progress-DQfZZwit.mjs";import"./telemetry-CruYXv5e.mjs";import{a as g,n as _}from"./prompt-e6K5lhdE.mjs";import{n as v}from"./input-validation-D7z60HJH.mjs";import{n as y,t as b}from"./raw-fetch-DXSBORQI.mjs";var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl`,query:[`cacheTTL`],body:`json`,errors:{400:`BadRequestError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function ee(e){return e.usage("$0 browser-run crawl create\n\nStarts a crawl job for the provided URL and its children. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.").option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create`,describe:`Crawl websites.`,builder:ee,handler:async e=>m({command:`browser-run crawl create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let r={cacheTTL:e[`cache-ttl`]};if(e.dryRun){let t=await l();d({command:`cf browser-run crawl create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/browser-rendering/crawl`,pathParams:{},query:r,bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let i=e.body===void 0?void 0:o(e.body),a=await n(e),s=e.local?f:await u();if(e.accountId=s,e.body!==void 0){let e=i;new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await h(`Creating`,async()=>a.send(x,{body:e,account_id:s,...r}));p(t,{successLabel:`Created`});return}let c=await h(`Creating`,async()=>t(a,`POST`,`/accounts/${s}/browser-rendering/crawl`,{query:r}));p(c,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl/${t.job_id}`,errors:{400:`BadRequestError`,404:`NotFoundError`,500:`InternalServerError`}};function ne(e){return e.usage(`$0 browser-run crawl delete <job-id>
|
|
3
3
|
|
|
4
4
|
Cancels an ongoing crawl job by setting its status to cancelled and stopping all queued URLs.`).positional(`job-id`,{type:`string`,description:`The ID of the crawl job to cancel.`,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 re={command:`delete <job-id>`,describe:`Cancel a crawl job.`,builder:ne,handler:async e=>m({command:`browser-run crawl delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await l();d({command:`cf browser-run crawl delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/browser-rendering/crawl/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await u();if(e.accountId=r,!await _({force:!!e.force}))return;let i=await h(`Deleting`,async()=>t.send(te,{account_id:r,job_id:e[`job-id`]}));p(i,{successLabel:`Deleted`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl/${t.job_id}`,query:[`cacheTTL`,`status`,`cursor`,`limit`],errors:{400:`BadRequestError`,500:`InternalServerError`}};function ae(e){return e.usage(`$0 browser-run crawl get <job-id>
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t}from"./autoconfig-
|
|
2
|
+
import{i as e,r as t}from"./autoconfig-CQjvJ8Rp.mjs";import{N as n}from"./dist-DwxlJ9Ms.mjs";import{t as r}from"./log-Brx-wjJW.mjs";import{t as i}from"./cli-exit-CstFZ1eJ.mjs";import{n as a,t as o}from"./spawn-BXaiweDp.mjs";import s from"node:path";import{readBuildOutput as c}from"@cloudflare/build-output-utils";import{convertToWranglerConfig as l}from"@cloudflare/config";var u=class extends Error{constructor(e){super(e),this.name=`BuildOutputConfigError`}};function d(e,t){if(e!==void 0){if(t===void 0)throw new u(`The Build Output does not record which mode it was created with, but this command requested mode "${e}". Rebuild with "--mode ${e}" before deploying.`);if(t!==e)throw new u(`The Build Output was created with mode "${t}", but this command requested mode "${e}". To use the existing Build Output, rerun with "--mode ${t}". To deploy in ${e} mode, rebuild with "--mode ${e}" before deploying.`)}}function f(e,t){if(e!==void 0&&t)throw new u(`Temporary accounts can't be used when a specific account ID ("${e}") is set in your config file. Remove \`--temporary-account\` to use that account, or remove \`accountId\` from your config file and rebuild to use a temporary account.`)}const p={type:`string`,description:`Name of the Worker in the Build Output to use (defaults to the default Worker)`,requiresArg:!0,coerce:e=>{if(Array.isArray(e))throw Error(`--worker can only be specified once.`);return e}};function m(e,t){if(t===void 0)return e.default;let n=Object.values(e).filter(e=>e.config.name===t);if(n.length>1)throw new u(`The Build Output contains more than one Worker named "${t}".`);if(n[0]!==void 0)return n[0];let{default:r,...i}=e;throw new u(`The Build Output has no Worker named "${t}". Available Workers: ${[`${r.config.name} (default)`,...Object.values(i).map(e=>e.config.name).sort()].join(`, `)}.`)}function h(e){let t=process.env.CLOUDFLARE_CI_OVERRIDE_WORKER_NAME;return!t||t===e.config.name?{worker:e,workerNameOverridden:!1}:(r.warn(`Failed to match Worker name. Your config file is using the Worker name "${e.config.name}", but the CI system expected "${t}". Overriding using the CI provided Worker name.`),{worker:{...e,config:{...e.config,name:t}},workerNameOverridden:!0})}function g(){let e=process.env.CLOUDFLARE_CI_MATCH_WORKER_TAG;if(!e)return()=>{};let t=process.env.WRANGLER_CI_MATCH_TAG;return process.env.WRANGLER_CI_MATCH_TAG=e,()=>{t===void 0?delete process.env.WRANGLER_CI_MATCH_TAG:process.env.WRANGLER_CI_MATCH_TAG=t}}function _(e,t){let n=e.config,{buildContext:r,...i}=t,{manifest:a,...o}=n,c=l({...i,worker:o,containers:[]});n.manifest?.mainModule&&e.bundleDir&&(c.main=s.join(e.bundleDir,n.manifest.mainModule));let u=s.resolve(`cloudflare.config.ts`),{validationConfig:d,containerReferences:f}=y(c),p=v(d,e.configPath,u);b(p,f);let{containers:m,...h}=p;return{wranglerConfig:h,builtConfig:n}}function v(e,t,r){let{config:i,diagnostics:a}=n(e,t,r,{});if(a.hasErrors())throw new u(a.renderErrors());return a.hasWarnings()&&console.warn(a.renderWarnings()),i}function y(e){let{containers:t,...n}=e,r=/* @__PURE__ */ new Map;return n.exports!==void 0&&(n.exports=Object.fromEntries(Object.entries(n.exports).map(([e,t])=>{if(!(`container`in t)||typeof t.container!=`string`)return[e,t];r.set(e,t.container);let{container:n,...i}=t;return[e,i]}))),{validationConfig:n,containerReferences:r}}function b(e,t){e.exports!==void 0&&t.size!==0&&(e.exports=Object.fromEntries(Object.entries(e.exports).map(([e,n])=>{let r=t.get(e);return[e,r===void 0?n:{...n,container:r}]})))}function x(e){return e}async function S(n,{worker:s,dryRun:l=!1,...u}={},d={}){let f=u.output??`stderr`,p=process.cwd(),{details:h,configuration:g,setupNeeded:v}=await t(p,{...u,dryRun:l});if(v)return`setup-needed`;let y=g?.buildCommand??h?.buildCommand,b={...h?.env,...d.isPreview?{CLOUDFLARE_PREVIEW_BUILD:`true`}:{}};if(y&&n&&!h?.framework?.supportsMode)throw Error(`The detected command \`${y}\` does not currently support \`--mode\`.`);f!==`silent`&&r.section(`Build`);let x=n?[`--mode`,n]:[],S;if(y)S=await e(y,p,{...u,preferLocal:!0,env:b,args:x});else{let e=a(p);f!==`silent`&&r.message(`Delegating to ${C(e)}`),S=await o(e,`build`,x,{...u,env:b})}if(S.exitCode!==0||S.signal)throw new i(S.exitCode,{signal:S.signal});let{workers:w,rootConfig:T}=await c(p);return _(m(w,s),T),f!==`silent`&&r.success(`Build complete`),`built`}function C(e){switch(e.impl.pkg){case`@cloudflare/vite-plugin`:return`Vite`;case`wrangler`:return`Wrangler`;case`cloudflare-py-dev-server`:return`the Python dev server`;case`cloudflare-rs-dev-server`:return`the Rust dev server`;default:return e.impl.pkg}}const w={command:`build`,describe:`Build a project for Cloudflare`,builder:x,handler:async e=>{await S(e.mode)}};export{p as a,f as c,h as i,d as l,S as n,_ as o,g as r,m as s,w as t,u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-NIRm11Ab.mjs";import{t as r}from"./dry-run-mrA7FFLR.mjs";import{a as i,t as a}from"./context-CroqTqbk.mjs";import{t as o}from"./local-B3zt9PXR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./progress-DQfZZwit.mjs";import{t as l}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import{c as u,i as d,n as f,o as p,r as m,t as h}from"./body-parser-HN91kAf0.mjs";import{n as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-e6K5lhdE.mjs";import{t as b}from"./body-unions-QFGGUlIr.mjs";var ee={method:`PUT`,path:t=>e`/accounts/${t.account_id}/builds/builds/${t.build_uuid}/cancel`,errors:{401:`UnauthorizedError`,404:`NotFoundError`}};function te(e){return e.usage(`$0 builds cancel <build-uuid>
|
|
3
3
|
|
|
4
4
|
Cancel a queued or running build.`).positional(`build-uuid`,{type:`string`,description:`UUID of the build, as returned by builds list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`cancel <build-uuid>`,describe:`Cancel a Workers build`,builder:te,handler:async e=>l({command:`builds cancel`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();r({command:`cf builds cancel`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/builds/builds/${e[`build-uuid`]==null?`<build-uuid>`:encodeURIComponent(String(e[`build-uuid`]))}/cancel`,pathParams:{"build-uuid":String(e[`build-uuid`]??``)},bodyKind:`none`});return}let t=await n(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Updating`,async()=>t.send(ee,{account_id:l,build_uuid:e[`build-uuid`]}));s(u,{successLabel:`Updated`})})};function re(e){return e.usage(`$0 builds create <worker>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-cj71dGxS.mjs";import{i as r}from"./context-DlFhI9cN.mjs";import{r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./run-DAg7dfIW.mjs";import{t as l}from"./progress-AML-AVs4.mjs";import{a as u,i as d,n as f}from"./prompt-Bnon9lfK.mjs";import"./telemetry-DDs3zhdw.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/invalidate_cache`,body:`json`};function h(e){return e.usage("$0 cache invalidate-environment <environment-id>\n\nMarks cached content as stale for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/invalidate_cache`: the next request for invalidated content makes Cloudflare revalidate it with your origin, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To delete the content instead, use `POST /zones/{zone_id}/environments/{environment_id}/purge_cache`. Invalidating by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`invalidate-environment <environment-id>`,describe:`Invalidate Cached Content by Environment`,builder:h,handler:async e=>c({command:`cache invalidate-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the environment's cache as stale.`}))return;if(e.body!==void 0){let t=a,n=await l(`Processing`,async()=>c.send(m,{body:t,zone_id:u,environment_id:e[`environment-id`]}));s(n,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`));s(d,{successLabel:`Done`})})};var _={method:`POST`,path:t=>e`/zones/${t.zone_id}/invalidate_cache`,body:`json`};function ee(e){return e.usage("$0 cache invalidate\n\nMarks cached content as stale in every Cloudflare data center and cache tier, including Cache Reserve. The content stays in cache. The next request for it makes Cloudflare revalidate it with your origin, using the `ETag` and `Last-Modified` values it was cached with: - If your origin answers `304 Not Modified`, Cloudflare serves the cached copy without downloading it again, and `CF-Cache-Status` is `REVALIDATED`. - If your origin sends a full response, Cloudflare serves and caches the new content, and `CF-Cache-Status` is `EXPIRED`. With Tiered Cache, each tier revalidates with the tier above it, so a visitor can see `EXPIRED` even when your origin answered `304`. Until content is revalidated, your `stale-while-revalidate` and `stale-if-error` directives still apply, counted from the time you invalidated it. For example, if your origin fails during revalidation, Cloudflare can keep serving the stale copy for the `stale-if-error` window. ### Invalidate or purge? - **Invalidate** when content may not have changed, for example after a deploy. Unchanged content costs your origin a `304` instead of a full response. That saving needs an origin that sends `ETag` or `Last-Modified` and answers conditional requests. Otherwise, every revalidation downloads the full response. - **Purge**, with `POST /zones/{zone_id}/purge_cache`, when content must not be served again, for example content you removed for legal or security reasons. Invalidating takes the same request bodies as purging, needs the same permission, and counts against the same rate limits. After a broad invalidation, such as `purge_everything`, expect more conditional requests to your origin while visitors request the invalidated content again. ### Choose what to invalidate Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. To check, request an invalidated URL and confirm that the `CF-Cache-Status` response header is `REVALIDATED` or `EXPIRED`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`invalidate`,describe:`Invalidate Cached Content`,builder:ee,handler:async e=>c({command:`cache invalidate`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the zone's cache as stale.`}))return;if(e.body!==void 0){let e=a,t=await l(`Processing`,async()=>c.send(_,{body:e,zone_id:u}));s(t,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/invalidate_cache`));s(d,{successLabel:`Done`})})};var ne={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function re(e){return e.usage("$0 cache origin-cloud-regions bulk delete\n\nRemoves up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`delete`,describe:`Batch delete origin cloud region mappings`,builder:re,handler:async e=>c({command:`cache origin-cloud-regions bulk delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,await f({force:!!e.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`})&&e.body!==void 0){let e=t,n=await l(`Deleting`,async()=>a.send(ne,{body:e,zone_id:c}));s(n,{successLabel:`Deleted`})}})};var ae={method:`PUT`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function v(e){return e.usage("$0 cache origin-cloud-regions bulk update\n\nUpserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`update`,describe:`Batch create or replace origin cloud region mappings`,builder:v,handler:async e=>c({command:`cache origin-cloud-regions bulk update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,e.body!==void 0){let e=t,n=await l(`Updating`,async()=>a.send(ae,{body:e,zone_id:c}));s(n,{successLabel:`Updated`})}})},b={command:`bulk`,describe:`Operations for origin-cloud-regions.bulk`,builder:e=>e.command(ie).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function S(e){return e.usage(`$0 cache origin-cloud-regions delete <origin-ip>
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-NIRm11Ab.mjs";import{i as r}from"./context-CroqTqbk.mjs";import{r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./run-DhU17ztU.mjs";import{t as l}from"./progress-DQfZZwit.mjs";import{a as u,i as d,n as f}from"./prompt-e6K5lhdE.mjs";import"./telemetry-CruYXv5e.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/invalidate_cache`,body:`json`};function h(e){return e.usage("$0 cache invalidate-environment <environment-id>\n\nMarks cached content as stale for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/invalidate_cache`: the next request for invalidated content makes Cloudflare revalidate it with your origin, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To delete the content instead, use `POST /zones/{zone_id}/environments/{environment_id}/purge_cache`. Invalidating by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`invalidate-environment <environment-id>`,describe:`Invalidate Cached Content by Environment`,builder:h,handler:async e=>c({command:`cache invalidate-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the environment's cache as stale.`}))return;if(e.body!==void 0){let t=a,n=await l(`Processing`,async()=>c.send(m,{body:t,zone_id:u,environment_id:e[`environment-id`]}));s(n,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`));s(d,{successLabel:`Done`})})};var _={method:`POST`,path:t=>e`/zones/${t.zone_id}/invalidate_cache`,body:`json`};function ee(e){return e.usage("$0 cache invalidate\n\nMarks cached content as stale in every Cloudflare data center and cache tier, including Cache Reserve. The content stays in cache. The next request for it makes Cloudflare revalidate it with your origin, using the `ETag` and `Last-Modified` values it was cached with: - If your origin answers `304 Not Modified`, Cloudflare serves the cached copy without downloading it again, and `CF-Cache-Status` is `REVALIDATED`. - If your origin sends a full response, Cloudflare serves and caches the new content, and `CF-Cache-Status` is `EXPIRED`. With Tiered Cache, each tier revalidates with the tier above it, so a visitor can see `EXPIRED` even when your origin answered `304`. Until content is revalidated, your `stale-while-revalidate` and `stale-if-error` directives still apply, counted from the time you invalidated it. For example, if your origin fails during revalidation, Cloudflare can keep serving the stale copy for the `stale-if-error` window. ### Invalidate or purge? - **Invalidate** when content may not have changed, for example after a deploy. Unchanged content costs your origin a `304` instead of a full response. That saving needs an origin that sends `ETag` or `Last-Modified` and answers conditional requests. Otherwise, every revalidation downloads the full response. - **Purge**, with `POST /zones/{zone_id}/purge_cache`, when content must not be served again, for example content you removed for legal or security reasons. Invalidating takes the same request bodies as purging, needs the same permission, and counts against the same rate limits. After a broad invalidation, such as `purge_everything`, expect more conditional requests to your origin while visitors request the invalidated content again. ### Choose what to invalidate Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. To check, request an invalidated URL and confirm that the `CF-Cache-Status` response header is `REVALIDATED` or `EXPIRED`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`invalidate`,describe:`Invalidate Cached Content`,builder:ee,handler:async e=>c({command:`cache invalidate`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the zone's cache as stale.`}))return;if(e.body!==void 0){let e=a,t=await l(`Processing`,async()=>c.send(_,{body:e,zone_id:u}));s(t,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/invalidate_cache`));s(d,{successLabel:`Done`})})};var ne={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function re(e){return e.usage("$0 cache origin-cloud-regions bulk delete\n\nRemoves up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`delete`,describe:`Batch delete origin cloud region mappings`,builder:re,handler:async e=>c({command:`cache origin-cloud-regions bulk delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,await f({force:!!e.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`})&&e.body!==void 0){let e=t,n=await l(`Deleting`,async()=>a.send(ne,{body:e,zone_id:c}));s(n,{successLabel:`Deleted`})}})};var ae={method:`PUT`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function v(e){return e.usage("$0 cache origin-cloud-regions bulk update\n\nUpserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`update`,describe:`Batch create or replace origin cloud region mappings`,builder:v,handler:async e=>c({command:`cache origin-cloud-regions bulk update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,e.body!==void 0){let e=t,n=await l(`Updating`,async()=>a.send(ae,{body:e,zone_id:c}));s(n,{successLabel:`Updated`})}})},b={command:`bulk`,describe:`Operations for origin-cloud-regions.bulk`,builder:e=>e.command(ie).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function S(e){return e.usage(`$0 cache origin-cloud-regions delete <origin-ip>
|
|
3
3
|
|
|
4
4
|
Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted IP on success. Returns 404 if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.`).positional(`origin-ip`,{type:`string`,description:`Origin IP address whose mapping should be deleted.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <origin-ip>`,describe:`Delete an origin cloud region mapping`,builder:S,handler:async e=>c({command:`cache origin-cloud-regions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/${e[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(e[`origin-ip`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"origin-ip":String(e[`origin-ip`]??``)},bodyKind:`none`});return}let t=await n(e),i=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await f({force:!!e.force,message:`Are you sure you want to delete this Origin Cloud Region configuration?`}))return;let a=await l(`Deleting`,async()=>t.send(x,{zone_id:i,origin_ip:e[`origin-ip`]}));s(a,{successLabel:`Deleted`})})};var w={method:`GET`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function T(e){return e.usage(`$0 cache origin-cloud-regions get <origin-ip>
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./output-PRKYaJuo.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{d as r,i,l as a,p as o,t as s}from"./run-
|
|
2
|
+
import{n as e,t}from"./output-PRKYaJuo.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{d as r,i,l as a,p as o,t as s}from"./run-DhU17ztU.mjs";import"./ui-CA_2sliN.mjs";import{t as c}from"./log-Brx-wjJW.mjs";import{t as l}from"./cli-exit-CstFZ1eJ.mjs";import{n as u,t as d}from"./metadata-Df5kCWJv.mjs";const f={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{o(!1);let{enabled:t,source:i}=r();if(t){let e=`${a(i)}=true`;c.warn(`cf is collecting usage telemetry because ${n.code(e)} overrides this setting.`)}else e(`cf is no longer collecting usage telemetry.`)}},p={command:`enable`,describe:`Enable cf telemetry collection`,handler:()=>{o(!0);let{enabled:t,source:i}=r();if(t)e(`cf is now collecting anonymous usage telemetry. Thank you for helping make cf better.`);else{let e=`${a(i)}${i===`env`||i===`wrangler-env`?`=false`:``}`;c.warn(`cf is not collecting usage telemetry because ${n.code(e)} overrides this setting.`)}}};function m({enabled:e,source:t}){let r=e?n.success(`Enabled`):n.error(`Disabled`),i=a(t);return`Status: ${r}${i?` (set by ${i})`:``}\n`}const h={command:`status`,describe:`Check whether cf telemetry collection is enabled`,handler:()=>{console.log(m(r())),console.log(n.muted(`Configure on this machine: \`cf cli telemetry enable\` / \`cf cli telemetry disable\`.
|
|
3
3
|
Override per invocation with ${i}=true/false. DO_NOT_TRACK is also honored.\nLearn more: https://github.com/cloudflare/cf/blob/main/packages/cli/telemetry.md`))}},g={command:`telemetry`,describe:`Configure whether cf collects anonymous usage telemetry`,builder:e=>e.command(h).command(p).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_=`KEYS`,v=`VALUES`;var y=class{constructor(e,t){let n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=b(this._path);if(b(t)===``)return{done:!1,value:this.result()};let n=e.get(b(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=b(this._path).keys;e.pop(),e.length>0||(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>b(e)).filter(e=>e!==``).join(``)}value(){return b(this._path).node.get(``)}result(){switch(this._type){case v:return this.value();case _:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}};const b=e=>e[e.length-1],x=(e,t,n)=>{let r=/* @__PURE__ */ new Map;if(t===void 0)return r;let i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let e=0;e<i;++e)o[e]=e;for(let e=1;e<a;++e)o[e*i]=e;return S(e,t,n,r,o,1,i,``),r},S=(e,t,n,r,i,a,o,s)=>{let c=a*o;key:for(let l of e.keys())if(l===``){let t=i[c-1];t<=n&&r.set(s,[e.get(l),t])}else{let c=a;for(let e=0;e<l.length;++e,++c){let r=l[e],a=o*c,s=a-o,u=i[a],d=Math.max(0,c-n-1),f=Math.min(o-1,c+n);for(let e=d;e<f;++e){let n=r!==t[e],o=i[s+e]+ +n,c=i[s+e+1]+1,l=i[a+e]+1,d=i[a+e+1]=Math.min(o,c,l);d<u&&(u=d)}if(u>n)continue key}S(e.get(l),t,n,r,i,c,o,s+l)}};var C=class e{constructor(e=/* @__PURE__ */ new Map,t=``){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(t){if(!t.startsWith(this._prefix))throw Error(`Mismatched prefix`);let[n,r]=w(this._tree,t.slice(this._prefix.length));if(n===void 0){let[n,i]=A(r);for(let r of n.keys())if(r!==``&&r.startsWith(i)){let a=/* @__PURE__ */ new Map;return a.set(r.slice(i.length),n.get(r)),new e(a,t)}}return new e(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,D(this._tree,e)}entries(){return new y(this,`ENTRIES`)}forEach(e){for(let[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return x(this._tree,e,t)}get(e){let t=T(this._tree,e);return t===void 0?void 0:t.get(``)}has(e){let t=T(this._tree,e);return t!==void 0&&t.has(``)}keys(){return new y(this,_)}set(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);return this._size=void 0,E(this._tree,e).set(``,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=E(this._tree,e);return n.set(``,t(n.get(``))),this}fetch(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=E(this._tree,e),r=n.get(``);return r===void 0&&n.set(``,r=t()),r}values(){return new y(this,v)}[Symbol.iterator](){return this.entries()}static from(t){let n=new e;for(let[e,r]of t)n.set(e,r);return n}static fromObject(t){return e.from(Object.entries(t))}};const w=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(let r of e.keys())if(r!==``&&t.startsWith(r))return n.push([e,r]),w(e.get(r),t.slice(r.length),n);return n.push([e,t]),w(void 0,``,n)},T=(e,t)=>{if(t.length===0||e==null)return e;for(let n of e.keys())if(n!==``&&t.startsWith(n))return T(e.get(n),t.slice(n.length))},E=(e,t)=>{let n=t.length;outer:for(let r=0;e&&r<n;){for(let i of e.keys())if(i!==``&&t[r]===i[0]){let a=Math.min(n-r,i.length),o=1;for(;o<a&&t[r+o]===i[o];)++o;let s=e.get(i);if(o===i.length)e=s;else{let n=/* @__PURE__ */ new Map;n.set(i.slice(o),s),e.set(t.slice(r,r+o),n),e.delete(i),e=n}r+=o;continue outer}let i=/* @__PURE__ */ new Map;return e.set(t.slice(r),i),i}return e},D=(e,t)=>{let[n,r]=w(e,t);if(n!==void 0){if(n.delete(``),n.size===0)O(r);else if(n.size===1){let[e,t]=n.entries().next().value;k(r,e,t)}}},O=e=>{if(e.length===0)return;let[t,n]=A(e);if(t.delete(n),t.size===0)O(e.slice(0,-1));else if(t.size===1){let[n,r]=t.entries().next().value;n!==``&&k(e.slice(0,-1),n,r)}},k=(e,t,n)=>{if(e.length===0)return;let[r,i]=A(e);r.set(i+t,n),r.delete(i)},A=e=>e[e.length-1];var j=class e{constructor(e){if(e?.fields==null)throw Error(`MiniSearch: option "fields" must be provided`);let t=e.autoVacuum==null||e.autoVacuum===!0?H:e.autoVacuum;this._options={...L,...e,autoVacuum:t,searchOptions:{...R,...e.searchOptions||{}},autoSuggestOptions:{...z,...e.autoSuggestOptions||{}}},this._index=new C,this._documentCount=0,this._documentIds=/* @__PURE__ */ new Map,this._idToShortId=/* @__PURE__ */ new Map,this._fieldIds={},this._fieldLength=/* @__PURE__ */ new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=/* @__PURE__ */ new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=V,this.addFields(this._options.fields)}add(e){let{extractField:t,stringifyField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,s=t(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(s))throw Error(`MiniSearch: duplicate ID ${s}`);let c=this.addDocumentId(s);this.saveStoredFields(c,e);for(let o of a){let a=t(e,o);if(a==null)continue;let s=r(n(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.addFieldLength(c,l,this._documentCount-1,u);for(let e of s){let t=i(e,o);if(Array.isArray(t))for(let e of t)this.addTerm(l,c,e);else t&&this.addTerm(l,c,t)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:n=10}=t,r={chunk:[],promise:Promise.resolve()},{chunk:i,promise:a}=e.reduce(({chunk:e,promise:t},r,i)=>(e.push(r),(i+1)%n===0?{chunk:[],promise:t.then(()=>new Promise(e=>setTimeout(e,0))).then(()=>this.addAll(e))}:{chunk:e,promise:t}),r);return a.then(()=>this.addAll(i))}remove(e){let{tokenize:t,processTerm:n,extractField:r,stringifyField:i,fields:a,idField:o}=this._options,s=r(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);let c=this._idToShortId.get(s);if(c==null)throw Error(`MiniSearch: cannot remove document with ID ${s}: it is not in the index`);for(let o of a){let a=r(e,o);if(a==null)continue;let s=t(i(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.removeFieldLength(c,l,this._documentCount,u);for(let e of s){let t=n(e,o);if(Array.isArray(t))for(let e of t)this.removeTerm(l,c,e);else t&&this.removeTerm(l,c,t)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(s),this._fieldLength.delete(c),--this._documentCount}removeAll(e){if(e)for(let t of e)this.remove(t);else if(arguments.length>0)throw Error(`Expected documents to be present. Omit the argument to remove all documents.`);else this._index=new C,this._documentCount=0,this._documentIds=/* @__PURE__ */ new Map,this._idToShortId=/* @__PURE__ */ new Map,this._fieldLength=/* @__PURE__ */ new Map,this._avgFieldLength=[],this._storedFields=/* @__PURE__ */ new Map,this._nextId=0}discard(e){let t=this._idToShortId.get(e);if(t==null)throw Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((e,n)=>{this.removeFieldLength(t,n,this._documentCount,e)}),this._fieldLength.delete(t),--this._documentCount,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:r}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let t of e)this.discard(t)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:n}=this._options,r=n(e,t);this.discard(r),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum??=this._currentVacuum.then(()=>{let t=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=V,this.performVacuuming(e,t)}),this._enqueuedVacuum):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let n=this._dirtCount;if(this.vacuumConditionsMet(t)){let t=e.batchSize||B.batchSize,r=e.batchWait||B.batchWait,i=1;for(let[e,n]of this._index){for(let[e,t]of n)for(let[r]of t)this._documentIds.has(r)||(t.size<=1?n.delete(e):t.delete(r));this._index.get(e).size===0&&this._index.delete(e),i%t===0&&await new Promise(e=>setTimeout(e,r)),i+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:n}=e;return t||=H.minDirtCount,n||=H.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=n}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(t,n={}){let{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(let[e,{score:t,terms:n,match:r}]of a){let a=n.length||1,s={id:this._documentIds.get(e),score:t*a,terms:Object.keys(r),queryTerms:n,match:r};Object.assign(s,this._storedFields.get(e)),(i.filter==null||i.filter(s))&&o.push(s)}return t===e.wildcard&&i.boostDocument==null||o.sort(G),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let n=/* @__PURE__ */ new Map;for(let{score:r,terms:i}of this.search(e,t)){let e=i.join(` `),t=n.get(e);t==null?n.set(e,{score:r,terms:i,count:1}):(t.score+=r,t.count+=1)}let r=[];for(let[e,{score:t,terms:i,count:a}]of n)r.push({suggestion:e,terms:i,score:t/a});return r.sort(G),r}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(L.hasOwnProperty(e))return M(L,e);throw Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=q(r),s._fieldLength=q(i),s._storedFields=q(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);for(let[e,t]of n){let n=/* @__PURE__ */ new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),q(r))}s._index.set(e,n)}return s}static async loadJSAsync(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=await J(r),s._fieldLength=await J(i),s._storedFields=await J(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);let c=0;for(let[e,t]of n){let n=/* @__PURE__ */ new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),await J(r))}++c%1e3==0&&await Y(0),s._index.set(e,n)}return s}static instantiateMiniSearch(t,n){let{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:s,serializationVersion:c}=t;if(c!==1&&c!==2)throw Error(`MiniSearch: cannot deserialize an index created with an incompatible version`);let l=new e(n);return l._documentCount=r,l._nextId=i,l._idToShortId=/* @__PURE__ */ new Map,l._fieldIds=a,l._avgFieldLength=o,l._dirtCount=s||0,l._index=new C,l}executeQuery(t,n={}){if(t===e.wildcard)return this.executeWildcardQuery(n);if(typeof t!=`string`){let e={...n,...t,queries:void 0},r=t.queries.map(t=>this.executeQuery(t,e));return this.combineResults(r,e.combineWith)}let{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:s,processTerm:c}=o,l=s(t).flatMap(e=>c(e)).filter(e=>!!e).map(I(o)).map(e=>this.executeQuerySpec(e,o));return this.combineResults(l,o.combineWith)}executeQuerySpec(e,t){let n={...this._options.searchOptions,...t},r=(n.fields||this._options.fields).reduce((e,t)=>({...e,[t]:M(n.boost,t)||1}),{}),{boostDocument:i,weights:a,maxFuzzy:o,bm25:s}=n,{fuzzy:c,prefix:l}={...R.weights,...a},u=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,u,r,i,s),f,p;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let t=e.fuzzy===!0?.2:e.fuzzy,n=t<1?Math.min(o,Math.round(e.term.length*t)):t;n&&(p=this._index.fuzzyGet(e.term,n))}if(f)for(let[t,n]of f){let a=t.length-e.term.length;if(!a)continue;p?.delete(t);let o=l*t.length/(t.length+.3*a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}if(p)for(let t of p.keys()){let[n,a]=p.get(t);if(!a)continue;let o=c*t.length/(t.length+a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}return d}executeWildcardQuery(e){let t=/* @__PURE__ */ new Map,n={...this._options.searchOptions,...e};for(let[e,r]of this._documentIds){let i=n.boostDocument?n.boostDocument(r,``,this._storedFields.get(e)):1;t.set(e,{score:i,terms:[],match:{}})}return t}combineResults(e,t=`or`){if(e.length===0)return/* @__PURE__ */ new Map;let n=t.toLowerCase(),r=N[n];if(!r)throw Error(`Invalid combination operator: ${t}`);return e.reduce(r)||/* @__PURE__ */ new Map}toJSON(){let e=[];for(let[t,n]of this._index){let r={};for(let[e,t]of n)r[e]=Object.fromEntries(t);e.push([t,r])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,n,r,i,a,o,s,c=/* @__PURE__ */ new Map){if(i==null)return c;for(let l of Object.keys(a)){let u=a[l],d=this._fieldIds[l],f=i.get(d);if(f==null)continue;let p=f.size,m=this._avgFieldLength[d];for(let i of f.keys()){if(!this._documentIds.has(i)){this.removeTerm(d,i,t),--p;continue}let a=o?o(this._documentIds.get(i),t,this._storedFields.get(i)):1;if(!a)continue;let h=f.get(i),g=this._fieldLength.get(i)[d],_=F(h,p,this._documentCount,g,m,s),v=n*r*u*a*_,y=c.get(i);if(y){y.score+=v,U(y.terms,e);let n=M(y.match,t);n?n.push(l):y.match[t]=[l]}else c.set(i,{score:v,terms:[e],match:{[t]:[l]}})}}return c}addTerm(e,t,n){let r=this._index.fetch(n,K),i=r.get(e);if(i==null)i=/* @__PURE__ */ new Map,i.set(t,1),r.set(e,i);else{let e=i.get(t);i.set(t,(e||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}let r=this._index.fetch(n,K),i=r.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(e,t,n){for(let r of Object.keys(this._fieldIds))if(this._fieldIds[r]===t){this._options.logger(`warn`,`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${r}". Removing a document after it has changed can corrupt the index!`,`version_conflict`);return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,n,r){let i=this._fieldLength.get(e);i??this._fieldLength.set(e,i=[]),i[t]=r;let a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)}removeFieldLength(e,t,n,r){if(n===1){this._avgFieldLength[t]=0;return}let i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)}saveStoredFields(e,t){let{storeFields:n,extractField:r}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(e);i??this._storedFields.set(e,i={});for(let e of n){let n=r(t,e);n!==void 0&&(i[e]=n)}}};j.wildcard=Symbol(`*`);const M=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,N={or:(e,t)=>{for(let n of t.keys()){let r=e.get(n);if(r==null)e.set(n,t.get(n));else{let{score:e,terms:i,match:a}=t.get(n);r.score+=e,r.match=Object.assign(r.match,a),W(r.terms,i)}}return e},and:(e,t)=>{let n=/* @__PURE__ */ new Map;for(let r of t.keys()){let i=e.get(r);if(i==null)continue;let{score:a,terms:o,match:s}=t.get(r);W(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,s)})}return n},and_not:(e,t)=>{for(let n of t.keys())e.delete(n);return e}},P={k:1.2,b:.7,d:.5},F=(e,t,n,r,i,a)=>{let{k:o,b:s,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-s+s*r/i)))},I=e=>(t,n,r)=>({term:t,fuzzy:typeof e.fuzzy==`function`?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:typeof e.prefix==`function`?e.prefix(t,n,r):e.prefix===!0,termBoost:typeof e.boostTerm==`function`?e.boostTerm(t,n,r):1}),L={idField:`id`,extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(X),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])==`function`&&console[e](t)},autoVacuum:!0},R={combineWith:`or`,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:P},z={combineWith:`and`,prefix:(e,t,n)=>t===n.length-1},B={batchSize:1e3,batchWait:10},V={minDirtFactor:.1,minDirtCount:20},H={...B,...V},U=(e,t)=>{e.includes(t)||e.push(t)},W=(e,t)=>{for(let n of t)e.includes(n)||e.push(n)},G=({score:e},{score:t})=>t-e,K=()=>/* @__PURE__ */ new Map,q=e=>{let t=/* @__PURE__ */ new Map;for(let n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},J=async e=>{let t=/* @__PURE__ */ new Map,n=0;for(let r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3==0&&await Y(0);return t},Y=e=>new Promise(t=>setTimeout(t,e)),X=/[\n\r\p{Z}\p{P}]+/u;function Z(e){return!e.hideCommand&&!e.search?.exclude}function Q(e,t){let n=e.fullPath.slice(0,-1).map((t,n)=>e.fullPath.slice(0,n+1).join(` `));return{command:e.command,summary:e.summary||e.description.split(`
|
|
4
4
|
`)[0]||``,description:e.description,keywords:e.search?.keywords?.join(` `)??``,context:[...n.map(e=>t[e]??``),...e.arguments.map(e=>`${e.name} ${e.description}`),...e.options.map(e=>`${e.name} ${e.description}`)].join(` `)}}function $(e,t){let n=e.commands.filter(Z).map(t=>Q(t,e.descriptions??{})),r=new j({fields:[`command`,`summary`,`description`,`keywords`,`context`],storeFields:[`command`,`summary`],idField:`command`});return r.addAll(n),r.search(t,{prefix:!0,fuzzy:.2,boost:{command:8,summary:5,description:2,keywords:5,context:.5}}).slice(0,5).map(({command:e,summary:t})=>({command:e,summary:t}))}const ee={command:`search <query>`,describe:`Search all CLI commands by intent`,builder:e=>e.positional(`query`,{describe:`Search terms or a description of what you want to do`,type:`string`,demandOption:!0}),handler:e=>s({command:`cli search`,recordArgs:!1,searchQuery:e.query},e,()=>{let n=u(import.meta.url,`commands.json`,d);if(!n)throw console.error(`Error: Could not load commands.json.`),new l(1);t($(n,e.query))})},te={command:`cli`,describe:`Discover commands and configure the cf CLI`,builder:e=>e.command(ee).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{i as n}from"./context-CroqTqbk.mjs";import{t as r}from"./dry-run-mrA7FFLR.mjs";import{t as i}from"./output-PRKYaJuo.mjs";import{t as a}from"./progress-DQfZZwit.mjs";import{t as o}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import{r as s,t as c}from"./body-parser-HN91kAf0.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,i as d,n as f}from"./prompt-e6K5lhdE.mjs";var p={method:`GET`,path:t=>e`/zones/${t.zone_id}/page_shield/connections/${t.connection_id}`};function m(e){return e.usage(`$0 client-side-security connections get <connection-id>
|
|
3
3
|
|
|
4
4
|
Returns a webpage connection detected on the zone by connection ID.`).positional(`connection-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <connection-id>`,describe:`Get a detected connection`,builder:m,handler:async e=>o({command:`client-side-security connections get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf client-side-security connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/page_shield/connections/${e[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(e[`connection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"connection-id":String(e[`connection-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(p,{zone_id:s,connection_id:e[`connection-id`]}));i(c,{successLabel:`Loaded`})})};var g={method:`GET`,path:t=>e`/zones/${t.zone_id}/page_shield/connections`,query:[`exclude_urls`,`urls`,`hosts`,`page`,`per_page`,`order_by`,`direction`,`prioritize_malicious`,`exclude_cdn_cgi`,`status`,`page_url`,`export`]};function _(e){return e.usage(`$0 client-side-security connections list
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-NIRm11Ab.mjs";import{i as n}from"./context-CroqTqbk.mjs";import{t as r}from"./dry-run-mrA7FFLR.mjs";import{t as i}from"./output-PRKYaJuo.mjs";import{t as a}from"./progress-DQfZZwit.mjs";import{t as o}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import{r as s}from"./body-parser-HN91kAf0.mjs";var c={method:`GET`,path:t=>e`/zones/${t.zone_id}/cloud_connector/rules`};function l(e){return e.usage(`$0 cloud-connector rules list
|
|
3
3
|
|
|
4
4
|
Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Rules`,builder:l,handler:async e=>o({command:`cloud-connector rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let l=await a(`Loading`,async()=>o.send(c,{zone_id:s}));i(l,{successLabel:`Loaded`})})};var d={method:`PUT`,path:t=>e`/zones/${t.zone_id}/cloud_connector/rules`,body:`json`};function f(e){return e.usage(`$0 cloud-connector rules update
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t}from"./auth-
|
|
2
|
+
import{i as e,n as t}from"./auth-NIRm11Ab.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{t as r}from"./dry-run-mrA7FFLR.mjs";import{n as i,t as a}from"./input-validation-D7z60HJH.mjs";import{a as o,t as s}from"./context-CroqTqbk.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./output-PRKYaJuo.mjs";import{t as u}from"./progress-DQfZZwit.mjs";import{t as d}from"./run-DhU17ztU.mjs";import"./telemetry-CruYXv5e.mjs";import"./api-Dnt6lRJG.mjs";import{a as f,c as p,i as m,o as h,r as g,t as _}from"./body-parser-HN91kAf0.mjs";import{a as v,i as y,n as b}from"./prompt-e6K5lhdE.mjs";import{t as x}from"./body-unions-QFGGUlIr.mjs";import{n as S,t as C}from"./raw-fetch-DXSBORQI.mjs";function ee(e){return e.usage(`$0 cloudforce-one binary-storage create
|
|
3
3
|
|
|
4
4
|
Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`create`,describe:`Posts a file to Binary Storage`,builder:ee,handler:async n=>d({command:`cloudforce-one binary-storage create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf cloudforce-one binary-storage create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/binary`,pathParams:{},bodyKind:`multipart`,body:{body:n.body,file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=await t(n),f=n.local?c:await s();if(n.accountId=f,n.file!==void 0||n.body!==void 0){let t=new FormData;if(n.file!==void 0){let e=a(n.file);t.append(`file`,new Blob([e]),n.file.split(/[\\/]/).filter(Boolean).pop())}else n.body!==void 0&&t.append(`file`,n.body);let r=await u(`Creating`,async()=>e(d,`POST`,`/accounts/${f}/cloudforce-one/binary`,{body:t}));l(r,{successLabel:`Created`})}else if(n.body!==void 0){let t=i(n.body,`body`,`binary`),r=await u(`Creating`,async()=>e(d,`POST`,`/accounts/${f}/cloudforce-one/binary`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));l(r,{successLabel:`Created`})}})};var ne={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/binary/${e.hash}`,response:!1,errors:{400:`BadRequestError`}};function re(e){return e.usage(`$0 cloudforce-one binary-storage get <hash>
|
|
5
5
|
|
|
@@ -175,7 +175,7 @@ Returns a dataset by its ID.`).positional(`dataset-id`,{type:`string`,descriptio
|
|
|
175
175
|
|
|
176
176
|
Lists the account's datasets. Set \`includeDeleted\` to include deleted datasets.`).option(`include-deleted`,{type:`boolean`,description:"When true, include soft-deleted datasets in the response. Each item includes a `deletedAt` field (ISO 8601 or null). Default: false."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ja={command:`list`,describe:`List datasets`,builder:Aa,handler:async e=>d({command:`cloudforce-one threat-intel datasets list`,classification:{safeFlags:[`include-deleted`,`dry-run`]}},e,async()=>{let n={includeDeleted:e[`include-deleted`]};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/dataset`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(ka,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};var Ma={method:`POST`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/populate`,errors:{400:`BadRequestError`}};function Na(e){return e.usage(`$0 cloudforce-one threat-intel datasets populate
|
|
177
177
|
|
|
178
|
-
Rebuilds the lists of attackers, categories, indicator types, and target industries for the account's datasets from their existing events. Datasets are processed in batches.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pa={command:`populate`,describe:`Rebuild dataset lookup lists`,builder:Na,handler:async e=>d({command:`cloudforce-one threat-intel datasets populate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets populate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/populate`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Creating`,async()=>n.send(Ma,{account_id:i}));l(a,{successLabel:`Created`})})};var Fa={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,query:[`scope`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function Ia(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences delete\n\nRemoves your default datasets (`scope` `user`) or the account's (`scope` `account`). After you remove your own, requests that omit `datasetId` use the account's default datasets, if set.").option(`scope`,{type:`string`,description:"`user` removes your own default datasets. `account` removes the account's, and requires permission to edit the account's Cloudforce One settings.",choices:[`user`,`account`],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 La={command:`delete`,describe:`Remove default datasets`,builder:Ia,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences delete`,classification:{safeFlags:[`scope`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={scope:e.scope};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets preferences delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();if(e.accountId=a,!await b({force:!!e.force}))return;let d=await u(`Deleting`,async()=>i.send(Fa,{account_id:a,...n}));l(d,{successLabel:`Deleted`})})};var Ra={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function za(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences get\n\nReturns your default datasets, the account's default datasets, and the datasets that event searches currently use when `datasetId` is omitted. `unresolvableDatasetIds` lists saved datasets you can no longer read.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ba={command:`get`,describe:`Get default datasets`,builder:za,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets preferences get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(Ra,{account_id:i}));l(a,{successLabel:`Loaded`})})};var Va={method:`PUT`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function Ha(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences update\n\nSets the datasets to use when a request omits `datasetId`, for you (`scope` `user`) or for the account (`scope` `account`). Your own default datasets take precedence over the account's. Every dataset must exist and be readable by the account.").option(`dataset-ids`,{type:`string`,array:!0,description:"The dataset UUIDs to use when a request omits `datasetId`: 1 to 50 datasets you can read. Duplicates are ignored."}).option(`scope`,{type:`string`,description:"`user` sets your own default datasets. `account` sets the default datasets for everyone in the account who has not set their own, and requires permission to edit the account's Cloudforce One settings.",choices:[`user`,`account`]}).coerce(`scope`,e=>i(e,`scope`,`text`)).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 Ua={command:`update`,describe:`Set default datasets`,builder:Ha,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences update`,classification:{safeFlags:[`scope`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel datasets preferences update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({datasetIds:e[`dataset-ids`],scope:e.scope}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),i=await t(e),a=e.local?c:await s();if(e.accountId=a,e.body!==void 0){let e=n,t=await u(`Updating`,async()=>i.send(Va,{body:e,account_id:a}));l(t,{successLabel:`Updated`});return}if(e[`dataset-ids`]===void 0)throw Error(`--dataset-ids is required (or pass --body with this field set).`);e.scope===void 0&&(e.scope=await y(`scope`,"`user` sets your own default datasets. `account` sets the default datasets for everyone in the account who has not set their own, and requires permission to edit the account's Cloudforce One settings.",[`user`,`account`]));let d=_({datasetIds:e[`dataset-ids`],scope:e.scope}),f=await u(`Updating`,async()=>i.send(Va,{body:d,account_id:a}));l(f,{successLabel:`Updated`})})},Wa={command:`preferences`,describe:`Operations for threat-intel.datasets.preferences`,builder:e=>e.command(La).command(Ba).command(Ua).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ga={method:`PATCH`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/dataset/${e.dataset_id}`,body:`json`,errors:{400:`BadRequestError`}};function Ka(e){return e.usage("$0 cloudforce-one threat-intel datasets update <dataset-id>\n\nUpdates a dataset's `name` and `isPublic` setting. Both fields are required.").positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qa={command:`update <dataset-id>`,describe:`Update a dataset`,builder:Ka,handler:async e=>d({command:`cloudforce-one threat-intel datasets update`,classification:{safeFlags:[`is-public`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel datasets update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/dataset/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?_({isPublic:e[`is-public`],name:i(e.name,`name`,`text`)}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),a=await t(e),d=e.local?c:await s();if(e.accountId=d,e.body!==void 0){let t=n,r=await u(`Updating`,async()=>a.send(Ga,{body:t,account_id:d,dataset_id:e[`dataset-id`]}));l(r,{successLabel:`Updated`});return}if(e[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await v(`name`,`Used to describe the dataset within the account context.`));let f=_({isPublic:e[`is-public`],name:i(e.name,`name`,`text`)}),p=await u(`Updating`,async()=>a.send(Ga,{body:f,account_id:d,dataset_id:e[`dataset-id`]}));l(p,{successLabel:`Updated`})})},Ja={command:`datasets`,describe:`Operations for threat-intel.datasets`,builder:e=>e.command(Sa).command(Ta).command(Oa).command(ja).command(Pa).command(qa).command(ya).command(Wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ya={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/aggregate`,query:[`aggregateBy`,`datasetId`,`startDate`,`endDate`,`groupByDate`,`limit`],errors:{400:`BadRequestError`}};function Xa(e){return e.usage("$0 cloudforce-one threat-intel events aggregate\n\nCounts events grouped by one or more columns, such as `attacker` or `targetIndustry`. Optionally filter by date range and group the counts by day.").option(`aggregate-by`,{type:`string`,description:"Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry'). With `tags`, an event counts once for each of its tags, in the bucket counts and in `total`, and events without tags count as `Unknown`; `tags` is not supported for analytics datasets.",demandOption:!0}).option(`dataset-id`,{type:`string`,array:!0,description:`Dataset UUIDs to filter by, or one standalone scope value: 'all'/'*' or 'operational' for readable intelligence datasets (isAnalytics=false), or 'analytics' for readable analytics datasets (isAnalytics=true). Scope values query at most 50 datasets. If not provided, uses the default dataset.`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Za={command:`aggregate`,describe:`Aggregate events`,builder:Xa,handler:async e=>d({command:`cloudforce-one threat-intel events aggregate`,classification:{safeFlags:[`group-by-date`,`dry-run`]}},e,async()=>{let n={aggregateBy:e[`aggregate-by`],datasetId:e[`dataset-id`],startDate:e[`start-date`],endDate:e[`end-date`],groupByDate:e[`group-by-date`],limit:e.limit};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel events aggregate`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/aggregate`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(Ya,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};var Qa={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/attackers`,query:[`datasetIds`],errors:{400:`BadRequestError`}};function $a(e){return e.usage("$0 cloudforce-one threat-intel events attackers list\n\nLists the attackers referenced by events in the datasets given by `datasetIds`, or in the default dataset when `datasetIds` is omitted.").option(`dataset-ids`,{type:`string`,array:!0,description:`Array of dataset IDs to query attackers from. If not provided, uses the default dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eo={command:`list`,describe:`List attackers`,builder:$a,handler:async e=>d({command:`cloudforce-one threat-intel events attackers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={datasetIds:e[`dataset-ids`]};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel events attackers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/attackers`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(Qa,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})},to={command:`attackers`,describe:`Operations for threat-intel.events.attackers`,builder:e=>e.command(eo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var no={method:`POST`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/create/bulk`,body:`json`,errors:{400:`BadRequestError`}};function ro(e){return e.usage("$0 cloudforce-one threat-intel events bulk-create\n\nCreates multiple events in one dataset. `datasetId` is required; to find dataset IDs, use `threat-intel datasets list`. Set `includeCreatedEvents` to return the UUIDs of the created events.").option(`data`,{type:`string`,description:`The data field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"category": string, "date": string, "event": string, "raw": {...}, "tlp": string, ...more}].`}).option(`dataset-id`,{type:`string`,description:`The datasetId field`}).option(`include-created-events`,{type:`boolean`,description:`When true, response includes array of created event UUIDs and shard IDs. Useful for tracking which events were created and where.`}).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 io={command:`bulk-create`,describe:`Create events in bulk`,builder:ro,handler:async e=>d({command:`cloudforce-one threat-intel events bulk-create`,classification:{safeFlags:[`include-created-events`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel events bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/create/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({data:h(e.data,`data`),datasetId:i(e[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:e[`include-created-events`]}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),a=await t(e),d=e.local?c:await s();if(e.accountId=d,e.body!==void 0){let e=n,t=await u(`Creating`,async()=>a.send(no,{body:e,account_id:d}));l(t,{successLabel:`Created`});return}if(e.data===void 0)throw Error(`--data is required (or pass --body with this field set).`);e[`dataset-id`]===void 0&&(e[`dataset-id`]=await v(`dataset-id`,`The datasetId field`));let f=_({data:h(e.data,`data`),datasetId:i(e[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:e[`include-created-events`]}),p=await u(`Creating`,async()=>a.send(no,{body:f,account_id:d}));l(p,{successLabel:`Created`})})};var ao={method:`PATCH`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/update/bulk`,body:`json`,errors:{400:`BadRequestError`}};function oo(e){return e.usage(`$0 cloudforce-one threat-intel events bulk-update
|
|
178
|
+
Rebuilds the lists of attackers, categories, indicator types, and target industries for the account's datasets from their existing events. Datasets are processed in batches.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pa={command:`populate`,describe:`Rebuild dataset lookup lists`,builder:Na,handler:async e=>d({command:`cloudforce-one threat-intel datasets populate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets populate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/populate`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Creating`,async()=>n.send(Ma,{account_id:i}));l(a,{successLabel:`Created`})})};var Fa={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,query:[`scope`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function Ia(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences delete\n\nRemoves your default datasets (`scope` `user`) or the account's (`scope` `account`). After you remove your own, requests that omit `datasetId` use the account's default datasets, if set.").option(`scope`,{type:`string`,description:"`user` removes your own default datasets. `account` removes the account's, and requires permission to edit the account's Cloudforce One settings.",choices:[`user`,`account`],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 La={command:`delete`,describe:`Remove default datasets`,builder:Ia,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences delete`,classification:{safeFlags:[`scope`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={scope:e.scope};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets preferences delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();if(e.accountId=a,!await b({force:!!e.force}))return;let d=await u(`Deleting`,async()=>i.send(Fa,{account_id:a,...n}));l(d,{successLabel:`Deleted`})})};var Ra={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function za(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences get\n\nReturns your default datasets, the account's default datasets, and the datasets that event searches currently use when `datasetId` is omitted. `unresolvableDatasetIds` lists saved datasets you can no longer read.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ba={command:`get`,describe:`Get default datasets`,builder:za,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel datasets preferences get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(Ra,{account_id:i}));l(a,{successLabel:`Loaded`})})};var Va={method:`PUT`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/datasets/preferences`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function Ha(e){return e.usage("$0 cloudforce-one threat-intel datasets preferences update\n\nSets the datasets to use when a request omits `datasetId`, for you (`scope` `user`) or for the account (`scope` `account`). Your own default datasets take precedence over the account's. Every dataset must exist and be readable by the account, and the list cannot mix analytics and intelligence datasets.").option(`dataset-ids`,{type:`string`,array:!0,description:"The dataset UUIDs to use when a request omits `datasetId`: 1 to 50 datasets you can read, either all analytics datasets or all intelligence datasets. Duplicates are ignored."}).option(`scope`,{type:`string`,description:"`user` sets your own default datasets. `account` sets the default datasets for everyone in the account who has not set their own, and requires permission to edit the account's Cloudforce One settings.",choices:[`user`,`account`]}).coerce(`scope`,e=>i(e,`scope`,`text`)).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 Ua={command:`update`,describe:`Set default datasets`,builder:Ha,handler:async e=>d({command:`cloudforce-one threat-intel datasets preferences update`,classification:{safeFlags:[`scope`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel datasets preferences update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/datasets/preferences`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({datasetIds:e[`dataset-ids`],scope:e.scope}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),i=await t(e),a=e.local?c:await s();if(e.accountId=a,e.body!==void 0){let e=n,t=await u(`Updating`,async()=>i.send(Va,{body:e,account_id:a}));l(t,{successLabel:`Updated`});return}if(e[`dataset-ids`]===void 0)throw Error(`--dataset-ids is required (or pass --body with this field set).`);e.scope===void 0&&(e.scope=await y(`scope`,"`user` sets your own default datasets. `account` sets the default datasets for everyone in the account who has not set their own, and requires permission to edit the account's Cloudforce One settings.",[`user`,`account`]));let d=_({datasetIds:e[`dataset-ids`],scope:e.scope}),f=await u(`Updating`,async()=>i.send(Va,{body:d,account_id:a}));l(f,{successLabel:`Updated`})})},Wa={command:`preferences`,describe:`Operations for threat-intel.datasets.preferences`,builder:e=>e.command(La).command(Ba).command(Ua).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ga={method:`PATCH`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/dataset/${e.dataset_id}`,body:`json`,errors:{400:`BadRequestError`}};function Ka(e){return e.usage("$0 cloudforce-one threat-intel datasets update <dataset-id>\n\nUpdates a dataset's `name` and `isPublic` setting. Both fields are required.").positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qa={command:`update <dataset-id>`,describe:`Update a dataset`,builder:Ka,handler:async e=>d({command:`cloudforce-one threat-intel datasets update`,classification:{safeFlags:[`is-public`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel datasets update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/dataset/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?_({isPublic:e[`is-public`],name:i(e.name,`name`,`text`)}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),a=await t(e),d=e.local?c:await s();if(e.accountId=d,e.body!==void 0){let t=n,r=await u(`Updating`,async()=>a.send(Ga,{body:t,account_id:d,dataset_id:e[`dataset-id`]}));l(r,{successLabel:`Updated`});return}if(e[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await v(`name`,`Used to describe the dataset within the account context.`));let f=_({isPublic:e[`is-public`],name:i(e.name,`name`,`text`)}),p=await u(`Updating`,async()=>a.send(Ga,{body:f,account_id:d,dataset_id:e[`dataset-id`]}));l(p,{successLabel:`Updated`})})},Ja={command:`datasets`,describe:`Operations for threat-intel.datasets`,builder:e=>e.command(Sa).command(Ta).command(Oa).command(ja).command(Pa).command(qa).command(ya).command(Wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ya={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/aggregate`,query:[`aggregateBy`,`datasetId`,`startDate`,`endDate`,`groupByDate`,`limit`],errors:{400:`BadRequestError`}};function Xa(e){return e.usage("$0 cloudforce-one threat-intel events aggregate\n\nCounts events grouped by one or more columns, such as `attacker` or `targetIndustry`. Optionally filter by date range and group the counts by day.").option(`aggregate-by`,{type:`string`,description:"Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry'). With `tags`, an event counts once for each of its tags, in the bucket counts and in `total`, and events without tags count as `Unknown`; `tags` is not supported for analytics datasets.",demandOption:!0}).option(`dataset-id`,{type:`string`,array:!0,description:`Dataset UUIDs to filter by, or one standalone scope value: 'all'/'*' or 'operational' for readable intelligence datasets (isAnalytics=false), or 'analytics' for readable analytics datasets (isAnalytics=true). Scope values query at most 50 datasets. If not provided, uses the default dataset.`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Za={command:`aggregate`,describe:`Aggregate events`,builder:Xa,handler:async e=>d({command:`cloudforce-one threat-intel events aggregate`,classification:{safeFlags:[`group-by-date`,`dry-run`]}},e,async()=>{let n={aggregateBy:e[`aggregate-by`],datasetId:e[`dataset-id`],startDate:e[`start-date`],endDate:e[`end-date`],groupByDate:e[`group-by-date`],limit:e.limit};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel events aggregate`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/aggregate`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(Ya,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};var Qa={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/attackers`,query:[`datasetIds`],errors:{400:`BadRequestError`}};function $a(e){return e.usage("$0 cloudforce-one threat-intel events attackers list\n\nLists the attackers referenced by events in the datasets given by `datasetIds`, or in the default dataset when `datasetIds` is omitted.").option(`dataset-ids`,{type:`string`,array:!0,description:`Array of dataset IDs to query attackers from. If not provided, uses the default dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eo={command:`list`,describe:`List attackers`,builder:$a,handler:async e=>d({command:`cloudforce-one threat-intel events attackers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={datasetIds:e[`dataset-ids`]};if(e.dryRun){let e=await o();r({command:`cf cloudforce-one threat-intel events attackers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/events/attackers`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(Qa,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})},to={command:`attackers`,describe:`Operations for threat-intel.events.attackers`,builder:e=>e.command(eo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var no={method:`POST`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/create/bulk`,body:`json`,errors:{400:`BadRequestError`}};function ro(e){return e.usage("$0 cloudforce-one threat-intel events bulk-create\n\nCreates multiple events in one dataset. `datasetId` is required; to find dataset IDs, use `threat-intel datasets list`. Set `includeCreatedEvents` to return the UUIDs of the created events.").option(`data`,{type:`string`,description:`The data field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"category": string, "date": string, "event": string, "raw": {...}, "tlp": string, ...more}].`}).option(`dataset-id`,{type:`string`,description:`The datasetId field`}).option(`include-created-events`,{type:`boolean`,description:`When true, response includes array of created event UUIDs and shard IDs. Useful for tracking which events were created and where.`}).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 io={command:`bulk-create`,describe:`Create events in bulk`,builder:ro,handler:async e=>d({command:`cloudforce-one threat-intel events bulk-create`,classification:{safeFlags:[`include-created-events`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel events bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/create/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({data:h(e.data,`data`),datasetId:i(e[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:e[`include-created-events`]}):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),a=await t(e),d=e.local?c:await s();if(e.accountId=d,e.body!==void 0){let e=n,t=await u(`Creating`,async()=>a.send(no,{body:e,account_id:d}));l(t,{successLabel:`Created`});return}if(e.data===void 0)throw Error(`--data is required (or pass --body with this field set).`);e[`dataset-id`]===void 0&&(e[`dataset-id`]=await v(`dataset-id`,`The datasetId field`));let f=_({data:h(e.data,`data`),datasetId:i(e[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:e[`include-created-events`]}),p=await u(`Creating`,async()=>a.send(no,{body:f,account_id:d}));l(p,{successLabel:`Created`})})};var ao={method:`PATCH`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/update/bulk`,body:`json`,errors:{400:`BadRequestError`}};function oo(e){return e.usage(`$0 cloudforce-one threat-intel events bulk-update
|
|
179
179
|
|
|
180
180
|
Applies the same field values to up to 100 events in one dataset. The \`date\` field can't be changed in bulk.`).option(`dataset-id`,{type:`string`,description:`Dataset ID containing the events to update. Required to prevent cross-account modifications.`}).option(`event-ids`,{type:`string`,array:!0,description:`List of event UUIDs to update (1-100)`}).option(`updates-attacker`,{type:`string`,description:`The updates.attacker field`}).option(`updates-attacker-country`,{type:`string`,description:`The updates.attackerCountry field`}).option(`updates-category`,{type:`string`,description:`The updates.category field`}).option(`updates-created-at`,{type:`string`,description:`The updates.createdAt field`}).option(`updates-event`,{type:`string`,description:`The updates.event field`}).option(`updates-indicator`,{type:`string`,description:`The updates.indicator field`}).option(`updates-indicator-type`,{type:`string`,description:`The updates.indicatorType field`}).option(`updates-insight`,{type:`string`,description:`The updates.insight field`}).option(`updates-raw-data`,{type:`string`,description:`The updates.raw.data field. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": unknown}.`}).option(`updates-raw-source`,{type:`string`,description:`The updates.raw.source field`}).option(`updates-raw-tlp`,{type:`string`,description:`The updates.raw.tlp field`}).option(`updates-target-country`,{type:`string`,description:`The updates.targetCountry field`}).option(`updates-target-industry`,{type:`string`,description:`The updates.targetIndustry field`}).option(`updates-tlp`,{type:`string`,description:`The updates.tlp field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const so={command:`bulk-update`,describe:`Update events in bulk`,builder:oo,handler:async e=>d({command:`cloudforce-one threat-intel events bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf cloudforce-one threat-intel events bulk-update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/events/update/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?_({datasetId:i(e[`dataset-id`],`dataset-id`,`text`),eventIds:e[`event-ids`],updates:{attacker:i(e[`updates-attacker`],`updates-attacker`,`text`),attackerCountry:i(e[`updates-attacker-country`],`updates-attacker-country`,`text`),category:i(e[`updates-category`],`updates-category`,`text`),createdAt:i(e[`updates-created-at`],`updates-created-at`,`text`),event:i(e[`updates-event`],`updates-event`,`text`),indicator:i(e[`updates-indicator`],`updates-indicator`,`text`),indicatorType:i(e[`updates-indicator-type`],`updates-indicator-type`,`text`),insight:i(e[`updates-insight`],`updates-insight`,`text`),raw:{data:m(e[`updates-raw-data`],`updates-raw-data`),source:i(e[`updates-raw-source`],`updates-raw-source`,`text`),tlp:i(e[`updates-raw-tlp`],`updates-raw-tlp`,`text`)},targetCountry:i(e[`updates-target-country`],`updates-target-country`,`text`),targetIndustry:i(e[`updates-target-industry`],`updates-target-industry`,`text`),tlp:i(e[`updates-tlp`],`updates-tlp`,`text`)}},[[`updates`,`raw`,`data`]]):g(e.body)});return}let n=e.body===void 0?void 0:g(e.body),a=await t(e),d=e.local?c:await s();if(e.accountId=d,e.body!==void 0){let e=n,t=await u(`Updating`,async()=>a.send(ao,{body:e,account_id:d}));l(t,{successLabel:`Updated`});return}if(e[`dataset-id`]===void 0&&(e[`dataset-id`]=await v(`dataset-id`,`Dataset ID containing the events to update. Required to prevent cross-account modifications.`)),e[`event-ids`]===void 0)throw Error(`--event-ids is required (or pass --body with this field set).`);let f=_({datasetId:i(e[`dataset-id`],`dataset-id`,`text`),eventIds:e[`event-ids`],updates:{attacker:i(e[`updates-attacker`],`updates-attacker`,`text`),attackerCountry:i(e[`updates-attacker-country`],`updates-attacker-country`,`text`),category:i(e[`updates-category`],`updates-category`,`text`),createdAt:i(e[`updates-created-at`],`updates-created-at`,`text`),event:i(e[`updates-event`],`updates-event`,`text`),indicator:i(e[`updates-indicator`],`updates-indicator`,`text`),indicatorType:i(e[`updates-indicator-type`],`updates-indicator-type`,`text`),insight:i(e[`updates-insight`],`updates-insight`,`text`),raw:{data:m(e[`updates-raw-data`],`updates-raw-data`),source:i(e[`updates-raw-source`],`updates-raw-source`,`text`),tlp:i(e[`updates-raw-tlp`],`updates-raw-tlp`,`text`)},targetCountry:i(e[`updates-target-country`],`updates-target-country`,`text`),targetIndustry:i(e[`updates-target-industry`],`updates-target-industry`,`text`),tlp:i(e[`updates-tlp`],`updates-tlp`,`text`)}},[[`updates`,`raw`,`data`]]),p=await u(`Updating`,async()=>a.send(ao,{body:f,account_id:d}));l(p,{successLabel:`Updated`})})};var co={method:`GET`,path:e=>n`/accounts/${e.account_id}/cloudforce-one/events/categories/catalog`,errors:{400:`BadRequestError`}};function lo(e){return e.usage(`$0 cloudforce-one threat-intel events categories catalog list
|
|
181
181
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./context-
|
|
2
|
+
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./context-CroqTqbk.mjs";import{r as n}from"./dotenv-DKRemNCH.mjs";import{n as r}from"./cloudflared-DKh4JK7j.mjs";const i={command:`curl <url>`,describe:`Run curl against an Access-protected application with its JWT injected by cloudflared.`,builder:e=>e.parserConfiguration({"populate--":!0,"parse-positional-numbers":!1,"short-option-groups":!1}).option(`allow-request`,{alias:`ar`,type:`boolean`,description:`Continue the request when no Access token is available`}).positional(`url`,{type:`string`,description:`URL of the Access application`,demandOption:!0}),handler:async i=>{if(i.local)throw Error(`--local is not supported by cf access curl.`);let a=[`access`];throw await n({mode:i.mode,local:i.local},()=>t())===`fedramp_high`&&a.push(`--fedramp`),a.push(`curl`),i[`allow-request`]&&a.push(`--allow-request`),a.push(i.url,...(i[`--`]??[]).map(String)),new e(await r(a))}};export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-
|
|
2
|
+
import{n as e}from"./auth-NIRm11Ab.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{t as n}from"./context-CroqTqbk.mjs";import{t as r}from"./path-DRw6Y-nd.mjs";import{r as i}from"./dotenv-DKRemNCH.mjs";import{t as a}from"./progress-DQfZZwit.mjs";import{n as o,t as s}from"./cloudflared-DKh4JK7j.mjs";import"./api-Dnt6lRJG.mjs";import{r as c}from"./resolve-C3FmNlSO.mjs";import{t as l}from"./get-3XNn0upb.mjs";const u={method:`GET`,path:e=>r`/accounts/${e.account_id}/cfd_tunnel`,query:[`name`,`is_deleted`,`existed_at`,`uuid`,`was_active_at`,`was_inactive_at`,`include_prefix`,`exclude_prefix`,`status`,`per_page`,`page`]},d=1e3;async function f(e,t,n){if(c(n))return n;let r=0,i;for(let a=1;;a++){let o=await e.send(u,{account_id:t,name:n,is_deleted:!1,page:a,per_page:d}),s=o.result??[];for(let e of s)e.name===n&&(r++,i=e.id);let c=o.result_info?.per_page||d;if(s.length<c)break}if(r===0)throw Error(`"${n}" is neither the ID nor the name of any tunnel. Run \`cf tunnels list\` to see available tunnels.`);if(r>1)throw Error(`Found multiple tunnels named "${n}". Pass the tunnel UUID instead.`);if(!i)throw Error(`Tunnel "${n}" was found but has no ID. Pass the tunnel UUID instead.`);return i}async function p(e,t,n){let r=await e.send(l,{account_id:t,tunnel_id:n});if(typeof r!=`string`||r.length===0)throw Error(`The API returned an empty token for tunnel ${n}.`);return r}function m(e){return e.positional(`tunnel`,{type:`string`,description:`Tunnel name or UUID; required unless --token is provided`}).option(`token`,{type:`string`,description:`Tunnel token supplied directly to cloudflared`}).option(`log-level`,{type:`string`,choices:s,default:`info`,description:`cloudflared log level`})}const h={command:`run [tunnel]`,describe:`Run a named Cloudflare Tunnel using the cf-managed cloudflared binary.`,builder:m,handler:async r=>{if(r.local)throw Error(`--local is not supported by cf tunnels run.`);let s=r.token,c=r.tunnel;if(!s){if(!c)throw Error(`Either a tunnel name/UUID or --token must be provided.`);s=await i(r,async()=>{let t=await e(r),i=await n();return a(`Fetching tunnel token`,async()=>{let e=await f(t,i,c);return p(t,i,e)})})}let l=[`tunnel`,`--loglevel`,r[`log-level`]];throw l.push(`run`),new t(await o(l,{env:{TUNNEL_TOKEN:s}}))}};export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./context-
|
|
2
|
+
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./context-CroqTqbk.mjs";import{r as n}from"./dotenv-DKRemNCH.mjs";import{n as r}from"./cloudflared-DKh4JK7j.mjs";const i={command:`login <url>`,describe:`Authenticate with an Access application and store its JWT through cloudflared.`,builder:e=>e.positional(`url`,{type:`string`,description:`URL of the Access application`,demandOption:!0}),handler:async i=>{if(i.local)throw Error(`--local is not supported by cf access login.`);let a=[`access`];throw await n({mode:i.mode,local:i.local},()=>t())===`fedramp_high`&&a.push(`--fedramp`),a.push(`login`),i.quiet&&a.push(`--quiet`),a.push(i.url),new e(await r(a))}};export{i as default};
|