cf 1.0.0-beta.24 → 1.0.0-beta.25
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/dist/_meta/commands.json +478 -141
- package/dist/_meta/hand-written-commands.json +44 -0
- package/dist/_meta/schemas.json +254 -2
- package/dist/{abuse-reports-CTOO4FJ4.mjs → abuse-reports-BIS9MZn7.mjs} +3 -3
- package/dist/{access-DFGLlXpy.mjs → access-__sFDSFL.mjs} +1 -1
- package/dist/{accounts-C-wpV8Az.mjs → accounts-CmggwRjh.mjs} +36 -34
- package/dist/{acm-thIt17mv.mjs → acm-AAhRZUAU.mjs} +1 -1
- package/dist/{addressing-D7VI7-Oi.mjs → addressing-DVeJNPZc.mjs} +1 -1
- package/dist/{agent-memory-duLTH8pl.mjs → agent-memory-DQhWO6sc.mjs} +1 -1
- package/dist/{ai-ctIjDCq0.mjs → ai-CULO9sno.mjs} +3 -3
- package/dist/{ai-audit-CjhuS21p.mjs → ai-audit-udn4HF34.mjs} +1 -1
- package/dist/{ai-gateway-B1TIw7wl.mjs → ai-gateway-Bm2MMdec.mjs} +3 -3
- package/dist/{ai-search-DUQBnOWH.mjs → ai-search-GRN_gXgU.mjs} +1 -1
- package/dist/{ai-security-bdABwEIR.mjs → ai-security-DXy9ht-9.mjs} +2 -2
- package/dist/{alerting-I_KErGZy.mjs → alerting-CssnaN2i.mjs} +1 -1
- package/dist/{analytics-DGxcDAWu.mjs → analytics-BVo7Ax0w.mjs} +1 -1
- package/dist/{analytics-engine-DNNokw1O.mjs → analytics-engine-BBd0Bydx.mjs} +1 -1
- package/dist/{api-security-CsPrJ-Xw.mjs → api-security-C-D9OKtH.mjs} +3 -3
- package/dist/{argo-BhNmRYk5.mjs → argo-DSziwzvA.mjs} +1 -1
- package/dist/{artifacts-DRo8KadB.mjs → artifacts-nVMgn4dn.mjs} +1 -1
- package/dist/{audit-logs-CzxDyTbx.mjs → audit-logs-DIZ5oA_y.mjs} +1 -1
- package/dist/auth-Bls_1yRW.mjs +2 -0
- package/dist/{auth-pbuzyz4C.mjs → auth-CB9wjyad.mjs} +1 -1
- package/dist/auth-JsvLULHA.mjs +7 -0
- package/dist/{auth-token-BcIV7k1B.mjs → auth-token-BAgw7kYP.mjs} +1 -1
- package/dist/{autoconfig-CXcy-e1R.mjs → autoconfig-CajkMb3B.mjs} +19 -11
- package/dist/{basin-catalog-DoTn8zvi.mjs → basin-catalog-BRvGeKm3.mjs} +9 -9
- package/dist/{billing-CMbLzZV0.mjs → billing-BhPoqyKC.mjs} +1 -1
- package/dist/{blocks-DmOx-xEv.mjs → blocks-D2tE8dp2.mjs} +1 -1
- package/dist/{bot-management-CJs5WwAW.mjs → bot-management-BfjX5DuH.mjs} +1 -1
- package/dist/{botnet-feed-DeF7P5lI.mjs → botnet-feed-VOL5P4s3.mjs} +1 -1
- package/dist/{brand-protection-dx_B8OWa.mjs → brand-protection-CSVHQ9Pt.mjs} +2 -2
- package/dist/{browser-run-fRn9ItYu.mjs → browser-run-cxOd2cZE.mjs} +1 -1
- package/dist/{build-CCepbVuJ.mjs → build-BfkzV5_c.mjs} +1 -1
- package/dist/build-DCdLWwOg.mjs +2 -0
- package/dist/{builds-5YhQ_zIm.mjs → builds-y5BQCJ81.mjs} +1 -1
- package/dist/{cache-WQyxt7O5.mjs → cache-Bvr988Hj.mjs} +1 -1
- package/dist/cf-DgLg6Hop.mjs +18 -0
- package/dist/{chunk-3PJ54H4K-C8sxQzhB.mjs → chunk-3PJ54H4K-CbRAWQWI.mjs} +1 -1
- package/dist/{chunk-DSGVRFIS-CP2xC0bc.mjs → chunk-DSGVRFIS-Dq2PrGsi.mjs} +1 -1
- package/dist/{cli-CgkhNdjb.mjs → cli-BTxJfFus.mjs} +1 -1
- package/dist/{client-side-security-COuAb7BM.mjs → client-side-security-CFmO0uz9.mjs} +1 -1
- package/dist/{cloud-connector-D1gjX0Dx.mjs → cloud-connector-CtwPdFBa.mjs} +1 -1
- package/dist/{cloudflared-FEg1GxHT.mjs → cloudflared-DPkNN1Qv.mjs} +1 -1
- package/dist/{cloudforce-one-BmXgL6kB.mjs → cloudforce-one-DHrMaxnU.mjs} +58 -58
- package/dist/{command-BfoLlrr1.mjs → command-6_Ms3TZv.mjs} +1 -1
- package/dist/{command-DrdxR1tJ.mjs → command-BWyx7dNO.mjs} +1 -1
- package/dist/{command-qhfkede5.mjs → command-BXCk1OsI.mjs} +1 -1
- package/dist/{command-WyIFe__L.mjs → command-CCDzJjIB.mjs} +1 -1
- package/dist/{command-BG9JYUHo.mjs → command-CDYTsmxe.mjs} +1 -1
- package/dist/{command-Dsi4sM8D.mjs → command-CXwKBbj9.mjs} +1 -1
- package/dist/{command-8hWrCCy6.mjs → command-ClneauMx.mjs} +1 -1
- package/dist/{command-BJFKdqVc.mjs → command-CmK8-DJ9.mjs} +1 -1
- package/dist/{command-BaIY4UuC.mjs → command-Ct3tf-P5.mjs} +1 -1
- package/dist/{command-hh8rEbH4.mjs → command-DPOjEs1B.mjs} +1 -1
- package/dist/{command-D3E7d8E7.mjs → command-DqWBPiew.mjs} +1 -1
- package/dist/{command-BXPssGfS.mjs → command-YFWLEK8W.mjs} +1 -1
- package/dist/{command-CA6yIa17.mjs → command-ckixJeTm.mjs} +1 -1
- package/dist/{command-B_Fxpr5v.mjs → command-lJJ7sEZe.mjs} +1 -1
- package/dist/{completions-BshG3sAO.mjs → completions-B1rYgw_a.mjs} +1 -1
- package/dist/{connector-interrupts-pNU4QmsW.mjs → connector-interrupts-DecTdK6X.mjs} +1 -1
- package/dist/{connector-telemetry-events-BpRPtTdD.mjs → connector-telemetry-events-wePxPACj.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-pNfynA2r.mjs → connector-telemetry-snapshots-D8sXR1qx.mjs} +1 -1
- package/dist/{connectors-CiWTAGHh.mjs → connectors-C-6RQ_Q1.mjs} +1 -1
- package/dist/{containers-IBtaInTL.mjs → containers-C_byVTZF.mjs} +193 -193
- package/dist/{containers-Dvq0NjQg.mjs → containers-D65Gpj9Q.mjs} +2 -2
- package/dist/{content-scan-B69hOyhb.mjs → content-scan-DbIDQ-Yu.mjs} +1 -1
- package/dist/{context-BryBS1zQ.mjs → context-DCon1tRZ.mjs} +1 -1
- package/dist/{cps-DLgWaZMT.mjs → cps-DGLmzCzp.mjs} +1 -1
- package/dist/{csam-scanner-D1928b81.mjs → csam-scanner-R7Ih-Dnw.mjs} +1 -1
- package/dist/{custom-csrs-DrxWBjmx.mjs → custom-csrs-D0RnVoJ7.mjs} +1 -1
- package/dist/{custom-hostnames-BP1pxK1F.mjs → custom-hostnames-BFWR-tR_.mjs} +1 -1
- package/dist/{custom-nameservers-5DJLY479.mjs → custom-nameservers-Dn_9Ssti.mjs} +1 -1
- package/dist/{custom-pages-CNAsOY9a.mjs → custom-pages-HqIQcb77.mjs} +1 -1
- package/dist/{d1-Dge80Qgq.mjs → d1-CopIY9RT.mjs} +2 -2
- package/dist/{delegate-CBKb0nov.mjs → delegate-CTj0dYET.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-CR5b7uhB.mjs → deploy-BVTA83rN.mjs} +1 -1
- package/dist/{deploy-context-D51tgJGI.mjs → deploy-context-CO8ZSRwx.mjs} +1 -1
- package/dist/{deploy-input-em95cFc7.mjs → deploy-input-PhKRxa_2.mjs} +1 -1
- package/dist/{dev-BczBHbpj.mjs → dev-CM5GLHNn.mjs} +1 -1
- package/dist/{diagnostics-BKKinCge.mjs → diagnostics-DPjl0aCm.mjs} +1 -1
- package/dist/{dist-D5YYi2LO.mjs → dist-ataVE8ob.mjs} +3 -3
- package/dist/{dls-DU4HnxED.mjs → dls-BLTIVlbh.mjs} +1 -1
- package/dist/{dns-BzdH3geY.mjs → dns-DkqVq-nB.mjs} +60 -58
- package/dist/{dns-firewall-puq_86Wd.mjs → dns-firewall-D1bb1byu.mjs} +1 -1
- package/dist/{docs-AWb7X2VX.mjs → docs-tOv_OllI.mjs} +1 -1
- package/dist/{durable-objects-Dg6XPcsB.mjs → durable-objects-OJhns_to.mjs} +1 -1
- package/dist/{email-auth-DXR0NU9R.mjs → email-auth-BbsIBNlu.mjs} +1 -1
- package/dist/{email-domains-B00mAtjT.mjs → email-domains-pWZi1M4q.mjs} +1 -1
- package/dist/{email-routing-Cm19q9hA.mjs → email-routing-DnitWE1A.mjs} +1 -1
- package/dist/{email-security-CFKcS-DM.mjs → email-security-DiWtb7cx.mjs} +2 -2
- package/dist/{email-sending-B3xSoKcC.mjs → email-sending-DuDjXykw.mjs} +1 -1
- package/dist/{errors-CIQDUrWg.mjs → errors-CCFmptqJ.mjs} +1 -1
- package/dist/{field-extractors-Csz8QknP.mjs → field-extractors-DNNnkBZH.mjs} +1 -1
- package/dist/{firewall-C8FW0Nb2.mjs → firewall-C7eZRNVF.mjs} +22 -16
- package/dist/{flagship-v-bGZ_U-.mjs → flagship-BczjsrJ5.mjs} +1 -1
- package/dist/{fraud-VvfL2I5a.mjs → fraud-wE0UM2SM.mjs} +1 -1
- package/dist/{google-tag-gateway-DF6fS2MQ.mjs → google-tag-gateway-6mvtxcJK.mjs} +1 -1
- package/dist/{healthchecks-D3p3E4WL.mjs → healthchecks-aIB3DebS.mjs} +1 -1
- package/dist/{hyperdrive-DopYL1dK.mjs → hyperdrive-DHRP8SJS.mjs} +1 -1
- package/dist/{iam-cIfyshlf.mjs → iam-6t7-ScrS.mjs} +1 -1
- package/dist/{images-BR5fP_6r.mjs → images-CLgvxd0t.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-JXRQoqGP.mjs → init-B_DBTMXU.mjs} +1 -1
- package/dist/{intel-BvNrrM7V.mjs → intel-jnoIVlYG.mjs} +2 -2
- package/dist/{interactive-DOWEcR6_.mjs → interactive-1g0dnrA8.mjs} +1 -1
- package/dist/{internal-DcnAVlpA.mjs → internal-Ba3b-Z8J.mjs} +1 -1
- package/dist/{ips-BUEIuhhw.mjs → ips-CQ4gFfex.mjs} +1 -1
- package/dist/{k2-Dm4LvAhL.mjs → k2-Bsm6rzNX.mjs} +1 -1
- package/dist/{kv-7oD-JIak.mjs → kv-DQfnNE-w.mjs} +1 -1
- package/dist/{lazy-command-CD1nuS38.mjs → lazy-command-DjGzxiUT.mjs} +1 -1
- package/dist/{leaked-credential-checks-B6s8hUYU.mjs → leaked-credential-checks-CaqjG3Oz.mjs} +1 -1
- package/dist/list-4MfEFwJN.mjs +2 -0
- package/dist/list-ByCv9-Fl.mjs +2 -0
- package/dist/{live-CHP4AXSN.mjs → live-BfobGv8W.mjs} +1 -1
- package/dist/{load-balancers-B_yvINGW.mjs → load-balancers-BzSCp2Uh.mjs} +1 -1
- package/dist/{local-CIeKNHSz.mjs → local-BNmz58v4.mjs} +1 -1
- package/dist/local-ChR3YIMU.mjs +2 -0
- package/dist/{local-runtime-DOSBgJlo.mjs → local-runtime-DvH92pV8.mjs} +1 -1
- package/dist/{login-h8vuvNN3.mjs → login-B9wYab6S.mjs} +2 -2
- package/dist/login-ierSCYE6.mjs +2 -0
- package/dist/{logpush-B70rNMOP.mjs → logpush-DgfiSd1b.mjs} +2 -2
- package/dist/{logs-DqmqCNqQ.mjs → logs-Dan7xU-k.mjs} +1 -1
- package/dist/{magic-cloud-networking-CurtlBvl.mjs → magic-cloud-networking-DP8fWC4a.mjs} +3 -3
- package/dist/{magic-network-monitoring-OzpX7MfI.mjs → magic-network-monitoring-TAjt04vN.mjs} +1 -1
- package/dist/{magic-transit-Ca_CROhr.mjs → magic-transit-BSuLHnQ5.mjs} +1 -1
- package/dist/{managed-defense-BRxv0mgy.mjs → managed-defense-CTnIZLg4.mjs} +1 -1
- package/dist/{managed-transforms-C7YLIPdN.mjs → managed-transforms-BETvesjp.mjs} +1 -1
- package/dist/{mcp-B_StIx94.mjs → mcp-DhjMGaKc.mjs} +1 -1
- package/dist/{mesh-YW-p6Tkx.mjs → mesh-jxLLG3t4.mjs} +1 -1
- package/dist/{migrate-CrBgU7Xm.mjs → migrate-Bkhk38nJ.mjs} +1 -1
- package/dist/{monetization-rMP8HK_4.mjs → monetization-BqDgHlPv.mjs} +1 -1
- package/dist/{network-D9Do7C-u.mjs → network-D6BRpgOv.mjs} +2 -2
- package/dist/{network-interconnects-DYMhB3TR.mjs → network-interconnects-tP41GbnL.mjs} +1 -1
- package/dist/{o11y-HT9_9NUF.mjs → o11y-h4cIC_1T.mjs} +1 -1
- package/dist/{oauth-D6uh5ZdS.mjs → oauth-CuM12iNb.mjs} +1 -1
- package/dist/{oauth-clients-B_BJco0Z.mjs → oauth-clients-B0voUiXM.mjs} +1 -1
- package/dist/{oauth-DetIFT59.mjs → oauth-nDH3nTCa.mjs} +2 -2
- package/dist/oauth-scopes-Bhns1ZHW.mjs +4 -0
- package/dist/{organization-DhxMPdqU.mjs → organization-Cy55HoRR.mjs} +4 -4
- package/dist/organizations-7Q3d9vcW.mjs +4 -0
- package/dist/{origin-post-quantum-encryption-CPZQGLmW.mjs → origin-post-quantum-encryption-XBMPCdSL.mjs} +1 -1
- package/dist/package-DK3JX4I3.mjs +2 -0
- package/dist/{page-rules-0nDfdFWr.mjs → page-rules-BlT5xlhH.mjs} +1 -1
- package/dist/{pages-Br-w5HLL.mjs → pages-CIbL62L2.mjs} +2 -2
- package/dist/{pay-per-crawl-Di6UpJoo.mjs → pay-per-crawl-BzsBqo_m.mjs} +1 -1
- package/dist/{pay-per-use-Bm7Nxf6s.mjs → pay-per-use-DtejLYJ8.mjs} +1 -1
- package/dist/{pipelines-BRVI3bV9.mjs → pipelines-LjLb8jq6.mjs} +1 -1
- package/dist/{precursor-DyrQWdO5.mjs → precursor-BKp5_Ag4.mjs} +1 -1
- package/dist/{previews-rpfwcJzi.mjs → previews-zRYO9uO9.mjs} +1 -1
- package/dist/{progress-C_yVLVcl.mjs → progress-_Jux05O5.mjs} +1 -1
- package/dist/{prompt-kxvGZ6nF.mjs → prompt-SNVLBS1b.mjs} +1 -1
- package/dist/{queues-BGV3aC26.mjs → queues-Ci4rGGC4.mjs} +1 -1
- package/dist/{r2-CWMqr3JJ.mjs → r2-qm2hgS43.mjs} +1 -1
- package/dist/radar-C_ydbJe_.mjs +300 -0
- package/dist/{raw-fetch-C_hWBr7n.mjs → raw-fetch-D3ydyJYW.mjs} +1 -1
- package/dist/{ready-BXz5amSL.mjs → ready-hk-_B8z3.mjs} +1 -1
- package/dist/{realtime-9jG5GaNK.mjs → realtime-BAvjYmYw.mjs} +2 -2
- package/dist/{registrar-C-2I1SJh.mjs → registrar-DD7WZaP2.mjs} +10 -10
- package/dist/{registrar-sandbox-D9ldxGPo.mjs → registrar-sandbox-DbxloH5s.mjs} +2 -2
- package/dist/{reporting-Bk3dc6Gi.mjs → reporting-CRVg3J1C.mjs} +1 -1
- package/dist/{request-headers-B5Rjq7Ic.mjs → request-headers-Cn01EsbI.mjs} +1 -1
- package/dist/{request-tracers-H-iRAUdG.mjs → request-tracers-BWs0rdFS.mjs} +1 -1
- package/dist/{resource-sharing-A6ITunsT.mjs → resource-sharing-yipIkdbd.mjs} +2 -2
- package/dist/{rules-BntvQdnS.mjs → rules-CCtaBLiN.mjs} +1 -1
- package/dist/{rulesets-DKz_iYU_.mjs → rulesets-DBEvCNDS.mjs} +1 -1
- package/dist/{rum-D9zpcNqT.mjs → rum-gDOKylu_.mjs} +1 -1
- package/dist/{run-BlSXngtI.mjs → run-Br8sYjNF.mjs} +1 -1
- package/dist/run-LOgTLpob.mjs +2 -0
- package/dist/schema-cache-Cb64Nqbt.mjs +3 -0
- package/dist/schema-flags-BcbbCWR5.mjs +4 -0
- package/dist/{scim-DVhxKKpH.mjs → scim-CM8Xah56.mjs} +1 -1
- package/dist/{secrets-store-3mxJrDWJ.mjs → secrets-store-BEnXiYCC.mjs} +2 -2
- package/dist/{security-insights-BDLWuG0E.mjs → security-insights-Be5GvdBA.mjs} +5 -5
- package/dist/{security-txt-COzdrpdW.mjs → security-txt-BF0PWAEW.mjs} +1 -1
- package/dist/{session-X3xaW70I.mjs → session-B7vOqdZU.mjs} +1 -1
- package/dist/{shared-foRpbmSV.mjs → shared-CBMFY1VY.mjs} +1 -1
- package/dist/{signed-url-Dgi1p-Qi.mjs → signed-url-VDDQlllt.mjs} +1 -1
- package/dist/{smart-shield-DSDA5bZt.mjs → smart-shield-DQku_wYi.mjs} +1 -1
- package/dist/{snippets-myowgDLd.mjs → snippets-B3FCEMuh.mjs} +1 -1
- package/dist/{spawn-C8D5pzxJ.mjs → spawn-9sE67p7c.mjs} +1 -1
- package/dist/{spectrum-CB-NzbZ7.mjs → spectrum-nLirlVue.mjs} +5 -5
- package/dist/{speed-UqKG1WDl.mjs → speed-C1hCyMPy.mjs} +1 -1
- package/dist/{sql-BzikdIje.mjs → sql-DVQOKThL.mjs} +1 -1
- package/dist/{src-B9agxHh8.mjs → src-Bh2gHpI7.mjs} +5 -5
- package/dist/{ssl-BmWWsUX6.mjs → ssl-CYDRgr24.mjs} +2 -2
- package/dist/{startup-profile-B7yHR_YB.mjs → startup-profile-BLvw_Wmc.mjs} +1 -1
- package/dist/startup-profile-ByxSdhEl.mjs +2 -0
- package/dist/{state-DNuVv5i-.mjs → state-B8n0QU04.mjs} +1 -1
- package/dist/state-BTOzaT5L.mjs +2 -0
- package/dist/{stream-G87TzC9e.mjs → stream-DHyejrI6.mjs} +1 -1
- package/dist/{tags-Ctl4fLux.mjs → tags-DOL6dKQE.mjs} +2 -2
- package/dist/{telemetry-CA0_i9-l.mjs → telemetry-DJ8-Q2pU.mjs} +1 -1
- package/dist/telemetry-kjElc1zT.mjs +2 -0
- package/dist/{tenant-t5yPFQOx.mjs → tenant-2EdATz2Y.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-B2ehXfQK.mjs → tenant-custom-nameservers-DhEpJNST.mjs} +1 -1
- package/dist/{tunnels-DL_VgV0P.mjs → tunnels-CMAmH4Vh.mjs} +3 -3
- package/dist/{turnstile-CEjw5vn6.mjs → turnstile-DTJjDMFp.mjs} +1 -1
- package/dist/ui-7zujR-O7.mjs +2 -0
- package/dist/{update-check-LF-JcHRF.mjs → update-check-BkCdHK-3.mjs} +1 -1
- package/dist/{update-check-2Mn4Z1ln.mjs → update-check-DDGKWkmi.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-BL_BkGvP.mjs → url-normalization-BbWOra1u.mjs} +1 -1
- package/dist/{url-scanner-CVzV9Syq.mjs → url-scanner-Bj-eS_3C.mjs} +2 -2
- package/dist/{user-YnQSmPNR.mjs → user-CMzTHHVX.mjs} +1 -1
- package/dist/{vectorize-C5ZwKQzI.mjs → vectorize-D4H7_KPs.mjs} +1 -1
- package/dist/version-DIIJ2ixL.mjs +2 -0
- package/dist/{waiting-rooms-D9V1Fm16.mjs → waiting-rooms-CqMbVu9s.mjs} +1 -1
- package/dist/{web-assets-yzPkWgLy.mjs → web-assets-BgfzyF8t.mjs} +5 -5
- package/dist/{web3-DbWNUhP4.mjs → web3-ByCe47FI.mjs} +1 -1
- package/dist/{workers-r9Aj68v1.mjs → workers-BiLsPkYD.mjs} +2 -2
- package/dist/{workers-builds-DgIDPDhj.mjs → workers-builds-2N71_8MZ.mjs} +1 -1
- package/dist/{workers-for-platforms-CoPp1ez5.mjs → workers-for-platforms-BMN4QXgT.mjs} +1 -1
- package/dist/{workers-vpc-Cvjg15bk.mjs → workers-vpc-3o7dMg7-.mjs} +1 -1
- package/dist/{workflows-D4SIo58Q.mjs → workflows-COiyqt-B.mjs} +1 -1
- package/dist/{wrangler-migration-D2HwxIG5.mjs → wrangler-migration-CqSg8IDj.mjs} +5 -5
- package/dist/{zaraz-CkqpiZBH.mjs → zaraz-DjwhCH8A.mjs} +2 -2
- package/dist/{zero-trust-CEY-lohP.mjs → zero-trust-BmpuDOmH.mjs} +64 -58
- package/dist/{zones-BWieAez1.mjs → zones-XYQiz5kF.mjs} +2 -2
- package/package.json +12 -12
- package/dist/auth-B2V5gsm4.mjs +0 -2
- package/dist/auth-CyF_s5ic.mjs +0 -2
- package/dist/build-CgpCJjPA.mjs +0 -2
- package/dist/cf-CInFH4Ng.mjs +0 -18
- package/dist/local-CTaqb1nl.mjs +0 -2
- package/dist/login-pt6gTX3x.mjs +0 -2
- package/dist/oauth-scopes-Cub2pl0Z.mjs +0 -4
- package/dist/organizations-DIduPB74.mjs +0 -4
- package/dist/package-Bf2u3-yO.mjs +0 -2
- package/dist/radar-D8x_TUAi.mjs +0 -300
- package/dist/run-DB1-Sj9a.mjs +0 -2
- package/dist/schema-flags-CoTAkrz8.mjs +0 -5
- package/dist/startup-profile-zt6cFnBn.mjs +0 -2
- package/dist/state-C5mQ9At8.mjs +0 -2
- package/dist/telemetry-jl3s2-bN.mjs +0 -2
- package/dist/ui-Dt1-eURh.mjs +0 -2
- package/dist/version-Bz705iJe.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-CB9wjyad.mjs";import{i as r}from"./context-DCon1tRZ.mjs";import{t as i}from"./output-BJEgbI0G.mjs";import{t as a}from"./dry-run-gy0Hl9xo.mjs";import{t as o}from"./progress-_Jux05O5.mjs";import{t as s}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{n as c}from"./body-parser-BKcZS9iJ.mjs";function l(e){return e.usage(`$0 ai-audit robots bulk-get
|
|
3
3
|
|
|
4
4
|
Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const u={command:`bulk-get`,describe:`Bulk get robots.txt rules`,builder:l,handler:async e=>s({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e);if(e.zoneId=await r({zone:e.zone},s,{quiet:e.quiet}),e.body){let n=c(e.body);if(Array.isArray(n)&&n.length>25){let r=Math.ceil(n.length/25),a=null;for(let i=0;i<n.length;i+=25){let c=n.slice(i,i+25),l=Math.floor(i/25)+1;a=await o(`Loading: batch ${l}/${r}`,async()=>t(s,`POST`,`/zones/${e.zoneId}/ai-audit/robots/bulk`,{body:c}))}i(a,{successLabel:`Loaded`});return}let r=await o(`Loading`,async()=>t(s,`POST`,`/zones/${e.zoneId}/ai-audit/robots/bulk`,{body:n}));i(r,{successLabel:`Loaded`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var d={method:`GET`,path:t=>e`/zones/${t.zone_id}/ai-audit/robots`,query:[`subdomain`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function f(e){return e.usage(`$0 ai-audit robots get
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{i as n,n as r}from"./auth-CB9wjyad.mjs";import{a as i,t as a}from"./context-DCon1tRZ.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-_Jux05O5.mjs";import{t as l}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as u,n as d,r as f,s as p,t as m}from"./body-parser-BKcZS9iJ.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-SNVLBS1b.mjs";var v={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains`,body:`json`,errors:{400:`BadRequestError`}};function y(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
|
|
3
3
|
|
|
4
4
|
Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`domain`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`."}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>h(e,`min-tls`,`text`)).option(`zone-id`,{type:`string`,description:`ID of the Cloudflare zone that contains the custom hostname.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:y,handler:async e=>l({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({domain:h(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:h(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(v,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}e.domain===void 0&&(e.domain=await g(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let u=m({domain:h(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:h(e[`zone-id`],`zone-id`,`text`)}),f=await c(`Creating`,async()=>n.send(v,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(f,{successLabel:`Created`})})};var x={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function S(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
|
|
5
5
|
|
|
@@ -61,7 +61,7 @@ Replaces the stored API key of a provider key configuration. Only the key can ch
|
|
|
61
61
|
|
|
62
62
|
Updates the configuration of an AI Gateway, such as its caching, rate limiting, logging, and authentication settings.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>h(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>h(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>h(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>h(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>h(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>h(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>h(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>h(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>h(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>h(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>h(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>h(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>h(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>h(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>h(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>h(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>h(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>h(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>h(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>h(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>h(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>h(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>h(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>h(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>h(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>h(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>h(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>h(e,`guardrails-response-s9`,`text`)).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>h(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>h(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>h(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`spend-limits-rules`,{type:`string`,description:`The spend_limits.rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`store-id`,{type:`string`,description:`Secrets Store used by this gateway. Omit on update to keep the current store. Cannot be cleared while stored keys or secret references depend on it.`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`stripe-usage-events`,{type:`string`,description:`The stripe.usage_events field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`]}).coerce(`workers-ai-billing-mode`,e=>h(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr 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)`}).check(e=>{if([`stripe-authorization`,`stripe-usage-events`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`,`stripe-usage-events`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const rt={command:`update <gateway-id>`,describe:`Update a gateway`,builder:nt,handler:async e=>l({command:`ai-gateway gateways update`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:h(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:u(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:u(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:h(e[`store-id`],`store-id`,`text`),stripe:{authorization:h(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:u(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):d(e.body)});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${f}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let g={};e.authentication!==void 0&&p(g,[`authentication`],e.authentication),e[`byok-only`]!==void 0&&p(g,[`byok_only`],e[`byok-only`]),e[`cache-invalidate-on-update`]!==void 0&&p(g,[`cache_invalidate_on_update`],e[`cache-invalidate-on-update`]),e[`cache-ttl`]!==void 0&&p(g,[`cache_ttl`],e[`cache-ttl`]),e[`collect-logs`]!==void 0&&p(g,[`collect_logs`],e[`collect-logs`]),e[`guardrails-prompt-p1`]!==void 0&&p(g,[`guardrails`,`prompt`,`P1`],e[`guardrails-prompt-p1`]),e[`guardrails-prompt-s1`]!==void 0&&p(g,[`guardrails`,`prompt`,`S1`],e[`guardrails-prompt-s1`]),e[`guardrails-prompt-s10`]!==void 0&&p(g,[`guardrails`,`prompt`,`S10`],e[`guardrails-prompt-s10`]),e[`guardrails-prompt-s11`]!==void 0&&p(g,[`guardrails`,`prompt`,`S11`],e[`guardrails-prompt-s11`]),e[`guardrails-prompt-s12`]!==void 0&&p(g,[`guardrails`,`prompt`,`S12`],e[`guardrails-prompt-s12`]),e[`guardrails-prompt-s13`]!==void 0&&p(g,[`guardrails`,`prompt`,`S13`],e[`guardrails-prompt-s13`]),e[`guardrails-prompt-s2`]!==void 0&&p(g,[`guardrails`,`prompt`,`S2`],e[`guardrails-prompt-s2`]),e[`guardrails-prompt-s3`]!==void 0&&p(g,[`guardrails`,`prompt`,`S3`],e[`guardrails-prompt-s3`]),e[`guardrails-prompt-s4`]!==void 0&&p(g,[`guardrails`,`prompt`,`S4`],e[`guardrails-prompt-s4`]),e[`guardrails-prompt-s5`]!==void 0&&p(g,[`guardrails`,`prompt`,`S5`],e[`guardrails-prompt-s5`]),e[`guardrails-prompt-s6`]!==void 0&&p(g,[`guardrails`,`prompt`,`S6`],e[`guardrails-prompt-s6`]),e[`guardrails-prompt-s7`]!==void 0&&p(g,[`guardrails`,`prompt`,`S7`],e[`guardrails-prompt-s7`]),e[`guardrails-prompt-s8`]!==void 0&&p(g,[`guardrails`,`prompt`,`S8`],e[`guardrails-prompt-s8`]),e[`guardrails-prompt-s9`]!==void 0&&p(g,[`guardrails`,`prompt`,`S9`],e[`guardrails-prompt-s9`]),e[`guardrails-response-p1`]!==void 0&&p(g,[`guardrails`,`response`,`P1`],e[`guardrails-response-p1`]),e[`guardrails-response-s1`]!==void 0&&p(g,[`guardrails`,`response`,`S1`],e[`guardrails-response-s1`]),e[`guardrails-response-s10`]!==void 0&&p(g,[`guardrails`,`response`,`S10`],e[`guardrails-response-s10`]),e[`guardrails-response-s11`]!==void 0&&p(g,[`guardrails`,`response`,`S11`],e[`guardrails-response-s11`]),e[`guardrails-response-s12`]!==void 0&&p(g,[`guardrails`,`response`,`S12`],e[`guardrails-response-s12`]),e[`guardrails-response-s13`]!==void 0&&p(g,[`guardrails`,`response`,`S13`],e[`guardrails-response-s13`]),e[`guardrails-response-s2`]!==void 0&&p(g,[`guardrails`,`response`,`S2`],e[`guardrails-response-s2`]),e[`guardrails-response-s3`]!==void 0&&p(g,[`guardrails`,`response`,`S3`],e[`guardrails-response-s3`]),e[`guardrails-response-s4`]!==void 0&&p(g,[`guardrails`,`response`,`S4`],e[`guardrails-response-s4`]),e[`guardrails-response-s5`]!==void 0&&p(g,[`guardrails`,`response`,`S5`],e[`guardrails-response-s5`]),e[`guardrails-response-s6`]!==void 0&&p(g,[`guardrails`,`response`,`S6`],e[`guardrails-response-s6`]),e[`guardrails-response-s7`]!==void 0&&p(g,[`guardrails`,`response`,`S7`],e[`guardrails-response-s7`]),e[`guardrails-response-s8`]!==void 0&&p(g,[`guardrails`,`response`,`S8`],e[`guardrails-response-s8`]),e[`guardrails-response-s9`]!==void 0&&p(g,[`guardrails`,`response`,`S9`],e[`guardrails-response-s9`]),e[`log-classification`]!==void 0&&p(g,[`log_classification`],e[`log-classification`]),e[`log-management`]!==void 0&&p(g,[`log_management`],e[`log-management`]),e[`log-management-strategy`]!==void 0&&p(g,[`log_management_strategy`],e[`log-management-strategy`]),e.logpush!==void 0&&p(g,[`logpush`],e.logpush),e[`logpush-public-key`]!==void 0&&p(g,[`logpush_public_key`],h(e[`logpush-public-key`],`logpush-public-key`,`text`)),e.otel!==void 0&&p(g,[`otel`],u(e.otel,`otel`)),e[`rate-limiting-interval`]!==void 0&&p(g,[`rate_limiting_interval`],e[`rate-limiting-interval`]),e[`rate-limiting-limit`]!==void 0&&p(g,[`rate_limiting_limit`],e[`rate-limiting-limit`]),e[`rate-limiting-technique`]!==void 0&&p(g,[`rate_limiting_technique`],e[`rate-limiting-technique`]),e[`retry-backoff`]!==void 0&&p(g,[`retry_backoff`],e[`retry-backoff`]),e[`retry-delay`]!==void 0&&p(g,[`retry_delay`],e[`retry-delay`]),e[`retry-max-attempts`]!==void 0&&p(g,[`retry_max_attempts`],e[`retry-max-attempts`]),e[`spend-limits-enabled`]!==void 0&&p(g,[`spend_limits`,`enabled`],e[`spend-limits-enabled`]),e[`spend-limits-rules`]!==void 0&&p(g,[`spend_limits`,`rules`],u(e[`spend-limits-rules`],`spend-limits-rules`)),e[`store-id`]!==void 0&&p(g,[`store_id`],h(e[`store-id`],`store-id`,`text`)),e[`stripe-authorization`]!==void 0&&p(g,[`stripe`,`authorization`],h(e[`stripe-authorization`],`stripe-authorization`,`text`)),e[`stripe-usage-events`]!==void 0&&p(g,[`stripe`,`usage_events`],u(e[`stripe-usage-events`],`stripe-usage-events`)),e[`workers-ai-billing-mode`]!==void 0&&p(g,[`workers_ai_billing_mode`],e[`workers-ai-billing-mode`]),e.zdr!==void 0&&p(g,[`zdr`],e.zdr);let _=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${f}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:g}));o(_,{successLabel:`Updated`})})},it={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(Me).command(Pe).command(Re).command(Ie).command(Ve).command(rt).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var at={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:[`order_by`,`order_by_direction`,`filters`,`limit`],errors:{400:`BadRequestError`}};function ot(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
|
|
63
63
|
|
|
64
|
-
Deletes gateway log entries matching the specified criteria.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`,`cost`,`tokens_in`,`tokens_out`,`duration`,`feedback`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`limit`,{type:`number`,description:`Limit`}).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 st={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:ot,handler:async e=>l({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,limit:e.limit};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await _({force:!!e.force,message:`This permanently deletes every stored log entry on the gateway that matches the filters. Deleted logs cannot be recovered.`}))return;let d=await c(`Deleting`,async()=>l.send(at,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Deleted`})})};var ct={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/request`,errors:{404:`NotFoundError`}};function lt(e){return e.usage(`$0 ai-gateway logs get-request <id>
|
|
64
|
+
Deletes gateway log entries matching the specified criteria.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`,`cost`,`tokens_in`,`tokens_out`,`duration`,`feedback`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,array:!0,description:`Filters`}).option(`limit`,{type:`number`,description:`Limit`}).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 st={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:ot,handler:async e=>l({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,limit:e.limit};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await _({force:!!e.force,message:`This permanently deletes every stored log entry on the gateway that matches the filters. Deleted logs cannot be recovered.`}))return;let d=await c(`Deleting`,async()=>l.send(at,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Deleted`})})};var ct={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/request`,errors:{404:`NotFoundError`}};function lt(e){return e.usage(`$0 ai-gateway logs get-request <id>
|
|
65
65
|
|
|
66
66
|
Retrieves the original request payload for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`get-request <id>`,describe:`Get Gateway Log Request`,builder:lt,handler:async e=>l({command:`ai-gateway logs get-request`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get-request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/request`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ct,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var dt={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/response`,errors:{404:`NotFoundError`}};function ft(e){return e.usage(`$0 ai-gateway logs get-response <id>
|
|
67
67
|
|
|
@@ -69,6 +69,6 @@ Retrieves the response payload for an AI Gateway log entry.`).positional(`id`,{t
|
|
|
69
69
|
|
|
70
70
|
Retrieves detailed information for a specific AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`get <id>`,describe:`Get Gateway Log Detail`,builder:mt,handler:async e=>l({command:`ai-gateway logs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Q,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:/* @__PURE__ */ `search.page.per_page.order_by.order_by_direction.filters.meta_info.direction.start_date.end_date.min_cost.max_cost.min_tokens_in.max_tokens_in.min_tokens_out.max_tokens_out.min_total_tokens.max_total_tokens.min_duration.max_duration.feedback.success.cached.model.model_type.provider.request_content_type.response_content_type`.split(`.`),errors:{400:`BadRequestError`}};function _t(e){return e.usage(`$0 ai-gateway logs list
|
|
71
71
|
|
|
72
|
-
Lists request/response log entries for the AI gateway with filtering and pagination.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`search`,{type:`string`,description:`Free-text search over log metadata.`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`meta-info`,{type:`boolean`,description:`Meta info`}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`start-date`,{type:`string`,description:`Start date`}).option(`end-date`,{type:`string`,description:`End date`}).option(`min-cost`,{type:`number`,description:`Min cost`}).option(`max-cost`,{type:`number`,description:`Max cost`}).option(`min-tokens-in`,{type:`number`,description:`Min tokens in`}).option(`max-tokens-in`,{type:`number`,description:`Max tokens in`}).option(`min-tokens-out`,{type:`number`,description:`Min tokens out`}).option(`max-tokens-out`,{type:`number`,description:`Max tokens out`}).option(`min-total-tokens`,{type:`number`,description:`Min total tokens`}).option(`max-total-tokens`,{type:`number`,description:`Max total tokens`}).option(`min-duration`,{type:`number`,description:`Min duration`}).option(`max-duration`,{type:`number`,description:`Max duration`}).option(`feedback`,{type:`string`,description:`Feedback`,choices:[`-1`,`0`,`1`]}).option(`success`,{type:`boolean`,description:`Success`}).option(`cached`,{type:`boolean`,description:`Cached`}).option(`model`,{type:`string`,description:`Model filter.`}).option(`model-type`,{type:`string`,description:`Model type`}).option(`ai-gateway-provider`,{type:`string`,description:`Provider`}).option(`request-content-type`,{type:`string`,description:`Request content type`}).option(`response-content-type`,{type:`string`,description:`Response content type`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`list`,describe:`List Gateway Logs`,builder:_t,handler:async e=>l({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},e,async()=>{let n={search:e.search,page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,meta_info:e[`meta-info`],direction:e.direction,start_date:e[`start-date`],end_date:e[`end-date`],min_cost:e[`min-cost`],max_cost:e[`max-cost`],min_tokens_in:e[`min-tokens-in`],max_tokens_in:e[`max-tokens-in`],min_tokens_out:e[`min-tokens-out`],max_tokens_out:e[`max-tokens-out`],min_total_tokens:e[`min-total-tokens`],max_total_tokens:e[`max-total-tokens`],min_duration:e[`min-duration`],max_duration:e[`max-duration`],feedback:e.feedback,success:e.success,cached:e.cached,model:e.model,model_type:e[`model-type`],provider:e[`ai-gateway-provider`],request_content_type:e[`request-content-type`],response_content_type:e[`response-content-type`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(gt,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,body:`json`,errors:{404:`NotFoundError`}};function yt(e){return e.usage(`$0 ai-gateway logs update <id>
|
|
72
|
+
Lists request/response log entries for the AI gateway with filtering and pagination.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`search`,{type:`string`,description:`Free-text search over log metadata.`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,array:!0,description:`Filters`}).option(`meta-info`,{type:`boolean`,description:`Meta info`}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`start-date`,{type:`string`,description:`Start date`}).option(`end-date`,{type:`string`,description:`End date`}).option(`min-cost`,{type:`number`,description:`Min cost`}).option(`max-cost`,{type:`number`,description:`Max cost`}).option(`min-tokens-in`,{type:`number`,description:`Min tokens in`}).option(`max-tokens-in`,{type:`number`,description:`Max tokens in`}).option(`min-tokens-out`,{type:`number`,description:`Min tokens out`}).option(`max-tokens-out`,{type:`number`,description:`Max tokens out`}).option(`min-total-tokens`,{type:`number`,description:`Min total tokens`}).option(`max-total-tokens`,{type:`number`,description:`Max total tokens`}).option(`min-duration`,{type:`number`,description:`Min duration`}).option(`max-duration`,{type:`number`,description:`Max duration`}).option(`feedback`,{type:`string`,description:`Feedback`,choices:[`-1`,`0`,`1`]}).option(`success`,{type:`boolean`,description:`Success`}).option(`cached`,{type:`boolean`,description:`Cached`}).option(`model`,{type:`string`,description:`Model filter.`}).option(`model-type`,{type:`string`,description:`Model type`}).option(`ai-gateway-provider`,{type:`string`,description:`Provider`}).option(`request-content-type`,{type:`string`,description:`Request content type`}).option(`response-content-type`,{type:`string`,description:`Response content type`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`list`,describe:`List Gateway Logs`,builder:_t,handler:async e=>l({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},e,async()=>{let n={search:e.search,page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,meta_info:e[`meta-info`],direction:e.direction,start_date:e[`start-date`],end_date:e[`end-date`],min_cost:e[`min-cost`],max_cost:e[`max-cost`],min_tokens_in:e[`min-tokens-in`],max_tokens_in:e[`max-tokens-in`],min_tokens_out:e[`min-tokens-out`],max_tokens_out:e[`max-tokens-out`],min_total_tokens:e[`min-total-tokens`],max_total_tokens:e[`max-total-tokens`],min_duration:e[`min-duration`],max_duration:e[`max-duration`],feedback:e.feedback,success:e.success,cached:e.cached,model:e.model,model_type:e[`model-type`],provider:e[`ai-gateway-provider`],request_content_type:e[`request-content-type`],response_content_type:e[`response-content-type`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(gt,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,body:`json`,errors:{404:`NotFoundError`}};function yt(e){return e.usage(`$0 ai-gateway logs update <id>
|
|
73
73
|
|
|
74
74
|
Updates metadata for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`feedback`,{type:`number`,description:`The feedback field`}).option(`metadata`,{type:`string`,description:`The metadata field. Provide as a JSON object or @path/to/file.json.`}).option(`score`,{type:`number`,description:`The score 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 bt={command:`update <id>`,describe:`Patch Gateway Log`,builder:yt,handler:async e=>l({command:`ai-gateway logs update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({feedback:e.feedback,metadata:f(e.metadata,`metadata`),score:e.score},[[`metadata`]]):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send($,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}let u=m({feedback:e.feedback,metadata:f(e.metadata,`metadata`),score:e.score},[[`metadata`]]),p=await c(`Updating`,async()=>n.send($,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(p,{successLabel:`Updated`})})},xt={command:`logs`,describe:`Inspect, annotate, and delete gateway request logs stored by Legacy Logs`,builder:e=>e.command(st).command(ht).command(ut).command(pt).command(vt).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},St={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(se).command(R).command(Ae).command(it).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{St as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{i as n,n as r}from"./auth-CB9wjyad.mjs";import{a as i,t as a}from"./context-DCon1tRZ.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-_Jux05O5.mjs";import{t as l}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as u,n as d,r as f,s as p,t as m}from"./body-parser-BKcZS9iJ.mjs";import{n as h,t as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-SNVLBS1b.mjs";import{n as ee,t as te}from"./raw-fetch-D3ydyJYW.mjs";function ne(e){return e.usage(`$0 ai-search chat-completions <instance-id>
|
|
3
3
|
|
|
4
4
|
Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>h(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>h(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>h(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. When omitted, falls back to the instance-level score_threshold, then to 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of results to return. When omitted, falls back to the instance-level max_num_results, then to 10.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>h(e,`ai-search-options-retrieval-retrieval-type`,`text`)).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`chat-completions <instance-id>`,describe:`Chat Completions`,builder:ne,handler:async e=>l({command:`ai-search chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_search_options:{cache:{cache_threshold:e[`ai-search-options-cache-cache-threshold`],enabled:e[`ai-search-options-cache-enabled`]},custom_metadata:f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),query_rewrite:{enabled:e[`ai-search-options-query-rewrite-enabled`],model:h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:e[`ai-search-options-reranking-enabled`],match_threshold:e[`ai-search-options-reranking-match-threshold`],model:h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:e[`ai-search-options-retrieval-context-expansion`],filters:f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:e[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:e[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:e[`ai-search-options-retrieval-match-threshold`],max_num_results:e[`ai-search-options-retrieval-max-num-results`],retrieval_type:e[`ai-search-options-retrieval-retrieval-type`],return_on_failure:e[`ai-search-options-retrieval-return-on-failure`]}},messages:u(e.messages,`messages`),model:h(e.model,`model`,`text`),stream:e.stream},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,{body:t}));o(r,{successLabel:`Created`});return}if(e.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let _={};e[`ai-search-options-cache-cache-threshold`]!==void 0&&p(_,[`ai_search_options`,`cache`,`cache_threshold`],e[`ai-search-options-cache-cache-threshold`]),e[`ai-search-options-cache-enabled`]!==void 0&&p(_,[`ai_search_options`,`cache`,`enabled`],e[`ai-search-options-cache-enabled`]),e[`ai-search-options-custom-metadata`]!==void 0&&p(_,[`ai_search_options`,`custom_metadata`],f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),e[`ai-search-options-query-rewrite-enabled`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`enabled`],e[`ai-search-options-query-rewrite-enabled`]),e[`ai-search-options-query-rewrite-model`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`model`],h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),e[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),e[`ai-search-options-reranking-enabled`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`enabled`],e[`ai-search-options-reranking-enabled`]),e[`ai-search-options-reranking-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`match_threshold`],e[`ai-search-options-reranking-match-threshold`]),e[`ai-search-options-reranking-model`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`model`],h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),e[`ai-search-options-retrieval-boost-by`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`boost_by`],u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),e[`ai-search-options-retrieval-context-expansion`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`context_expansion`],e[`ai-search-options-retrieval-context-expansion`]),e[`ai-search-options-retrieval-filters`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`filters`],f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),e[`ai-search-options-retrieval-fusion-method`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`fusion_method`],e[`ai-search-options-retrieval-fusion-method`]),e[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`keyword_match_mode`],e[`ai-search-options-retrieval-keyword-match-mode`]),e[`ai-search-options-retrieval-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`match_threshold`],e[`ai-search-options-retrieval-match-threshold`]),e[`ai-search-options-retrieval-max-num-results`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`max_num_results`],e[`ai-search-options-retrieval-max-num-results`]),e[`ai-search-options-retrieval-retrieval-type`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`retrieval_type`],e[`ai-search-options-retrieval-retrieval-type`]),e[`ai-search-options-retrieval-return-on-failure`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`return_on_failure`],e[`ai-search-options-retrieval-return-on-failure`]),e.messages!==void 0&&p(_,[`messages`],u(e.messages,`messages`)),e.model!==void 0&&p(_,[`model`],h(e.model,`model`,`text`)),e.stream!==void 0&&p(_,[`stream`],e.stream);let v=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,{body:_}));o(v,{successLabel:`Created`})})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-search/namespaces/${t.namespace}/instances`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`,503:`ServiceUnavailableError`}};function x(e){return e.usage(`$0 ai-search create <namespace> <id>
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-CB9wjyad.mjs";import{i as n}from"./context-DCon1tRZ.mjs";import{t as r}from"./output-BJEgbI0G.mjs";import{t as i}from"./dry-run-gy0Hl9xo.mjs";import{t as a}from"./progress-_Jux05O5.mjs";import{t as o}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as s,n as c,t as l}from"./body-parser-BKcZS9iJ.mjs";import{n as u}from"./prompt-SNVLBS1b.mjs";var d={method:`GET`,path:t=>e`/zones/${t.zone_id}/ai-security/custom-topics`};function f(e){return e.usage(`$0 ai-security custom-topics get
|
|
3
3
|
|
|
4
|
-
Get the custom topic categories defined for the zone. While AI Security for Apps is enabled, it scores every incoming prompt against these topics and writes the scores to the \`cf.llm.prompt.custom_topic_categories\` field, keyed by topic label. Topics can be configured while the detection is disabled, but no prompt is scored until you enable it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Get the AI Security for Apps custom topics of a zone.`,builder:f,handler:async e=>o({command:`ai-security custom-topics get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ai-security custom-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-security/custom-topics`,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 c=await a(`Loading`,async()=>o.send(d,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var m={method:`PUT`,path:t=>e`/zones/${t.zone_id}/ai-security/custom-topics`,body:`json`};function h(e){return e.usage("$0 ai-security custom-topics update\n\nUpdate the custom topic list of the zone, overwriting it entirely with the topics in the request, so include every topic you want to keep. Changes can take up to a minute to propagate. Each entry has a `label`, used to reference the topic in rule expressions and analytics, and a `topic` description, which the classifier scores prompts against while AI Security for Apps is enabled. The following rules apply: - A zone can hold at most 20 topics. - `label` must be 2–20 characters, using only lowercase letters (a–z), digits (0–9), and hyphens. - `topic` must be 2–50
|
|
4
|
+
Get the custom topic categories defined for the zone. While AI Security for Apps is enabled, it scores every incoming prompt against these topics and writes the scores to the \`cf.llm.prompt.custom_topic_categories\` field, keyed by topic label. Topics can be configured while the detection is disabled, but no prompt is scored until you enable it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Get the AI Security for Apps custom topics of a zone.`,builder:f,handler:async e=>o({command:`ai-security custom-topics get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ai-security custom-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-security/custom-topics`,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 c=await a(`Loading`,async()=>o.send(d,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var m={method:`PUT`,path:t=>e`/zones/${t.zone_id}/ai-security/custom-topics`,body:`json`};function h(e){return e.usage("$0 ai-security custom-topics update\n\nUpdate the custom topic list of the zone, overwriting it entirely with the topics in the request, so include every topic you want to keep. Changes can take up to a minute to propagate. Each entry has a `label`, used to reference the topic in rule expressions and analytics, and a `topic` description, which the classifier scores prompts against while AI Security for Apps is enabled. The following rules apply: - A zone can hold at most 20 topics. - `label` must be 2–20 characters, using only lowercase letters (a–z), digits (0–9), and hyphens. - `topic` must be 2–50 UTF-8 bytes. Text in any language is supported, including spaces, numbers, punctuation, and symbols. Tabs, line breaks, invalid text, and invisible formatting characters are not allowed. - Labels must be unique within the zone, and so must topic descriptions.").option(`topics`,{type:`string`,description:`Custom topic categories for AI Security for Apps content detection. Provide as a JSON array of objects or @path/to/file.json.`}).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:`update`,describe:`Update the AI Security for Apps custom topics of a zone.`,builder:h,handler:async e=>o({command:`ai-security custom-topics update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf ai-security custom-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-security/custom-topics`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({topics:s(e.topics,`topics`)}):c(e.body)});return}let o=await t(e),d=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=d,!await u({force:!!e.force,message:`This operation overwrites the AI Security for Apps custom topics for a zone.`}))return;if(e.body){let t=c(e.body),n=await a(`Deleting`,async()=>o.send(m,{body:t,zone_id:d}));r(n,{successLabel:`Deleted`});return}let f=l({topics:s(e.topics,`topics`)}),p=await a(`Deleting`,async()=>o.send(m,{body:f,zone_id:d}));r(p,{successLabel:`Deleted`})})},_={command:`custom-topics`,describe:`Organization-specific topic categories used by AI Security for Apps content detection`,builder:e=>e.command(p).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`GET`,path:t=>e`/zones/${t.zone_id}/ai-security/settings`};function y(e){return e.usage(`$0 ai-security get
|
|
5
5
|
|
|
6
6
|
Get the current AI Security for Apps status for the zone. While enabled, Cloudflare scans prompts sent to endpoints labeled \`cf-llm\` for personally identifiable information, unsafe topics, and prompt injection attempts.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Get the AI Security for Apps status for a zone.`,builder:y,handler:async e=>o({command:`ai-security get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ai-security get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-security/settings`,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 c=await a(`Loading`,async()=>o.send(v,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var x={method:`PUT`,path:t=>e`/zones/${t.zone_id}/ai-security/settings`,body:`json`};function S(e){return e.usage(`$0 ai-security update
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{n}from"./auth-CB9wjyad.mjs";import{a as r,t as i}from"./context-DCon1tRZ.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-_Jux05O5.mjs";import{t as c}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-SNVLBS1b.mjs";import{n as g,t as _}from"./raw-fetch-D3ydyJYW.mjs";var v={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/available_alerts`};function y(e){return e.usage(`$0 alerting available-alerts list
|
|
3
3
|
|
|
4
4
|
Gets a list of all alert types for which an account is eligible.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`list`,describe:`Get Alert Types`,builder:y,handler:async e=>c({command:`alerting available-alerts list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting available-alerts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/available_alerts`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(v,{account_id:l}));a(u,{successLabel:`Loaded`})})},te={command:`available-alerts`,describe:`Operations for available-alerts`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ne={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/eligible`};function re(e){return e.usage(`$0 alerting destinations eligible get
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{n}from"./auth-CB9wjyad.mjs";import{a as r,i,t as a}from"./context-DCon1tRZ.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-_Jux05O5.mjs";import{t as l}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as u,n as d,t as f}from"./body-parser-BKcZS9iJ.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m}from"./prompt-SNVLBS1b.mjs";var h={method:`GET`,path:t=>e`/zones/${t.zone_id}/analytics/latency/colos`};function g(e){return e.usage(`$0 analytics latency colos get
|
|
3
3
|
|
|
4
4
|
Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Argo Analytics for a zone at different PoPs`,builder:g,handler:async e=>l({command:`analytics latency colos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(h,{zone_id:r}));o(a,{successLabel:`Loaded`})})},v={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`GET`,path:t=>e`/zones/${t.zone_id}/analytics/latency`,query:[`bins`]};function b(e){return e.usage(`$0 analytics latency get
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{i as n,n as r}from"./auth-CB9wjyad.mjs";import{a as i,t as a}from"./context-DCon1tRZ.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-_Jux05O5.mjs";import{t as l}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";var f={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics_engine/sql`,errors:{400:`BadRequestError`,403:`ForbiddenError`,422:`UnprocessableEntityError`,429:`TooManyRequestsError`,500:`InternalServerError`,503:`ServiceUnavailableError`,504:`GatewayTimeoutError`}};function p(e){return e.usage(`$0 analytics-engine sql query
|
|
3
3
|
|
|
4
4
|
Executes a SQL query against Workers Analytics Engine data. Pass the SQL query in the request body as plain text. The response uses newline-delimited JSON (NDJSON) by default, or a single JSON object when the query includes a FORMAT JSON clause. Prefer this method for longer queries that may exceed URL length limits.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const m={command:`query`,describe:`Execute an Analytics Engine SQL query via request body`,builder:p,handler:async e=>l({command:`analytics-engine sql query`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf analytics-engine sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics_engine/sql`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),p=e.local?t:await a();if(e.accountId=p,e.file){let t=d(e.file),r=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${p}/analytics_engine/sql`,{body:t,headers:{"Content-Type":`text/plain`}}));o(r,{successLabel:`Loaded`});return}if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${p}/analytics_engine/sql`,{body:t,headers:{"Content-Type":`text/plain`}}));o(r,{successLabel:`Loaded`});return}let m=await c(`Loading`,async()=>l.send(f,{account_id:p}));o(m,{successLabel:`Loaded`})})},h={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`analytics-engine`,describe:`analytics-engine`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{i as n,n as r}from"./auth-CB9wjyad.mjs";import{a as i,i as a,t as o}from"./context-DCon1tRZ.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-_Jux05O5.mjs";import{t as u}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{a as d,n as f,t as p}from"./body-parser-BKcZS9iJ.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-SNVLBS1b.mjs";var v={method:`POST`,path:t=>e`/zones/${t.zone_id}/schema_validation/schemas`,body:`json`,constants:{kind:`openapi_v3`}};function ee(e){return e.usage(`$0 api-security schema-validation schemas create
|
|
3
3
|
|
|
4
4
|
Uploads an OpenAPI schema that defines expected request formats for API operations.`).option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).coerce(`kind`,e=>m(e,`kind`,`text`)).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Upload a schema`,builder:ee,handler:async e=>u({command:`api-security schema-validation schemas create`,classification:{safeFlags:[`kind`,`validation-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf api-security schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({kind:e.kind,name:m(e.name,`name`,`text`),source:m(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]}):f(e.body)});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=f(e.body),i=await l(`Creating`,async()=>t.send(v,{body:r,zone_id:n}));s(i,{successLabel:`Created`});return}if(e.kind===void 0&&(e.kind=await g(`kind`,`The kind of the schema`,[`openapi_v3`])),e.name===void 0&&(e.name=await h(`name`,`A human-readable name for the schema`)),e.source===void 0&&(e.source=await h(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),e[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let i=p({kind:e.kind,name:m(e.name,`name`,`text`),source:m(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]}),o=await l(`Creating`,async()=>t.send(v,{body:i,zone_id:n}));s(o,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/schema_validation/schemas/${t.schema_id}`};function ne(e){return e.usage(`$0 api-security schema-validation schemas delete <schema-id>
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ Lists all unique hosts found in uploaded OpenAPI schemas for the zone.`).option(
|
|
|
11
11
|
|
|
12
12
|
Lists all OpenAPI schemas uploaded to API Security.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`}).option(`validation-enabled`,{type:`boolean`,description:`Filter for enabled schemas`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List all uploaded schemas`,builder:fe,handler:async e=>u({command:`api-security schema-validation schemas list`,classification:{safeFlags:[`omit-source`,`validation-enabled`,`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`],omit_source:e[`omit-source`],validation_enabled:e[`validation-enabled`]};if(e.dryRun){c({command:`cf api-security schema-validation schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(de,{zone_id:i,...t}));s(o,{successLabel:`Loaded`})})};var me={method:`GET`,path:t=>e`/zones/${t.zone_id}/schema_validation/schemas/${t.schema_id}/operations`,query:[`feature`,`host`,`method`,`endpoint`,`page`,`per_page`,`operation_status`]};function he(e){return e.usage(`$0 api-security schema-validation schemas operations list
|
|
13
13
|
|
|
14
|
-
Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.`).option(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`operation-status`,{type:`string`,description:"Filter results by whether operations exist in Web Asset Management or not. `new` will just return operations from the schema that do not exist otherwise. `existing` will just return operations from the schema that already exist.",choices:[`new`,`existing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Retrieve all operations from the schema`,builder:he,handler:async e=>u({command:`api-security schema-validation schemas operations list`,classification:{safeFlags:[`operation-status`,`dry-run`]}},e,async()=>{let t={feature:e.feature,host:e.host,method:e.method,endpoint:e.endpoint,page:e.page,per_page:e[`per-page`],operation_status:e[`operation-status`]};if(e.dryRun){c({command:`cf api-security schema-validation schemas operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(me,{zone_id:i,schema_id:e[`schema-id`],...t}));s(o,{successLabel:`Loaded`})})},_e={command:`operations`,describe:`Operations for schema-validation.schemas.operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/schema_validation/schemas/${t.schema_id}`,body:`json`};function ve(e){return e.usage(`$0 api-security schema-validation schemas set-validation <schema-id>
|
|
14
|
+
Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.`).option(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`feature`,{type:`string`,array:!0,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`host`,{type:`string`,array:!0,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,array:!0,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`operation-status`,{type:`string`,description:"Filter results by whether operations exist in Web Asset Management or not. `new` will just return operations from the schema that do not exist otherwise. `existing` will just return operations from the schema that already exist.",choices:[`new`,`existing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Retrieve all operations from the schema`,builder:he,handler:async e=>u({command:`api-security schema-validation schemas operations list`,classification:{safeFlags:[`operation-status`,`dry-run`]}},e,async()=>{let t={feature:e.feature,host:e.host,method:e.method,endpoint:e.endpoint,page:e.page,per_page:e[`per-page`],operation_status:e[`operation-status`]};if(e.dryRun){c({command:`cf api-security schema-validation schemas operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(me,{zone_id:i,schema_id:e[`schema-id`],...t}));s(o,{successLabel:`Loaded`})})},_e={command:`operations`,describe:`Operations for schema-validation.schemas.operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/schema_validation/schemas/${t.schema_id}`,body:`json`};function ve(e){return e.usage(`$0 api-security schema-validation schemas set-validation <schema-id>
|
|
15
15
|
|
|
16
16
|
Enables or disables validation for an uploaded OpenAPI schema without changing the schema document.`).positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`validation-enabled`,{type:`boolean`,description:`Flag whether schema is enabled for validation.`}).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 ye={command:`set-validation <schema-id>`,describe:`Set schema validation state`,builder:ve,handler:async e=>u({command:`api-security schema-validation schemas set-validation`,classification:{safeFlags:[`validation-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf api-security schema-validation schemas set-validation`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({validation_enabled:e[`validation-enabled`]}):f(e.body)});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=f(e.body),i=await l(`Updating`,async()=>t.send(b,{body:r,zone_id:n,schema_id:e[`schema-id`]}));s(i,{successLabel:`Updated`});return}let i=p({validation_enabled:e[`validation-enabled`]}),o=await l(`Updating`,async()=>t.send(b,{body:i,zone_id:n,schema_id:e[`schema-id`]}));s(o,{successLabel:`Updated`})})},be={command:`schemas`,describe:`Operations for schema-validation.schemas`,builder:e=>e.command(y).command(re).command(oe).command(pe).command(ye).command(ue).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/schema_validation/settings`,body:`json`};function S(e){return e.usage(`$0 api-security schema-validation settings edit
|
|
17
17
|
|
|
@@ -87,7 +87,7 @@ For details on expressions, see the [Cloudflare Docs](https://developers.cloudfl
|
|
|
87
87
|
|
|
88
88
|
Returns a token validation rule by ID.`).positional(`rule-id`,{type:`string`,description:`Token Validation Rule ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yt={command:`get <rule-id>`,describe:`Get a token validation rule`,builder:vt,handler:async e=>u({command:`api-security token-validation rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf api-security token-validation rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/token_validation/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n;let i=await l(`Loading`,async()=>t.send(_t,{zone_id:n,rule_id:e[`rule-id`]}));s(i,{successLabel:`Loaded`})})};var bt={method:`GET`,path:t=>e`/zones/${t.zone_id}/token_validation/rules`,query:[`per_page`,`page`,`token_configuration`,`action`,`enabled`,`id`,`rule_id`,`host`,`hostname`]};function xt(e){return e.usage(`$0 api-security token-validation rules list
|
|
89
89
|
|
|
90
|
-
Lists token validation rules for the zone, with filters for configuration, action, state, ID, and host.`).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`token-configuration`,{type:`string`,description:`Select rules using any of these token configurations.`}).option(`action`,{type:`string`,description:"Action to take on requests that match operations included in `selector` and fail `expression`.",choices:[`log`,`block`]}).option(`enabled`,{type:`boolean`,description:`Toggle rule on or off.`}).option(`id`,{type:`string`,description:`Select rules with these IDs.`}).option(`rule-id`,{type:`string`,description:`Select rules with these IDs.`}).option(`host`,{type:`string`,description:"Select rules with this host in `include`."}).option(`hostname`,{type:`string`,description:"Select rules with this host in `include`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`list`,describe:`List token validation rules`,builder:xt,handler:async e=>u({command:`api-security token-validation rules list`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,token_configuration:e[`token-configuration`],action:e.action,enabled:e.enabled,id:e.id,rule_id:e[`rule-id`],host:e.host,hostname:e.hostname};if(e.dryRun){c({command:`cf api-security token-validation rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/token_validation/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(bt,{zone_id:i,...t}));s(o,{successLabel:`Loaded`})})},Ct={command:`rules`,describe:`Operations for token-validation.rules`,builder:e=>e.command(ot).command(lt).command(dt).command(mt).command(gt).command(yt).command(St).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},wt={command:`token-validation`,describe:`Operations for token-validation`,builder:e=>e.command(rt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`POST`,path:t=>e`/accounts/${t.account_id}/vuln_scanner/credential_sets`,body:`json`};function Tt(e){return e.usage(`$0 api-security vulnerability-scanner credential-sets create
|
|
90
|
+
Lists token validation rules for the zone, with filters for configuration, action, state, ID, and host.`).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`token-configuration`,{type:`string`,array:!0,description:`Select rules using any of these token configurations.`}).option(`action`,{type:`string`,description:"Action to take on requests that match operations included in `selector` and fail `expression`.",choices:[`log`,`block`]}).option(`enabled`,{type:`boolean`,description:`Toggle rule on or off.`}).option(`id`,{type:`string`,description:`Select rules with these IDs.`}).option(`rule-id`,{type:`string`,description:`Select rules with these IDs.`}).option(`host`,{type:`string`,description:"Select rules with this host in `include`."}).option(`hostname`,{type:`string`,description:"Select rules with this host in `include`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`list`,describe:`List token validation rules`,builder:xt,handler:async e=>u({command:`api-security token-validation rules list`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,token_configuration:e[`token-configuration`],action:e.action,enabled:e.enabled,id:e.id,rule_id:e[`rule-id`],host:e.host,hostname:e.hostname};if(e.dryRun){c({command:`cf api-security token-validation rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/token_validation/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(bt,{zone_id:i,...t}));s(o,{successLabel:`Loaded`})})},Ct={command:`rules`,describe:`Operations for token-validation.rules`,builder:e=>e.command(ot).command(lt).command(dt).command(mt).command(gt).command(yt).command(St).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},wt={command:`token-validation`,describe:`Operations for token-validation`,builder:e=>e.command(rt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`POST`,path:t=>e`/accounts/${t.account_id}/vuln_scanner/credential_sets`,body:`json`};function Tt(e){return e.usage(`$0 api-security vulnerability-scanner credential-sets create
|
|
91
91
|
|
|
92
92
|
Creates a new credential set.`).option(`name`,{type:`string`,description:`Human-readable name.`}).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 Et={command:`create`,describe:`Create credential set`,builder:Tt,handler:async e=>u({command:`api-security vulnerability-scanner credential-sets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf api-security vulnerability-scanner credential-sets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/vuln_scanner/credential_sets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(U,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Human-readable name.`));let u=p({name:m(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(U,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/vuln_scanner/credential_sets/${t.credential_set_id}/credentials`,body:`json`};function Dt(e){return e.usage(`$0 api-security vulnerability-scanner credential-sets credentials create <credential-set-id>
|
|
93
93
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{n}from"./auth-CB9wjyad.mjs";import{a as r,i,t as a}from"./context-DCon1tRZ.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-_Jux05O5.mjs";import{t as l}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{i as p}from"./prompt-SNVLBS1b.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/argo/count_zones_enabled`};function h(e){return e.usage(`$0 argo smart-routing count-zones-enabled-for-account
|
|
3
3
|
|
|
4
4
|
Returns the number of zones that have Argo Smart Routing enabled for the specified account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`count-zones-enabled-for-account`,describe:`Get count of zones with Argo Smart Routing enabled for account`,builder:h,handler:async e=>l({command:`argo smart-routing count-zones-enabled-for-account`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf argo smart-routing count-zones-enabled-for-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/argo/count_zones_enabled`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(m,{account_id:l}));o(u,{successLabel:`Loaded`})})};var _={method:`GET`,path:()=>`/user/argo/count_zones_enabled`};function v(e){return e.usage(`$0 argo smart-routing count-zones-enabled-for-user
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{n}from"./auth-CB9wjyad.mjs";import{a as r,t as i}from"./context-DCon1tRZ.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-_Jux05O5.mjs";import{t as c}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{n as l,t as u}from"./body-parser-BKcZS9iJ.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-SNVLBS1b.mjs";import{n as m,t as h}from"./raw-fetch-D3ydyJYW.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/artifacts/namespaces`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,409:`ConflictError`,500:`InternalServerError`}};function _(e){return e.usage(`$0 artifacts namespaces create
|
|
3
3
|
|
|
4
4
|
Creates an empty Artifacts namespace for an account.`).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`unrestricted`,`us`,`eu`,`fedramp`],default:`unrestricted`}).coerce(`jurisdiction`,e=>d(e,`jurisdiction`,`text`)).option(`namespace`,{type:`string`,description:`The namespace field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a namespace`,builder:_,handler:async e=>c({command:`artifacts namespaces create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf artifacts namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/artifacts/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({jurisdiction:e.jurisdiction,namespace:d(e.namespace,`namespace`,`text`)}):l(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(g,{body:t,account_id:p}));a(n,{successLabel:`Created`});return}e.namespace===void 0&&(e.namespace=await f(`namespace`,`The namespace field`));let m=u({jurisdiction:e.jurisdiction,namespace:d(e.namespace,`namespace`,`text`)}),h=await s(`Creating`,async()=>c.send(g,{body:m,account_id:p}));a(h,{successLabel:`Created`})})};var ee={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/artifacts/namespaces/${t.namespace}`,response:!1,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function te(e){return e.usage(`$0 artifacts namespaces delete <namespace>
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-BNmz58v4.mjs";import{n}from"./auth-CB9wjyad.mjs";import{a as r,t as i}from"./context-DCon1tRZ.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-_Jux05O5.mjs";import{t as c}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/audit_logs`,query:[`id`,`export`,`action.type`,`actor.ip`,`actor.email`,`since`,`before`,`zone.name`,`direction`,`per_page`,`page`,`hide_user_logs`]};function u(e){return e.usage(`$0 audit-logs list
|
|
3
3
|
|
|
4
4
|
Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.`).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`export`,{type:`boolean`,description:`Indicates that this request is an export of logs in CSV format.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-ip`,{type:`string`,description:`Filters by the IP address of the request that made the change by specific IP address or valid CIDR Range.`}).option(`actor-email`,{type:`string`,description:`Filters by the email address of the actor that made the change.`}).option(`since`,{type:`string`,description:`Since`}).option(`before`,{type:`string`,description:`Before`}).option(`zone-name`,{type:`string`,description:`Filters by the name of the zone associated to the change.`}).option(`direction`,{type:`string`,description:`Changes the direction of the chronological sorting.`,choices:[`desc`,`asc`]}).option(`per-page`,{type:`number`,description:`Sets the number of results to return per page.`}).option(`page`,{type:`number`,description:`Defines which page of results to return.`}).option(`hide-user-logs`,{type:`boolean`,description:`Indicates whether or not to hide user level audit logs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Get account audit logs`,builder:u,handler:async e=>c({command:`audit-logs list`,classification:{safeFlags:[`export`,`direction`,`hide-user-logs`,`dry-run`]}},e,async()=>{let c={id:e.id,export:e.export,"action.type":e[`action-type`],"actor.ip":e[`actor-ip`],"actor.email":e[`actor-email`],since:e.since,before:e.before,"zone.name":e[`zone-name`],direction:e.direction,per_page:e[`per-page`],page:e.page,hide_user_logs:e[`hide-user-logs`]};if(e.dryRun){let e=await r();o({command:`cf audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/audit_logs`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})},f={command:`audit-logs`,describe:`audit-logs`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{K as e}from"./dist-
|
|
2
|
+
import{K as e}from"./dist-ataVE8ob.mjs";import{n as t,t as n}from"./api-X3wKppsT.mjs";import{a as r,n as i}from"./context-DCon1tRZ.mjs";import{l as a}from"./oauth-nDH3nTCa.mjs";import{t as o}from"./auth-token-BAgw7kYP.mjs";import{n as s}from"./request-headers-Cn01EsbI.mjs";const c=6e4;function l(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream}var u={method:`GET`,path:()=>`/accounts`,query:[`name`,`page`,`per_page`,`direction`]},d={method:`GET`,path:()=>`/memberships`,query:[`account.name`,`page`,`per_page`,`order`,`direction`,`name`,`status`]};function f(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function p(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function m(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function h(e,t,n){if(n!=null&&n!==``){if(Array.isArray(n))for(let r of n)h(e,t,r);else e.append(t,String(n))}}function g(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))h(t,n,r);return t.toString()}function _(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=g(n??{});return a&&(i.search=a),i.toString()}const v=/* @__PURE__ */ new WeakMap,y=/* @__PURE__ */ new WeakMap;async function b(e,n,r,i={}){let a=e.baseUrl,o=_(r,a,i.query),s={...i.headers},c;i.body!==void 0&&(f(i.body)||typeof i.body==`string`&&p(s)?c=i.body:(s[`Content-Type`]??=`application/json`,c=JSON.stringify(i.body)));let u=i.timeout===void 0&&l(c)?y.get(e):void 0,d=i.timeout??v.get(e)??6e4,h;try{h=await(u??e).fetch(o,{method:n,headers:s,body:c,signal:i.signal},{timeoutInSeconds:i.timeout===void 0?void 0:i.timeout/1e3,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e===`timeout`||e instanceof Error&&e.name===`AbortError`?Error(u?`Request timed out`:`Request timed out after ${d}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!h.ok)throw new t({statusCode:h.status,body:await m(h),rawResponse:{status:h.status,statusText:h.statusText,url:h.url||o,headers:h.headers,redirected:h.redirected,type:h.type}});if(h.status===204)return null;let g=h.headers.get(`content-type`)??``;if(!g.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await h.arrayBuffer());let b=await h.text();if(b===``)return null;if(!g.includes(`application/json`))return b;let x=JSON.parse(b);if(x.success===!1){let e=x.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`;throw new t({message:`API error: ${e}`,statusCode:h.status,body:x})}return`result`in x?x.result:x}function x(e){let t={baseUrl:e.baseURL??`https://api.cloudflare.com/client/v4`,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??6e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch},r=new n(t);return v.set(r,e.timeout??6e4),e.timeout===void 0&&y.set(r,new n({...t,timeoutInSeconds:void 0})),r}async function S(t){if(a())return;let n=await r();if(n)return n;try{let n=await o(),r=e({compliance_region:await i()}),a=t-Date.now();if(a<=0)return;let c=x({apiToken:n,baseURL:r,defaultHeaders:s()}),l={timeoutInSeconds:a/1e3,maxRetries:0},[f,p]=await Promise.allSettled([c.send(u,{per_page:50},l),c.send(d,{per_page:50},l)]);if(f.status===`rejected`)return;let m=f.value;if((m.result_info?.total_count??m.result.length)>m.result.length)return;let h=m.result;if(p.status===`fulfilled`){let e=p.value.result??[];if((p.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));h=h.filter(e=>t.has(e.id))}return h.length===1?h[0]?.id:void 0}catch{return}}async function C(t){if(t.dryRun&&a())throw Error(`This command's dry run cannot be used with --temporary-account. Remove --dry-run to run the command for real.`);let n=e({compliance_region:await i()});if(t.local){let{createLocalFetch:e}=await import(`./local-ChR3YIMU.mjs`);return x({apiToken:`cf-local-mode-no-auth`,baseURL:n,defaultHeaders:s(),fetch:e({persistTo:t.persistTo,apiBaseUrl:n})})}return x({apiToken:await o(),baseURL:n,defaultHeaders:s()})}export{S as a,l as c,b as i,c as l,C as n,d as o,g as r,u as s,x as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./agent-context-Dtyy4aKL.mjs";import{c as n}from"./chunk-3PJ54H4K-CbRAWQWI.mjs";import{i as r}from"./blocks-D2tE8dp2.mjs";import"./ui-7zujR-O7.mjs";import{t as i}from"./cf-DgLg6Hop.mjs";import{t as a}from"./log-BWdaOGOW.mjs";import{d as o,f as s,i as c,r as l,t as u}from"./oauth-nDH3nTCa.mjs";import{t as d}from"./auth-token-BAgw7kYP.mjs";import{t as f}from"./output-BJEgbI0G.mjs";import{n as p}from"./run-Br8sYjNF.mjs";import"./telemetry-kjElc1zT.mjs";import{n as m,o as h,s as g}from"./schema-cache-Cb64Nqbt.mjs";import{a as _,c as v,i as y,n as b,o as x,r as S,s as C,t as w}from"./login-B9wYab6S.mjs";const T={command:`logout`,describe:`Log out and remove stored credentials`,handler:async t=>{y(t,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let n=l();n!=="default"&&a.warn(`This directory has profile "${n}" active. ${e.code(`cf auth logout`)} removes the default profile's token, not "${n}". To delete "${n}", run:`,`cf auth delete ${n}`),await o(`default`)}},E=`oauth-scopes`;function D(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let{id:e,name:r,category:i}=n??{};typeof e==`string`&&t.push({id:e,name:typeof r==`string`?r:e,...typeof i==`string`&&{category:i}})}return t.length>0?t:void 0}function O(e){return new Map(e.map(e=>[e.id,e]))}async function k(e){let t=h(E,[],864e5,D);if(t)return O(t);let[n,{default:r}]=await Promise.all([e(),import(`./list-4MfEFwJN.mjs`)]),i=await n.send(r),a=D(typeof i==`object`&&i&&`result`in i?i.result:i);if(!a)throw Error(`the API returned an unexpected scope catalogue`);return g(E,[],a),O(a)}const A={account_and_billing:`Account & Billing`,ai_and_machine_learning:`AI & Machine Learning`,analytics_and_logs:`Analytics & Logs`,app_security:`App Security`,cache_and_performance:`Cache & Performance`,cloudflare_one_and_zero_trust:`Cloudflare One / Zero Trust`,developer_platform:`Developer Platform`,dns_and_zones:`DNS & Zones`,email_and_messaging:`Email & Messaging`,media:`Media`,network_services:`Network Services`,other:`Other`,rules_and_configuration:`Rules & Configuration`},j=`Uncategorized`,M=[`Other`,j],N=new Set(i),P=/* @__PURE__ */ new Set([`read`,`metadata_read`]),F=/^(.+)([.:])([^.:]+)$/;function I(e){return A[e]??e.split(`_`).map(e=>e===`and`?`&`:e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function L(e,t){return M.indexOf(e)-M.indexOf(t)||e.localeCompare(t)}function R(e){return e.some(e=>F.test(e))}function z(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=F.exec(r);if(!e?.[1]||!e[3])continue;let i=t.get(r),a=i?.category?I(i.category):j,o=n.get(a)??[];o.push({scope:r,resource:e[1],action:e[3]}),n.set(a,o)}return n}function B(e,t,n){let r=t.get(e)??[],i=n.get(e)?.length??0,a=r.filter(({scope:e})=>N.has(e)).length,o=r.length-a,s=i>0?[`${a}/${i}`]:[];return o>0&&s.push(`${o} custom`),s.join(` + `)}function V(t,n){let r=z(t,n),a=z(i,n),o=[...r.keys()].sort(L);if(o.length===0)return``;let s=Math.max(...o.map(e=>e.length));return o.map(t=>`${e.bold(e.info(t.padEnd(s)))} ${e.muted(B(t,r,a))}`).join(`
|
|
3
|
+
`)}const H=e=>` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `)}`,U=e=>e.toLowerCase().replaceAll(`_`,`-`);function W(e,t){return H(e).includes(H(t).trimEnd())}function G(e){let t=/* @__PURE__ */ new Set([j]);for(let{category:n}of e.values())n&&t.add(I(n));return[...t].sort(L)}function K(t,n,{product:r=``,filter:a=``}={}){let o=z(t,n),s=z(i,n),c=[];for(let t of[...o.keys()].sort(L)){if(!W(t,r))continue;let n=(o.get(t)??[]).filter(({scope:e})=>U(e).includes(U(a)));if(n.length===0)continue;let i=[`${e.bold(e.info(t))} ${e.muted(`(${B(t,o,s)})`)}`],l=/* @__PURE__ */ new Map,u=[...n].sort((e,t)=>Number(!P.has(e.action))-Number(!P.has(t.action))||e.action.localeCompare(t.action));for(let{scope:t,resource:n,action:r}of u){let i=(P.has(r)?e.muted(r):e.warning(r))+(N.has(t)?``:e.muted(` (custom)`));l.set(n,(l.get(n)??/* @__PURE__ */ new Set).add(i))}let d=Math.max(...[...l.keys()].map(e=>e.length));for(let[e,t]of[...l].sort(([e],[t])=>e.localeCompare(t)))i.push(` ${e.padEnd(d)} ${[...t].join(`, `)}`);c.push(i.join(`
|
|
4
|
+
`))}return c.join(`
|
|
5
|
+
|
|
6
|
+
`)}function q(e){let t=l();return t==="default"?e?`cf auth login --force`:`cf auth login`:`cf auth create ${t}`}function J(t){let n=t?.statusCode;return n===401||n===403?`your login was rejected; run ${e.code(q(!0))} to log in again`:m(t)}const Y={command:`scopes [product]`,describe:`Show the OAuth scopes granted to the current login, by product`,builder:e=>e.positional(`product`,{type:`string`,description:`Show the granted permissions in product areas matching this name, such as dns or developer`}).option(`all`,{type:`boolean`,description:`Show every granted permission, grouped by product`,default:!1}).option(`filter`,{type:`string`,description:`Show the granted permissions whose scope contains this term`}),handler:async t=>{if(t[`temporary-account`]||t[`event-code`]!==void 0)throw Error(`--temporary-account and --event-code are not supported by cf auth scopes.`);if(n({allowGlobalAuthKey:!1})!==void 0){a.warn(`${e.code(`CLOUDFLARE_API_TOKEN`)} is set, so its own permissions apply rather than OAuth scopes.`);return}let r=s();if(r?.oauth_token===void 0){a.info(`Not logged in. Run ${e.code(q(!1))} to log in.`);return}let{scopes:i}=r;if(!i){a.info(`This login didn't record its scopes. Run ${e.code(q(!0))} to log in again.`);return}if(!R(i)){a.info(`No product scopes granted. Run ${e.code(q(!0))} to log in with the default scopes.`);return}let o;try{o=await k(async()=>{let{createCommandClient:e}=await import(`./auth-Bls_1yRW.mjs`);return e(t)})}catch(e){a.warn(`Couldn't load Cloudflare's scope catalogue (${J(e)}), so scopes are listed without product groups.`),console.log(i.join(`
|
|
7
|
+
`));return}if(t.product===void 0&&!t.all&&t.filter===void 0){console.log(V(i,o)),a.info(`Run ${e.code(`cf auth scopes <product>`)} to see a product's permissions, or ${e.code(`cf auth scopes --all`)} for every granted product.`);return}let{product:c}=t;c!==void 0&&!G(o).some(e=>W(e,c))?a.info(`No product area matches "${c}". Run ${e.code(`cf auth scopes --filter ${c}`)} to search scope names instead.`):console.log(K(i,o,{product:t.product,filter:t.filter})||e.muted(`No granted scopes match.`))}},X={command:`whoami`,describe:`Show current user and authentication status`,handler:async e=>{if(e[`temporary-account`]||e[`event-code`]!==void 0)throw Error(`--temporary-account and --event-code are not supported by cf auth whoami.`);let n=process.env.CLOUDFLARE_API_TOKEN,i=s(),a;a=n?`CLOUDFLARE_API_TOKEN environment variable`:i?.oauth_token?`OAuth token from ${c()}`:`none`;let o;try{o=await d()}catch{f({authenticated:!1,error:`Not logged in`}),a===`none`&&t().isAgentic&&console.error(r('Ask the user: "I can put this online for 60 minutes without you signing in. To keep it, complete the temporary-account claim before it expires. Would you like me to deploy it that way?" (https://developers.cloudflare.com/workers/platform/claim-deployments/) If they agree, run `cf deploy --temporary-account`.'));return}let{createCloudflareClientWithToken:l}=await import(`./auth-Bls_1yRW.mjs`),{default:p}=await import(`./get-BTisquA3.mjs`),m=l({apiToken:o}),h,g=[],[_,v]=await Promise.allSettled([m.send(p),u()]);if(_.status===`fulfilled`){let e=_.value;e&&`email`in e&&typeof e.email==`string`&&(h=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,_.reason);v.status===`fulfilled`?g=v.value:process.env.DEBUG&&console.error(`Account lookup error:`,v.reason);let y=_.status===`fulfilled`||v.status===`fulfilled`,b={authenticated:!0,authSource:a,tokenValid:y,...h&&{email:h},accounts:g};i?.oauth_token&&(b.scopes=i.scopes,b.expiresAt=i.expiration_time),f(b)}},Z={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(p(w,{command:`auth login`,classification:b})).command(Q(T,`auth logout`)).command(Q(X,`auth whoami`)).command(Q(Y,`auth scopes`,[`all`])).command(Q(_,`auth create`,[`browser`,`device`])).command(Q(C,`auth delete`)).command(Q(S,`auth activate`)).command(Q(x,`auth deactivate`)).command(Q(v,`auth list`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e,t,n=[],r){return p(e,{command:t,classification:{safeFlags:n,shortFlagAliases:r}})}export{Z as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as e}from"./chunk-3PJ54H4K-
|
|
2
|
+
import{c as e}from"./chunk-3PJ54H4K-CbRAWQWI.mjs";import{t}from"./errors-CCFmptqJ.mjs";import{c as n,l as r,p as i,s as a}from"./oauth-nDH3nTCa.mjs";async function o(o){if(r())return(await i(o)).apiToken;let s=e({allowGlobalAuthKey:!1});if(s&&`apiToken`in s)return s.apiToken;let c=await a();if(c)return c;throw n()?Error(`Could not refresh your stored OAuth token. Check your connection and retry, or run 'cf auth login' to authenticate again.`):new t(`No authentication token found.
|
|
3
3
|
|
|
4
4
|
Please set one of the following:
|
|
5
5
|
1. Set the CLOUDFLARE_API_TOKEN environment variable
|