cf 1.0.0-beta.12 → 1.0.0-beta.13
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 +3119 -2067
- package/dist/_meta/hand-written-commands.json +14 -1
- package/dist/_meta/schemas.json +1856 -1132
- package/dist/{abuse-reports-Cy9RcWPu.mjs → abuse-reports-BjU1s8cf.mjs} +10 -10
- package/dist/{access-DwJm1qet.mjs → access-C_G2MZnA.mjs} +1 -1
- package/dist/account-tags-CaXDDeZ4.mjs +15 -0
- package/dist/{accounts-BSd4b-1j.mjs → accounts-BALwxDQY.mjs} +70 -77
- package/dist/{acm-BfI0p2sX.mjs → acm-CP9EaXQN.mjs} +1 -1
- package/dist/{addressing-lfeJf7YB.mjs → addressing-DRlaxqrI.mjs} +1 -1
- package/dist/{agent-memory-CP1qpn-y.mjs → agent-memory-vGhlfZBx.mjs} +1 -1
- package/dist/{ai-jFzFBANM.mjs → ai-CJtbWfB9.mjs} +18 -16
- package/dist/{ai-audit-B_tSl78A.mjs → ai-audit-C0BJNqZZ.mjs} +1 -1
- package/dist/ai-gateway-BQtv3U3x.mjs +80 -0
- package/dist/ai-search-DGU1Y5By.mjs +79 -0
- package/dist/{ai-security-CKGE547U.mjs → ai-security-CFTaYk_X.mjs} +1 -1
- package/dist/{alerting-CuxoqG3S.mjs → alerting-1hun27JC.mjs} +3 -3
- package/dist/analytics-DXUSjvzT.mjs +17 -0
- package/dist/{analytics_engine-BoapM9wd.mjs → analytics_engine-CQsnL09C.mjs} +1 -1
- package/dist/{api-security-Nk_bg-Kg.mjs → api-security-BXhrfR6-.mjs} +4 -4
- package/dist/argo-LPUCTnee.mjs +14 -0
- package/dist/{artifacts-BS6cEqCB.mjs → artifacts-Dt6easua.mjs} +1 -1
- package/dist/{audit-logs-x5tLqeX2.mjs → audit-logs-CVznAM2Z.mjs} +1 -1
- package/dist/{auth-AobvBmz4.mjs → auth-CGLsxbc6.mjs} +1 -1
- package/dist/auth-CrmVwfpJ.mjs +2 -0
- package/dist/{auth-CKotxfap.mjs → auth-eQr-kQCH.mjs} +1 -1
- package/dist/{auth-token-CtguMdmF.mjs → auth-token-pNQrX_9O.mjs} +1 -1
- package/dist/{autoconfig-PfnbLuEO.mjs → autoconfig-sD7Frryg.mjs} +151 -151
- package/dist/{basin-catalog-Ddi-t3q9.mjs → basin-catalog-ZQICw-zF.mjs} +1 -1
- package/dist/{billing-CDMc4tvX.mjs → billing-Dy1-dV_B.mjs} +2 -2
- package/dist/{bot-management-UrCM3P8K.mjs → bot-management-DTgPwL7O.mjs} +1 -1
- package/dist/{botnet-feed-CVwRm42k.mjs → botnet-feed-xb98Cj3Y.mjs} +1 -1
- package/dist/{brand-protection-DfNf5REj.mjs → brand-protection-Ck3okE2k.mjs} +1 -1
- package/dist/browser-run-DJGJSzFX.mjs +42 -0
- package/dist/build-B1L6xrgC.mjs +2 -0
- package/dist/{build-BKPVP5ip.mjs → build-HmSXqjGn.mjs} +1 -1
- package/dist/{builds-BG5DHqU3.mjs → builds-CYxcZtkG.mjs} +3 -3
- package/dist/{cache-C05hHXUp.mjs → cache-D9tSfovH.mjs} +1 -1
- package/dist/{certificate-authorities-DyCFmZwR.mjs → certificate-authorities-CpiveTFC.mjs} +1 -1
- package/dist/cf-BxsXrVeh.mjs +18 -0
- package/dist/chunk-DSGVRFIS-C1_SEtRK.mjs +2 -0
- package/dist/{chunk-FT2NMTJB-DQ7s3x7Q.mjs → chunk-NDZDTP46-Bjx_wtJe.mjs} +3 -3
- package/dist/{chunk-AUSY7DKT-BJX6Fdc4.mjs → chunk-TAK63GWY-DdMktrgc.mjs} +9 -2
- package/dist/{cli-D9qlPB-6.mjs → cli-DeJc9U8z.mjs} +1 -1
- package/dist/{client-certificates-B-m8rfM9.mjs → client-certificates-CF6YZyvP.mjs} +1 -1
- package/dist/{client-side-security-M4oIUqID.mjs → client-side-security-BLoe9kS5.mjs} +1 -1
- package/dist/{cloud-connector-B63Dwn6n.mjs → cloud-connector-DXRUHsjt.mjs} +1 -1
- package/dist/cloudflared--1Ws1RJy.mjs +2 -0
- package/dist/{cloudforce-one-Dlc1GNFy.mjs → cloudforce-one-CBLxXi6v.mjs} +162 -162
- package/dist/{command-BQpXcGKV.mjs → command-83uVfXh9.mjs} +1 -1
- package/dist/{command-BWlpCtHe.mjs → command-BDe67N_n.mjs} +1 -1
- package/dist/{command-CXxh5Hce.mjs → command-BlIb6RR2.mjs} +1 -1
- package/dist/{command-ZBQ1WITj.mjs → command-Bpzp8Mz2.mjs} +1 -1
- package/dist/{command-CKQlxypn.mjs → command-BvfKhMl7.mjs} +1 -1
- package/dist/command-CG6RvZs0.mjs +2 -0
- package/dist/{command-CRl00uA2.mjs → command-CcuLC6CJ.mjs} +1 -1
- package/dist/{command-CUkXxZsc.mjs → command-Cu7dcaHT.mjs} +1 -1
- package/dist/{command-SS1z_t68.mjs → command-D3fyhdy-.mjs} +1 -1
- package/dist/{command-DyE8v4sd.mjs → command-DUhX8Dcr.mjs} +1 -1
- package/dist/{command-VuxpEvmH.mjs → command-Dh7RmjFu.mjs} +1 -1
- package/dist/{command-DEQSv-S1.mjs → command-DwXiDOeH.mjs} +1 -1
- package/dist/{command-BlGILcTA.mjs → command-UiHLJ8Ji.mjs} +1 -1
- package/dist/{command-Rv2MR-eh.mjs → command-_rqD0hXF.mjs} +1 -1
- package/dist/{command-DBaNgfA4.mjs → command-oNVwyjGB.mjs} +1 -1
- package/dist/{completions-lf50FBGm.mjs → completions-D06AO7A8.mjs} +11 -11
- package/dist/{connector-interrupts-DHN1KtUE.mjs → connector-interrupts-DelTmNyw.mjs} +1 -1
- package/dist/{connector-telemetry-events-CHg7FmXh.mjs → connector-telemetry-events-BwxR3G8d.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-CSifYi9r.mjs → connector-telemetry-snapshots-Bqq-hrpJ.mjs} +1 -1
- package/dist/{connectors-0UwPUav-.mjs → connectors-D-m3rEpk.mjs} +1 -1
- package/dist/{containers-DuIsM7lM.mjs → containers-CVNfEjJs.mjs} +3 -3
- package/dist/{containers-DRzgE46U.mjs → containers-DeoZyeQe.mjs} +25 -25
- package/dist/{content-scan-COyTz0Wb.mjs → content-scan-W0BNzbQp.mjs} +1 -1
- package/dist/{context-Bwkz4Lm_.mjs → context-q7UaYK69.mjs} +2 -2
- package/dist/{cps-B7_BJaAU.mjs → cps-BZ6hqRb5.mjs} +1 -1
- package/dist/{csamScanner-jez2EYXC.mjs → csamScanner-Bo1t3CLh.mjs} +1 -1
- package/dist/{ct-alerting-CACDrY0E.mjs → ct-alerting-E03faC7p.mjs} +1 -1
- package/dist/{custom-certificates-BBd92YlF.mjs → custom-certificates-CUySSPzi.mjs} +3 -3
- package/dist/{custom-csrs-DTwBiNMX.mjs → custom-csrs-gNpWkJPQ.mjs} +1 -1
- package/dist/{custom-hostnames-DIWlqvN9.mjs → custom-hostnames-abGBAbx7.mjs} +4 -4
- package/dist/{custom-nameservers-DISy8v8u.mjs → custom-nameservers-BgNXol1P.mjs} +1 -1
- package/dist/{custom-pages-BHXO_NFv.mjs → custom-pages-DMKX3aoD.mjs} +1 -1
- package/dist/{d1-MvAQMvvo.mjs → d1-CE08YqYk.mjs} +26 -22
- package/dist/{dcv-delegation-Buq0hcm_.mjs → dcv-delegation-B5YUEWu0.mjs} +1 -1
- package/dist/deploy-CWNm1-5v.mjs +2 -0
- package/dist/deploy-context-Dr6bxNcB.mjs +56 -0
- package/dist/deploy-input-Cc0_2QlW.mjs +2 -0
- package/dist/{dev-D8FGPKRt.mjs → dev-ZA8itQE7.mjs} +1 -1
- package/dist/{diagnostics-ChDfJ-Gv.mjs → diagnostics-UMbG6m4n.mjs} +1 -1
- package/dist/dialog-D4Y9ocuF.mjs +2 -0
- package/dist/{dist-CYFkGHYv.mjs → dist-BHEmAAHr.mjs} +4 -4
- package/dist/dist-uRuGmkMB.mjs +60 -0
- package/dist/{dls-8D00tqvC.mjs → dls-DIl16mLp.mjs} +1 -1
- package/dist/{dns-C-A5pwf3.mjs → dns-QUpgljRG.mjs} +5 -5
- package/dist/{dns-firewall-DIiF4pro.mjs → dns-firewall-BZwJXHLj.mjs} +1 -1
- package/dist/dry-run-DRj2_uV3.mjs +2 -0
- package/dist/{durable-objects-CnIqbj84.mjs → durable-objects-BCj4ykpU.mjs} +1 -1
- package/dist/{email-auth-v97Md32E.mjs → email-auth-DlHIYhCk.mjs} +1 -1
- package/dist/{email-routing-I29RG4hb.mjs → email-routing-UKVS4DYy.mjs} +1 -1
- package/dist/{email-security-BCarmbky.mjs → email-security-CZjfRIg0.mjs} +8 -8
- package/dist/{email-sending-CsHk2HAJ.mjs → email-sending-Dquc880C.mjs} +1 -1
- package/dist/{error-sanitization-BWnGnB73.mjs → error-sanitization-DE_zSrXw.mjs} +1 -1
- package/dist/error-sanitization-DOCQ9Ykh.mjs +2 -0
- package/dist/{fieldExtractors-GIVe9jZa.mjs → fieldExtractors-BbwDRquU.mjs} +1 -1
- package/dist/{firewall-DpgFqJr3.mjs → firewall--mTfDnCJ.mjs} +3 -3
- package/dist/{flagship-BVaXXlsX.mjs → flagship-cfoSwwM9.mjs} +1 -1
- package/dist/{fraud-B5GQdEF2.mjs → fraud-Dcsq3EYK.mjs} +1 -1
- package/dist/{google-tag-gateway-C4O61lp-.mjs → google-tag-gateway-DPKSkZQi.mjs} +1 -1
- package/dist/{healthchecks-BwYMnKSF.mjs → healthchecks-D78hIIBC.mjs} +1 -1
- package/dist/{hostnames-DhrGRFeI.mjs → hostnames-sF999-6H.mjs} +1 -1
- package/dist/{hyperdrive-DAA8Fazg.mjs → hyperdrive-qWACKfA4.mjs} +2 -2
- package/dist/{iam-sRKDU2Z3.mjs → iam-Bvg_PayW.mjs} +1 -1
- package/dist/{images-DXdekLVs.mjs → images-DI_lEZ4L.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/init-1w_mcgk3.mjs +43 -0
- package/dist/{intel-CnVeSjIS.mjs → intel-BxElBUMP.mjs} +1 -1
- package/dist/interactive-BW9T1D1q.mjs +48 -0
- package/dist/interactive-DGUWZ2Gk.mjs +2 -0
- package/dist/{ips-COCUG8mk.mjs → ips-DWoaKxi7.mjs} +1 -1
- package/dist/k2-tFjaftl-.mjs +11 -0
- package/dist/{keyless-certificates-l2_S__h3.mjs → keyless-certificates-BrvxHU4J.mjs} +1 -1
- package/dist/{keys-CDZreums.mjs → keys-DcwTYKRf.mjs} +1 -1
- package/dist/{kv-DkpKVimq.mjs → kv-htXS-7uP.mjs} +2 -2
- package/dist/{lazy-command-_vZGz6mv.mjs → lazy-command-BDiIwpss.mjs} +1 -1
- package/dist/{leaked-credential-checks-edbapECI.mjs → leaked-credential-checks-bvGrLOmQ.mjs} +1 -1
- package/dist/{load-balancers-C5YMvhXD.mjs → load-balancers-BNTUt4yG.mjs} +1 -1
- package/dist/local-DlDumOSC.mjs +2 -0
- package/dist/{local-C0lQ9sTg.mjs → local-DlT72Xpn.mjs} +1 -1
- package/dist/{local-runtime-DtnWXN0a.mjs → local-runtime-CokO6qaX.mjs} +1 -1
- package/dist/{login-BrjOuHKu.mjs → login-BGF_I_LT.mjs} +1 -1
- package/dist/{login-DeOM4v0L.mjs → login-Ccw-mYwT.mjs} +1 -1
- package/dist/{logo-matches-CF8321pb.mjs → logo-matches-tE8LTKgg.mjs} +1 -1
- package/dist/{logos-Bd8xNRKW.mjs → logos-Bj845Mcw.mjs} +1 -1
- package/dist/{logpush-BYk3qqwY.mjs → logpush-Cs8JdvKi.mjs} +7 -7
- package/dist/{logs-Jcj2NN8H.mjs → logs-C92XZvNu.mjs} +1 -1
- package/dist/{magic-cloud-networking-Dgdb9H0f.mjs → magic-cloud-networking-hNp5MMw-.mjs} +1 -1
- package/dist/{magic-network-monitoring-CxVU4MZB.mjs → magic-network-monitoring-68GuWAnv.mjs} +1 -1
- package/dist/{magic-transit-KDyfUgTv.mjs → magic-transit-DNd7gu4j.mjs} +6 -6
- package/dist/{managed-defense-CxaDeNUd.mjs → managed-defense-B_wCAuFD.mjs} +1 -1
- package/dist/{managed-transforms-C7rT5E-x.mjs → managed-transforms-DZdxHPOh.mjs} +1 -1
- package/dist/{matches-BtKqG8T9.mjs → matches-B65CkflD.mjs} +1 -1
- package/dist/{mcp-QDd1Iyc0.mjs → mcp-DrJW5ayK.mjs} +4 -4
- package/dist/mesh-DfVzYTn1.mjs +26 -0
- package/dist/{migrate-DHlfR_gZ.mjs → migrate-CZNq63Uj.mjs} +1 -1
- package/dist/{monetization-pLalYYMI.mjs → monetization-BGaI8CMO.mjs} +1 -1
- package/dist/{mtls-certificates-DYA9Wu-c.mjs → mtls-certificates-BsU2emDD.mjs} +2 -2
- package/dist/{network-DrJxPWXQ.mjs → network-BEMD8P0U.mjs} +1 -1
- package/dist/{network-interconnects-D73MlYG8.mjs → network-interconnects-DMu_fcbo.mjs} +2 -7
- package/dist/o11y-C1a4gDGF.mjs +93 -0
- package/dist/{oauth-B08YQ4xq.mjs → oauth-Bj5Ne1o8.mjs} +1 -1
- package/dist/{oauth-clients-CkPDLFd-.mjs → oauth-clients-p4Etdqy_.mjs} +1 -1
- package/dist/{oauth-TGbM1Q0V.mjs → oauth-mspHHU5U.mjs} +1 -1
- package/dist/{oauth-scopes-VgliqcQe.mjs → oauth-scopes-B2IabFza.mjs} +1 -1
- package/dist/{organization-DIwqRBBV.mjs → organization-CdXt7AVZ.mjs} +1 -1
- package/dist/{organizations-Dk0D9ukm.mjs → organizations-5S6xEp7T.mjs} +1 -1
- package/dist/{origin-ca-certificates-BSFqMTn-.mjs → origin-ca-certificates-_VJAoK1D.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BOKWKDTY.mjs → origin-post-quantum-encryption-GcldDsT2.mjs} +1 -1
- package/dist/{origin-tls-client-auth-BzE3WpcN.mjs → origin-tls-client-auth-DZHld9fA.mjs} +3 -3
- package/dist/{output-BGqhvqe2.mjs → output-BOe-3AQG.mjs} +1 -1
- package/dist/{page-rules-BKaU37cM.mjs → page-rules-o1tAMMsD.mjs} +1 -1
- package/dist/{pages-2Xg-lrMf.mjs → pages-CmiOhjSl.mjs} +4 -4
- package/dist/pay-per-crawl-BsnOxGYU.mjs +38 -0
- package/dist/pay-per-use-BXWMCSyE.mjs +33 -0
- package/dist/{pipelines-BM-T7mMK.mjs → pipelines-DWLQC0F6.mjs} +2 -2
- package/dist/{precursor-DmQ32-Sp.mjs → precursor-B6DjBib6.mjs} +1 -1
- package/dist/{previews-DDQ9ACDJ.mjs → previews-dUKEBGSM.mjs} +1 -1
- package/dist/process-2wmDCy17.mjs +2 -0
- package/dist/{progress-BYVZuEcG.mjs → progress-BtkTVcHI.mjs} +1 -1
- package/dist/prompt-RlgRrmbm.mjs +3 -0
- package/dist/{queries-DPBkVynK.mjs → queries-yLwoJRHV.mjs} +1 -1
- package/dist/{queues-CCXRs98q.mjs → queues-CnJRaE1o.mjs} +1 -1
- package/dist/{r2-BKuBSW8h.mjs → r2-CuC6-zQX.mjs} +48 -45
- package/dist/{radar-Gv1yFoRX.mjs → radar-DrQLcbkq.mjs} +1 -1
- package/dist/{raw-fetch-DyYWa923.mjs → raw-fetch-B4NvWuZD.mjs} +1 -1
- package/dist/{realtime-CVl-rvgx.mjs → realtime-CjsnzHxD.mjs} +1 -1
- package/dist/{registrar-swlnh22i.mjs → registrar-BgOsxTnX.mjs} +1 -1
- package/dist/{registrar-sandbox-cmOYDnkp.mjs → registrar-sandbox-3ikBD9fB.mjs} +1 -1
- package/dist/{registry-C20J1MW0.mjs → registry-CHowrQsZ.mjs} +1 -1
- package/dist/{reporting-Bgwsvol1.mjs → reporting-hE127s5r.mjs} +1 -1
- package/dist/{request-headers-CUee83pa.mjs → request-headers-DiJeDAn1.mjs} +1 -1
- package/dist/{request-tracers-BBiJvVDz.mjs → request-tracers-BCwLxmPN.mjs} +1 -1
- package/dist/{resolve-DvxgnWjL.mjs → resolve-CaTBV-c6.mjs} +1 -1
- package/dist/resolve-DCGSzUDQ.mjs +2 -0
- package/dist/{resource-sharing-C1JiYLbl.mjs → resource-sharing-2qvWUuMa.mjs} +11 -11
- package/dist/{resource-tagging-C9VOSlDR.mjs → resource-tagging-Dwx7iL3v.mjs} +1 -1
- package/dist/{rules-BDunCGMj.mjs → rules-DxVQ6jIg.mjs} +1 -1
- package/dist/rulesets-Cdh8YjI9.mjs +37 -0
- package/dist/{rum-B7XiECe9.mjs → rum-a4CMq4Qu.mjs} +1 -1
- package/dist/{run-CrZgB8L_.mjs → run-BvHwWWUX.mjs} +1 -1
- package/dist/run-CkbrPJPx.mjs +2 -0
- package/dist/{schema-DC0kdqgV.mjs → schema-elj12WOx.mjs} +1 -1
- package/dist/{schema-flags-BUZR9SLd.mjs → schema-flags-BzoBGPWk.mjs} +1 -1
- package/dist/{scim-CORcs2wK.mjs → scim-B8XlXl8v.mjs} +1 -1
- package/dist/{secrets-store-BoZQaFey.mjs → secrets-store-Cqhedh_i.mjs} +2 -2
- package/dist/{security-insights-DblK_6sg.mjs → security-insights-le2-DteL.mjs} +1 -1
- package/dist/{security-txt-Dl7RPnRb.mjs → security-txt-cCArWXur.mjs} +1 -1
- package/dist/{session-BWe9et4K.mjs → session-C1BhT1ZJ.mjs} +1 -1
- package/dist/shared-BPjcpXuA.mjs +2 -0
- package/dist/{smart-shield-DX0-8ruu.mjs → smart-shield-Csyh8hwB.mjs} +1 -1
- package/dist/{snippets-BFN-Lg3K.mjs → snippets-DUWx25q6.mjs} +1 -1
- package/dist/spawn-IysxuTNW.mjs +10 -0
- package/dist/{spectrum-HYWLWB0X.mjs → spectrum-Da3UYSOR.mjs} +1 -1
- package/dist/{speed-Dj0YhfRe.mjs → speed-NxlMnB2e.mjs} +1 -1
- package/dist/sql-CNdHAlQ8.mjs +4 -0
- package/dist/src-JfLDUxFr.mjs +125 -0
- package/dist/{ssl-BQL1fNtD.mjs → ssl-BtaX2WEJ.mjs} +1 -1
- package/dist/startup-profile-B2l0ChVu.mjs +2 -0
- package/dist/{startup-profile-0X5ebbng.mjs → startup-profile-CdJWgNjd.mjs} +1 -1
- package/dist/{state-Dy6-rKNd.mjs → state-BDSvdSdP.mjs} +1 -1
- package/dist/state-JB4_BU1o.mjs +2 -0
- package/dist/{stream-DKv2TtZN.mjs → stream-C1Ijjzn4.mjs} +3 -3
- package/dist/{submit-Byt2KBGI.mjs → submit-MdkuU_Pt.mjs} +1 -1
- package/dist/{tags-BIBsdG68.mjs → tags-CA1xMM96.mjs} +1 -1
- package/dist/telemetry-BsYO3nxG.mjs +2 -0
- package/dist/{telemetry-bu3txnIR.mjs → telemetry-Cm39QJ-M.mjs} +1 -1
- package/dist/{tenant-Bs4Ac4n3.mjs → tenant-BB6Oszcl.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-DcaELeCE.mjs → tenant-custom-nameservers-BsbgYAEo.mjs} +1 -1
- package/dist/{tools-BbTX7rlM.mjs → tools-CSc5DmFi.mjs} +1 -1
- package/dist/{tunnels-DWcrz9Sf.mjs → tunnels-CRFtyHWz.mjs} +4 -4
- package/dist/{turnstile-2MIGp2ce.mjs → turnstile-DBXWo_Xe.mjs} +1 -1
- package/dist/update-check-C2oVEbXx.mjs +2 -0
- package/dist/{update-check-CfB0PNTY.mjs → update-check-CMXSdres.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-info-B8udoxlx.mjs → url-info-t-XAs0Mk.mjs} +1 -1
- package/dist/{url-normalization-C6AdWtaE.mjs → url-normalization-Cs4F8e0a.mjs} +1 -1
- package/dist/{url-scanner-Dg0c_yVb.mjs → url-scanner-CBIoDbTx.mjs} +1 -1
- package/dist/{user-BLZ-0Bgv.mjs → user-CevdOMoa.mjs} +3 -3
- package/dist/values-CjNlkbIh.mjs +4 -0
- package/dist/{vectorize-DEUSEQXY.mjs → vectorize-9d9tPmg5.mjs} +1 -1
- package/dist/version-BdVUXLnK.mjs +2 -0
- package/dist/{waiting-rooms-BycGk2Y0.mjs → waiting-rooms--5WmrWb3.mjs} +1 -1
- package/dist/{web-assets-CLZdWOmN.mjs → web-assets-BHot_MU8.mjs} +1 -1
- package/dist/{web3-DjeavuLg.mjs → web3-CYfWAF6b.mjs} +1 -1
- package/dist/{workers-C_SfyU-v.mjs → workers-S17M0n3h.mjs} +23 -21
- package/dist/{workers-builds-COn5Ne5G.mjs → workers-builds-Dw7ho3So.mjs} +2 -2
- package/dist/{workers-for-platforms-tchCXwNF.mjs → workers-for-platforms-A3yjyLh3.mjs} +4 -6
- package/dist/{workers-vpc-CKts8Av0.mjs → workers-vpc-BZ2xXtC3.mjs} +1 -1
- package/dist/{workflows-BibtWuOx.mjs → workflows-BgGrVpSR.mjs} +1 -1
- package/dist/{wrangler-migration-BpJqCFAa.mjs → wrangler-migration-C6FKHER1.mjs} +1 -1
- package/dist/{zaraz-BvQZB0YY.mjs → zaraz-BsD2dMI3.mjs} +1 -1
- package/dist/{zero-trust-FStq4uhn.mjs → zero-trust-CA3iGQbG.mjs} +413 -397
- package/dist/{zone-tymlghWb.mjs → zone-D2M4EZD0.mjs} +1 -1
- package/dist/{zones-Bz6dgT9_.mjs → zones-BoOC_JzC.mjs} +1 -1
- package/package.json +25 -26
- package/dist/account-tags-d0RkEw6s.mjs +0 -15
- package/dist/ai-gateway-CJaUlfGc.mjs +0 -82
- package/dist/ai-search-PTlpY1T9.mjs +0 -79
- package/dist/analytics-NPND7aHB.mjs +0 -20
- package/dist/argo-DYfLQhd2.mjs +0 -10
- package/dist/auth-CBtzZ3Sw.mjs +0 -2
- package/dist/browser-run-DVaiBLYX.mjs +0 -46
- package/dist/build-C4giET85.mjs +0 -2
- package/dist/cf-B9aqZZKD.mjs +0 -18
- package/dist/chunk-KKDV4JPS-D3kwd1Nq.mjs +0 -2
- package/dist/cloudflared-B48cfu95.mjs +0 -2
- package/dist/command-CzvlHvov.mjs +0 -2
- package/dist/deploy-BS47vZvJ.mjs +0 -2
- package/dist/deploy-context-Cfushp8j.mjs +0 -56
- package/dist/deploy-input-BAhS5LYx.mjs +0 -2
- package/dist/dialog-CL1Zy4pn.mjs +0 -2
- package/dist/dist-8rP3V95o.mjs +0 -57
- package/dist/dry-run-DmsbOMF1.mjs +0 -2
- package/dist/error-sanitization-C_a2LxOK.mjs +0 -2
- package/dist/init-j47MT4Qe.mjs +0 -39
- package/dist/interactive-Dqv0RWVU.mjs +0 -42
- package/dist/interactive-Wpd3FcDc.mjs +0 -2
- package/dist/k2-CmHkArHL.mjs +0 -13
- package/dist/local-D5L5Bwju.mjs +0 -2
- package/dist/mesh-DtrIzl5z.mjs +0 -26
- package/dist/observability-CvN9oxAo.mjs +0 -80
- package/dist/pay-per-crawl-5-KTQXRr.mjs +0 -65
- package/dist/pay-per-use-sGebKzNK.mjs +0 -6
- package/dist/prompt-F5wxc8zq.mjs +0 -3
- package/dist/resolve-qwL1LmKN.mjs +0 -2
- package/dist/rulesets-BMGxrnv9.mjs +0 -37
- package/dist/run-nNxXb_Cv.mjs +0 -2
- package/dist/shared-0N31BXkY.mjs +0 -2
- package/dist/spawn-DZ9A-xXb.mjs +0 -10
- package/dist/src-CAiZlihY.mjs +0 -117
- package/dist/startup-profile-CXnsF4c7.mjs +0 -2
- package/dist/state-BA2CanJ_.mjs +0 -2
- package/dist/telemetry-DBXOMuLh.mjs +0 -2
- package/dist/update-check-B-CvDAUz.mjs +0 -2
- package/dist/values-BUK-m0Jg.mjs +0 -4
- package/dist/version-BZNc7Y3t.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-
|
|
2
|
+
import{n as e}from"./auth-CGLsxbc6.mjs";import{i as t}from"./context-q7UaYK69.mjs";import{t as n}from"./output-BOe-3AQG.mjs";import{t as r}from"./dry-run-DRj2_uV3.mjs";import{t as i}from"./progress-BtkTVcHI.mjs";import{t as a}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as o,t as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{a as l,n as u}from"./prompt-RlgRrmbm.mjs";function d(e){return e.usage(`$0 acm custom-trust-store create
|
|
3
3
|
|
|
4
4
|
Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`).option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Upload Custom Origin Trust Store`,builder:d,handler:async u=>a({command:`acm custom-trust-store create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({certificate:c(u.certificate,`certificate`,`text`)}):o(u.body)});return}let a=await e(u),d=await t({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body),t=await i(`Creating`,async()=>a.acm.customTrustStore.create({...e,zone_id:d}));n(t,{successLabel:`Created`});return}u.certificate===void 0&&(u.certificate=await l(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=s({certificate:c(u.certificate,`certificate`,`text`)}),p=await i(`Creating`,async()=>a.acm.customTrustStore.create({...f,zone_id:d}));n(p,{successLabel:`Created`})})};function p(e){return e.usage(`$0 acm custom-trust-store delete <custom-origin-trust-store-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DlT72Xpn.mjs";import{i as t,n}from"./auth-CGLsxbc6.mjs";import{a as r,i,t as a}from"./context-q7UaYK69.mjs";import{t as o}from"./output-BOe-3AQG.mjs";import{t as s}from"./dry-run-DRj2_uV3.mjs";import{t as c}from"./progress-BtkTVcHI.mjs";import{t as l}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as u,r as d,t as f}from"./body-parser-DkHKPkJ7.mjs";import{n as p,t as m}from"./input-validation-D7z60HJH.mjs";import{a as h,n as g}from"./prompt-RlgRrmbm.mjs";import{n as ee,t as te}from"./raw-fetch-B4NvWuZD.mjs";function _(e){return e.usage(`$0 addressing address-maps accounts delete <member-account-id>
|
|
3
3
|
|
|
4
4
|
Remove an account as a member of a particular address map.`).positional(`member-account-id`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <member-account-id>`,describe:`Remove an account membership from an Address Map`,builder:_,handler:async t=>l({command:`addressing address-maps accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/addressing/address_maps/${t[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(t[`address-map-id`]))}/accounts/${t[`member-account-id`]==null?`<member-account-id>`:encodeURIComponent(String(t[`member-account-id`]))}`,pathParams:{"address-map-id":String(t[`address-map-id`]??``),"member-account-id":String(t[`member-account-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}let u=await c(`Deleting`,async()=>i.addressing.addressMaps.accounts.delete({account_id:l,address_map_id:t[`address-map-id`],member_account_id:t[`member-account-id`]}));o(u,{successLabel:`Deleted`})})};function y(e){return e.usage(`$0 addressing address-maps accounts update <member-account-id>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-RlgRrmbm.mjs";import{t as m}from"./cli-types-9oYmRTHJ.mjs";function h(e){return e.usage(`$0 agent-memory create-namespace
|
|
3
3
|
|
|
4
4
|
Creates a new memory namespace owned by the account.`).option(`name`,{type:`string`,description:`Namespace 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 g={command:`create-namespace`,describe:`Create a namespace`,builder:h,handler:async l=>s({command:`agent-memory create-namespace`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.agentMemory.createNamespace({...e,account_id:p}));i(t,{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Namespace name.`));let m=u({name:d(l.name,`name`,`text`)}),h=await o(`Creating`,async()=>s.agentMemory.createNamespace({...m,account_id:p}));i(h,{successLabel:`Created`})})};function _(e){return e.usage(`$0 agent-memory delete-memory <memory-id>
|
|
5
5
|
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t,t as n}from"./local-
|
|
2
|
+
import{r as e}from"./theme-CQ_TYifs.mjs";import{n as t,t as n}from"./local-DlT72Xpn.mjs";import{a as r,i,n as a}from"./auth-CGLsxbc6.mjs";import{a as o,t as s}from"./context-q7UaYK69.mjs";import{t as c}from"./output-BOe-3AQG.mjs";import{t as l}from"./dry-run-DRj2_uV3.mjs";import{t as u}from"./progress-BtkTVcHI.mjs";import{n as d,t as f}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as p,t as m}from"./body-parser-DkHKPkJ7.mjs";import{n as h,t as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as ee,n as v}from"./prompt-RlgRrmbm.mjs";import{t as y}from"./cli-types-9oYmRTHJ.mjs";import{n as te}from"./raw-fetch-B4NvWuZD.mjs";import{_ as ne,c as b,d as re,f as ie,g as ae,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A}from"./schema-flags-BzoBGPWk.mjs";function j(e){return e.usage(`$0 ai authors list
|
|
3
3
|
|
|
4
|
-
Searches Workers AI models by author or organization name.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
4
|
+
Searches Workers AI models by author or organization name.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Author Search`,builder:j,handler:async e=>f({command:`ai authors list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();l({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.ai.authors.list({account_id:r}));c(i,{successLabel:`Loaded`})})},N={command:`authors`,describe:`Operations for authors`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 ai finetunes assets create <finetune-id>
|
|
5
5
|
|
|
6
|
-
Uploads training data assets for a Workers AI fine-tuning job.`).positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors).`})}const
|
|
6
|
+
Uploads training data assets for a Workers AI fine-tuning job.`).positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors).`})}const F={command:`create <finetune-id>`,describe:`Upload a Finetune Asset`,builder:P,handler:async e=>f({command:`ai finetunes assets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai finetunes assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,"file-name":e[`file-name`]}});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,e.file!==void 0||e.body!==void 0||e[`file-name`]!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e[`file-name`]!==void 0&&n.append(`file_name`,String(h(e[`file-name`],`file-name`,`text`)??``));let a=await u(`Creating`,async()=>i(t,`POST`,`/accounts/${r}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n}));c(a,{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`),a=await u(`Creating`,async()=>i(t,`POST`,`/accounts/${r}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n,headers:{"Content-Type":`multipart/form-data`}}));c(a,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function I(e){return e.usage(`$0 ai finetunes assets download <file-name>
|
|
7
7
|
|
|
8
|
-
Returns a pre-signed R2 URL for downloading a finetune asset file.`).positional(`file-name`,{type:`string`,description:`File name`,demandOption:!0}).option(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
8
|
+
Returns a pre-signed R2 URL for downloading a finetune asset file.`).positional(`file-name`,{type:`string`,description:`File name`,demandOption:!0}).option(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`download <file-name>`,describe:`Download a Finetune Asset`,builder:I,handler:async e=>f({command:`ai finetunes assets download`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai finetunes assets download`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets/${e[`file-name`]==null?`<file-name>`:encodeURIComponent(String(e[`file-name`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``),"file-name":String(e[`file-name`]??``)},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.ai.finetunes.assets.download({account_id:r,finetune_id:e[`finetune-id`],file_name:e[`file-name`]}));c(i,{successLabel:`Loaded`})})},R={command:`assets`,describe:`Operations for finetunes.assets`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 ai finetunes create
|
|
9
9
|
|
|
10
|
-
Creates a new fine-tuning job for a Workers AI model using custom training data.`).option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
10
|
+
Creates a new fine-tuning job for a Workers AI model using custom training data.`).option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create`,describe:`Create a new Finetune`,builder:z,handler:async e=>f({command:`ai finetunes create`,classification:{safeFlags:[`public`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai finetunes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),model:h(e.model,`model`,`text`),name:h(e.name,`name`,`text`),public:e.public}):p(e.body)});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,e.body){let n=p(e.body),i=await u(`Creating`,async()=>t.ai.finetunes.create({...n,account_id:r}));c(i,{successLabel:`Created`});return}e.model===void 0&&(e.model=await _(`model`,`The model field`)),e.name===void 0&&(e.name=await _(`name`,`The name field`));let i=m({description:h(e.description,`description`,`text`),model:h(e.model,`model`,`text`),name:h(e.name,`name`,`text`),public:e.public}),d=await u(`Creating`,async()=>t.ai.finetunes.create({...i,account_id:r}));c(d,{successLabel:`Created`})})};function V(e){return e.usage(`$0 ai finetunes delete <finetune-id>
|
|
11
11
|
|
|
12
|
-
Delete a finetune. Any in-flight requests referencing the lora will fail after the files are deleted.`).positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const
|
|
13
|
-
`);return}let i=await u(`Deleting`,async()=>t.ai.finetunes.delete({account_id:r,finetune_id:e[`finetune-id`]}));c(i,{successLabel:`Deleted`})})};function
|
|
12
|
+
Delete a finetune. Any in-flight requests referencing the lora will fail after the files are deleted.`).positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H={command:`delete <finetune-id>`,describe:`Delete a Finetune`,builder:V,handler:async e=>f({command:`ai finetunes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai finetunes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,!await v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
13
|
+
`);return}let i=await u(`Deleting`,async()=>t.ai.finetunes.delete({account_id:r,finetune_id:e[`finetune-id`]}));c(i,{successLabel:`Deleted`})})};function U(e){return e.usage(`$0 ai finetunes list
|
|
14
14
|
|
|
15
|
-
Lists all fine-tuning jobs created by the account, including status and metrics.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
15
|
+
Lists all fine-tuning jobs created by the account, including status and metrics.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`List Finetunes`,builder:U,handler:async e=>f({command:`ai finetunes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();l({command:`cf ai finetunes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.ai.finetunes.list({account_id:r}));c(i,{successLabel:`Loaded`})})};function oe(e){return e.usage(`$0 ai finetunes public list
|
|
16
16
|
|
|
17
|
-
Lists publicly available fine-tuned models that can be used with Workers AI.`).option(`limit`,{type:`number`,description:`Pagination Limit.`}).option(`offset`,{type:`number`,description:`Pagination Offset.`}).option(`order-by`,{type:`string`,description:`Order By Column Name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
17
|
+
Lists publicly available fine-tuned models that can be used with Workers AI.`).option(`limit`,{type:`number`,description:`Pagination Limit.`}).option(`offset`,{type:`number`,description:`Pagination Offset.`}).option(`order-by`,{type:`string`,description:`Order By Column Name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List Public Finetunes`,builder:oe,handler:async e=>f({command:`ai finetunes public list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={limit:e.limit,offset:e.offset,orderBy:e[`order-by`]};if(e.dryRun){let e=await o();l({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:t,bodyKind:`none`});return}let r=await a(e),i=e.local?n:await s();e.accountId=i;let d=await u(`Loading`,async()=>r.ai.finetunes.public.list({account_id:i,...t}));c(d,{successLabel:`Loaded`})})},K={command:`public`,describe:`Operations for finetunes.public`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`finetunes`,describe:`Operations for finetunes`,builder:e=>e.command(B).command(H).command(W).command(R).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.usage(`$0 ai get-model-schema
|
|
18
18
|
|
|
19
|
-
Retrieves the input and output JSON Schema definitions for an AI model. Use these definitions to determine the model-specific request fields and response format.`).option(`model`,{type:`string`,description:`AI model identifier, including its namespace and model name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
19
|
+
Retrieves the input and output JSON Schema definitions for an AI model. Use these definitions to determine the model-specific request fields and response format.`).option(`model`,{type:`string`,description:`AI model identifier, including its namespace and model name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get-model-schema`,describe:`Get an AI model's input and output schemas`,builder:se,handler:async e=>f({command:`ai get-model-schema`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={model:e.model};if(e.dryRun){let e=await o();l({command:`cf ai get-model-schema`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let r=await a(e),i=e.local?n:await s();e.accountId=i;let d=await u(`Loading`,async()=>r.ai.getModelSchema({account_id:i,...t}));c(d,{successLabel:`Loaded`})})};function le(e){return e.usage(`$0 ai list-markdown-supported-formats
|
|
20
20
|
|
|
21
|
-
Lists the file extensions and MIME types accepted by Workers AI's Markdown conversion endpoint. Use this list to check whether a file can be converted before uploading it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
21
|
+
Lists the file extensions and MIME types accepted by Workers AI's Markdown conversion endpoint. Use this list to check whether a file can be converted before uploading it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list-markdown-supported-formats`,describe:`List supported Markdown conversion formats`,builder:le,handler:async e=>f({command:`ai list-markdown-supported-formats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();l({command:`cf ai list-markdown-supported-formats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.ai.listMarkdownSupportedFormats({account_id:r}));c(i,{successLabel:`Loaded`})})};function de(e){return e.usage(`$0 ai models list
|
|
22
22
|
|
|
23
|
-
Searches Workers AI models by name or description.`).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
23
|
+
Searches Workers AI models by name or description.`).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Model Search`,builder:y(de),handler:async e=>f({command:`ai models list`,classification:{safeFlags:[`hide-experimental`,`include-deprecated`,`format`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){let e=await o();l({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let r=await a(e),i=e.local?n:await s();e.accountId=i;let d=await u(`Loading`,async()=>r.ai.models.list({account_id:i,...t}));c(d,{successLabel:`Loaded`})})},pe={command:`models`,describe:`Operations for models`,builder:e=>e.command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.usage(`$0 ai tasks list
|
|
24
24
|
|
|
25
|
-
Searches Workers AI models by task type (e.g., text-generation, embeddings).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
25
|
+
Searches Workers AI models by task type (e.g., text-generation, embeddings).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`Task Search`,builder:me,handler:async e=>f({command:`ai tasks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();l({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await a(e),r=e.local?n:await s();e.accountId=r;let i=await u(`Loading`,async()=>t.ai.tasks.list({account_id:r}));c(i,{successLabel:`Loaded`})})},ge={command:`tasks`,describe:`Operations for tasks`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.usage(`$0 ai to-markdown
|
|
26
26
|
|
|
27
|
-
Converts files uploaded as multipart form data into Markdown using Workers AI. Returns a conversion result for each file. Use the supported-formats endpoint to check accepted file types.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:`Files to convert, supplied as multipart file uploads.`})}const
|
|
28
|
-
|
|
29
|
-
`)}
|
|
27
|
+
Converts files uploaded as multipart form data into Markdown using Workers AI. Returns a conversion result for each file. Use the supported-formats endpoint to check accepted file types.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:`Files to convert, supplied as multipart file uploads.`})}const ve={command:`to-markdown`,describe:`Convert uploaded files to Markdown`,builder:_e,handler:async e=>f({command:`ai to-markdown`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai to-markdown`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?h(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}let a=await u(`Creating`,async()=>i(t,`POST`,`/accounts/${r}/ai/tomarkdown`,{body:n}));c(a,{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`),a=await u(`Creating`,async()=>i(t,`POST`,`/accounts/${r}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}}));c(a,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function J(e){return e.usage(`$0 ai websearch
|
|
28
|
+
|
|
29
|
+
Run a web search through a configured AI Gateway.`).option(`byok-alias`,{type:`string`,description:`The byokAlias field`}).option(`limit`,{type:`number`,description:`The limit field`}).option(`options-gateway-id`,{type:`string`,description:`The options.gateway.id field`}).option(`provider`,{type:`string`,description:`The provider field`}).option(`query`,{type:`string`,description:`The query 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 ye={command:`websearch`,describe:`Search the web through AI Gateway`,builder:J,handler:async e=>f({command:`ai websearch`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();l({command:`cf ai websearch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai/websearch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({byokAlias:h(e[`byok-alias`],`byok-alias`,`text`),limit:e.limit,options:{gateway:{id:h(e[`options-gateway-id`],`options-gateway-id`,`text`)}},provider:h(e.provider,`provider`,`text`),query:h(e.query,`query`,`text`)}):p(e.body)});return}let t=await a(e),r=e.local?n:await s();if(e.accountId=r,e.body){let n=p(e.body),i=await u(`Creating`,async()=>t.ai.websearch({...n,account_id:r}));c(i,{successLabel:`Created`});return}e[`options-gateway-id`]===void 0&&(e[`options-gateway-id`]=await _(`options-gateway-id`,`The options.gateway.id field`)),e.query===void 0&&(e.query=await _(`query`,`The query field`));let i=m({byokAlias:h(e[`byok-alias`],`byok-alias`,`text`),limit:e.limit,options:{gateway:{id:h(e[`options-gateway-id`],`options-gateway-id`,`text`)}},provider:h(e.provider,`provider`,`text`),query:h(e.query,`query`,`text`)}),d=await u(`Creating`,async()=>t.ai.websearch({...i,account_id:r}));c(d,{successLabel:`Created`})})},Y=`ai-model-schema`;async function X(e,t,n,r){let i=ae(Y,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:w(e)}}let o=x(a,`input`);return o?(ne(Y,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const Z="Run `cf ai models list` to see the models you can run.",Q=[`model-name`,`modelName`];let $;function be(e){return $=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${Z}`)}async function xe(n){n.local&&console.log(`${t}\n`),$?.showHelp(`log`);let i=n[`model-name`];if(!i||n.local)return;let o=Date.now()+D,s=await r(o);if(!s){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${i}.`)}`);return}let c=await X(i,s,()=>a(n),o);console.log(c.ok?`\n${E(b(c.schema),`Input flags for ${i}`)}`:`\n${e.muted(`Could not load the input flags for ${i}: ${c.reason}.`)}`)}var Se=d({command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:be,handler:async e=>{if(e.help){await xe(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${Z}`);let r=e.dryRun?await o()??`<account-id>`:await s(),d;if(e.body!==void 0){if(C(e,Q).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);d=p(e.body)}else{let t=await X(n,r,()=>a(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let i=b(t.schema),o=C(e,[...Q,...T(i)]);if(o.length>0)throw Error(`${o.map(e=>`Unknown flag --${e}`).join(`
|
|
30
|
+
`)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);let s=/* @__PURE__ */ new Set;for(;;){let t=S(i,e).find(e=>!s.has(e.name)&&(e.choices!==void 0||e.type===`string`));if(!t)break;s.add(t.name),t.choices?e[t.name]=await ee(t.name,k(t),t.choices,t.choiceLabels):e[t.name]=await _(t.name,k(t))}let c=O(t.schema),l=A(i,e,{reserved:Q}),u=l.errors.length===0?c?re(t.schema,l.body):ie(t.schema,l.body):l.errors;if(u.length>0)throw Error(`${u.join(`
|
|
31
|
+
`)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);d=l.body}if(e.dryRun){let e={model:n,input:d};l({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r}/ai/run`,pathParams:{},bodyKind:`json`,body:e});return}let f=await a(e);e.accountId=r;let m=await u(`Running`,async()=>i(f,`POST`,`/accounts/${r}/ai/run`,{body:{model:n,input:d},preserveNonJsonBytes:!0}));if(Buffer.isBuffer(m)){te(m);return}c(m,{successLabel:`Ran`})}},{command:`ai run`,recordArgs:!1});const Ce={command:`ai`,describe:`ai`,builder:e=>e.command(ce).command(ue).command(Se).command(ve).command(ye).command(N).command(q).command(pe).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ce as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t}from"./auth-
|
|
2
|
+
import{i as e,n as t}from"./auth-CGLsxbc6.mjs";import{i as n}from"./context-q7UaYK69.mjs";import{t as r}from"./output-BOe-3AQG.mjs";import{t as i}from"./dry-run-DRj2_uV3.mjs";import{t as a}from"./progress-BtkTVcHI.mjs";import{t as o}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as s}from"./body-parser-DkHKPkJ7.mjs";function c(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 l={command:`bulk-get`,describe:`Bulk get robots.txt rules`,builder:c,handler:async c=>o({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await t(c);if(c.zoneId=await n({zone:c.zone},o,{quiet:c.quiet}),c.body){let t=s(c.body);if(Array.isArray(t)&&t.length>25){let n=Math.ceil(t.length/25),i=null;for(let r=0;r<t.length;r+=25){let s=t.slice(r,r+25),l=Math.floor(r/25)+1;i=await a(`Loading: batch ${l}/${n}`,async()=>e(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:s}))}r(i,{successLabel:`Loaded`});return}let n=await a(`Loading`,async()=>e(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:t}));r(n,{successLabel:`Loaded`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function u(e){return e.usage(`$0 ai-audit robots get
|
|
5
5
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-RlgRrmbm.mjs";import{t as m}from"./cli-types-9oYmRTHJ.mjs";function h(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
|
|
3
|
+
|
|
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`]}).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 g={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:h,handler:async l=>s({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(l[`gateway-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({domain:d(l.domain,`domain`,`text`),minTLS:d(l[`min-tls`],`min-tls`,`text`),zone_id:d(l[`zone-id`],`zone-id`,`text`)}):c(l.body)});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.aiGateway.customDomains.create({...e,account_id:p,gateway_id:l[`gateway-id`]}));i(t,{successLabel:`Created`});return}l.domain===void 0&&(l.domain=await f(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),l[`zone-id`]===void 0&&(l[`zone-id`]=await f(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let m=u({domain:d(l.domain,`domain`,`text`),minTLS:d(l[`min-tls`],`min-tls`,`text`),zone_id:d(l[`zone-id`],`zone-id`,`text`)}),h=await o(`Creating`,async()=>s.aiGateway.customDomains.create({...m,account_id:p,gateway_id:l[`gateway-id`]}));i(h,{successLabel:`Created`})})};function ee(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
|
|
5
|
+
|
|
6
|
+
Deletes a custom domain from an AI Gateway and removes its Cloudflare for SaaS custom hostname.`).positional(`hostname`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`.",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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const te={command:`delete <hostname>`,describe:`Delete a custom domain`,builder:ee,handler:async c=>s({command:`ai-gateway custom-domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/custom-domains/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force,message:`This deletes the custom domain and its custom hostname. Requests to this hostname will stop reaching the gateway.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let u=await o(`Deleting`,async()=>s.aiGateway.customDomains.delete({account_id:l,gateway_id:c[`gateway-id`],hostname:c.hostname}));i(u,{successLabel:`Deleted`})})};function _(e){return e.usage(`$0 ai-gateway custom-domains get <hostname>
|
|
8
|
+
|
|
9
|
+
Retrieves a custom domain attached to an AI Gateway, including its status and CNAME target.`).positional(`hostname`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`.",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 v={command:`get <hostname>`,describe:`Get a custom domain`,builder:_,handler:async c=>s({command:`ai-gateway custom-domains get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/custom-domains/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.customDomains.get({account_id:l,gateway_id:c[`gateway-id`],hostname:c.hostname}));i(u,{successLabel:`Loaded`})})};function y(e){return e.usage(`$0 ai-gateway custom-domains list
|
|
10
|
+
|
|
11
|
+
Lists the custom domains attached to an AI Gateway, including the certificate and validation status of each domain.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Status`,choices:[`initializing`,`pending_dcv`,`active`,`blocked`,`error`]}).option(`search`,{type:`string`,description:`Search by hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List custom domains`,builder:m(y),handler:async c=>s({command:`ai-gateway custom-domains list`,classification:{safeFlags:[`status`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],status:c.status,search:c.search};if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.customDomains.list({account_id:u,gateway_id:c[`gateway-id`],...s}));i(d,{successLabel:`Loaded`})})},x={command:`custom-domains`,describe:`Manage custom hostnames that route requests through an AI Gateway`,builder:e=>e.command(g).command(te).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.usage(`$0 ai-gateway custom-providers create
|
|
12
|
+
|
|
13
|
+
Creates an account-level custom provider that forwards AI Gateway requests to the HTTPS base URL you supply. Requests reference the provider as \`custom-{slug}\`, so the slug must be unique within the account.`).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug 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 C={command:`create`,describe:`Create a custom provider`,builder:S,handler:async l=>s({command:`ai-gateway custom-providers create`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway custom-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({base_url:d(l[`base-url`],`base-url`,`text`),beta:l.beta,curl_example:d(l[`curl-example`],`curl-example`,`text`),description:d(l.description,`description`,`text`),enable:l.enable,headers:d(l.headers,`headers`,`text`),js_example:d(l[`js-example`],`js-example`,`text`),link:d(l.link,`link`,`text`),name:d(l.name,`name`,`text`),position:l.position,slug:d(l.slug,`slug`,`text`)}):c(l.body),sensitiveBodyPaths:[[`headers`]]});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.aiGateway.customProviders.create({...e,account_id:p}));i(t,{successLabel:`Created`});return}l[`base-url`]===void 0&&(l[`base-url`]=await f(`base-url`,`The base_url field`)),l.name===void 0&&(l.name=await f(`name`,`The name field`)),l.slug===void 0&&(l.slug=await f(`slug`,`The slug field`));let m=u({base_url:d(l[`base-url`],`base-url`,`text`),beta:l.beta,curl_example:d(l[`curl-example`],`curl-example`,`text`),description:d(l.description,`description`,`text`),enable:l.enable,headers:d(l.headers,`headers`,`text`),js_example:d(l[`js-example`],`js-example`,`text`),link:d(l.link,`link`,`text`),name:d(l.name,`name`,`text`),position:l.position,slug:d(l.slug,`slug`,`text`)}),h=await o(`Creating`,async()=>s.aiGateway.customProviders.create({...m,account_id:p}));i(h,{successLabel:`Created`})})};function w(e){return e.usage(`$0 ai-gateway custom-providers delete <id>
|
|
14
|
+
|
|
15
|
+
Deletes a custom provider and every pricing rule that belongs to it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <id>`,describe:`Delete a custom provider`,builder:w,handler:async c=>s({command:`ai-gateway custom-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force,message:"This permanently deletes the custom provider and all of its pricing rules. Gateway requests that use `custom-{slug}` for this provider will stop routing."})){process.stderr.write(`Aborted.
|
|
16
|
+
`);return}let u=await o(`Deleting`,async()=>s.aiGateway.customProviders.delete({account_id:l,id:c.id}));i(u,{successLabel:`Deleted`})})};function E(e){return e.usage(`$0 ai-gateway custom-providers get <id>
|
|
17
|
+
|
|
18
|
+
Retrieves a custom provider, including its slug, base URL, and custom headers.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <id>`,describe:`Get a custom provider`,builder:E,handler:async c=>s({command:`ai-gateway custom-providers get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.customProviders.get({account_id:l,id:c.id}));i(u,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 ai-gateway custom-providers list
|
|
19
|
+
|
|
20
|
+
Lists the custom providers configured for the account, ordered by position and then name.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`beta`,{type:`boolean`,description:`Beta`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, slug`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List custom providers`,builder:O,handler:async c=>s({command:`ai-gateway custom-providers list`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],beta:c.beta,enable:c.enable,search:c.search};if(c.dryRun){let e=await n();a({command:`cf ai-gateway custom-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.customProviders.list({account_id:u,...s}));i(d,{successLabel:`Loaded`})})};function A(e){return e.usage(`$0 ai-gateway custom-providers update <id>
|
|
21
|
+
|
|
22
|
+
Updates the specified fields of a custom provider. Changes clear cached entries for the provider.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`logo`,{type:`string`,description:`The logo field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <id>`,describe:`Update a custom provider`,builder:A,handler:async l=>s({command:`ai-gateway custom-providers update`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway custom-providers update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{id:String(l.id??``)},bodyKind:`json`,body:l.body===void 0?u({base_url:d(l[`base-url`],`base-url`,`text`),beta:l.beta,curl_example:d(l[`curl-example`],`curl-example`,`text`),description:d(l.description,`description`,`text`),enable:l.enable,headers:d(l.headers,`headers`,`text`),js_example:d(l[`js-example`],`js-example`,`text`),link:d(l.link,`link`,`text`),logo:d(l.logo,`logo`,`text`),name:d(l.name,`name`,`text`),position:l.position,slug:d(l.slug,`slug`,`text`)}):c(l.body),sensitiveBodyPaths:[[`headers`]]});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.aiGateway.customProviders.update({...e,account_id:f,id:l.id}));i(t,{successLabel:`Updated`});return}let p=u({base_url:d(l[`base-url`],`base-url`,`text`),beta:l.beta,curl_example:d(l[`curl-example`],`curl-example`,`text`),description:d(l.description,`description`,`text`),enable:l.enable,headers:d(l.headers,`headers`,`text`),js_example:d(l[`js-example`],`js-example`,`text`),link:d(l.link,`link`,`text`),logo:d(l.logo,`logo`,`text`),name:d(l.name,`name`,`text`),position:l.position,slug:d(l.slug,`slug`,`text`)}),m=await o(`Updating`,async()=>s.aiGateway.customProviders.update({...p,account_id:f,id:l.id}));i(m,{successLabel:`Updated`})})},M={command:`custom-providers`,describe:`Manage account-level custom AI providers and their endpoint settings`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.usage(`$0 ai-gateway dynamic-routing create <gateway-id>
|
|
23
|
+
|
|
24
|
+
Creates a dynamic route on an AI Gateway from the specified routing elements. Clients call the route by using \`dynamic/{name}\` as the model name.`).positional(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <gateway-id>`,describe:`Create a dynamic route`,builder:N,handler:async p=>s({command:`ai-gateway dynamic-routing create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${p[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(p[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(p[`gateway-id`]??``)},bodyKind:`json`,body:p.body===void 0?u({elements:l(p.elements,`elements`),name:d(p.name,`name`,`text`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body),t=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.create({...e,account_id:m,gateway_id:p[`gateway-id`]}));i(t,{successLabel:`Created`});return}if(p.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);p.name===void 0&&(p.name=await f(`name`,`The name field`));let h=u({elements:l(p.elements,`elements`),name:d(p.name,`name`,`text`)}),g=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.create({...h,account_id:m,gateway_id:p[`gateway-id`]}));i(g,{successLabel:`Created`})})};function F(e){return e.usage(`$0 ai-gateway dynamic-routing delete <id>
|
|
25
|
+
|
|
26
|
+
Deletes a dynamic route from an AI Gateway.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const I={command:`delete <id>`,describe:`Delete a dynamic route`,builder:F,handler:async c=>s({command:`ai-gateway dynamic-routing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}let u=await o(`Deleting`,async()=>s.aiGateway.dynamicRouting.delete({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Deleted`})})};function L(e){return e.usage(`$0 ai-gateway dynamic-routing deployments create <id>
|
|
28
|
+
|
|
29
|
+
Deploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id 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 R={command:`create <id>`,describe:`Deploy a dynamic route version`,builder:L,handler:async l=>s({command:`ai-gateway dynamic-routing deployments create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/routes/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/deployments`,pathParams:{"gateway-id":String(l[`gateway-id`]??``),id:String(l.id??``)},bodyKind:`json`,body:l.body===void 0?u({version_id:d(l[`version-id`],`version-id`,`text`)}):c(l.body)});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.deployments.create({...e,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(t,{successLabel:`Created`});return}l[`version-id`]===void 0&&(l[`version-id`]=await f(`version-id`,`The version_id field`));let m=u({version_id:d(l[`version-id`],`version-id`,`text`)}),h=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.deployments.create({...m,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(h,{successLabel:`Created`})})};function z(e){return e.usage(`$0 ai-gateway dynamic-routing deployments list
|
|
30
|
+
|
|
31
|
+
Lists the deployment history of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List dynamic route deployments`,builder:z,handler:async c=>s({command:`ai-gateway dynamic-routing deployments list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/deployments`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.dynamicRouting.deployments.list({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})},V={command:`deployments`,describe:`Deploy dynamic route versions and view deployment history`,builder:e=>e.command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.usage(`$0 ai-gateway dynamic-routing get <id>
|
|
32
|
+
|
|
33
|
+
Retrieves a dynamic route with its routing elements, active version, and current deployment.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <id>`,describe:`Get a dynamic route`,builder:H,handler:async c=>s({command:`ai-gateway dynamic-routing get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.dynamicRouting.get({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})};function W(e){return e.usage(`$0 ai-gateway dynamic-routing list
|
|
34
|
+
|
|
35
|
+
Lists the dynamic routes configured on an AI Gateway.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of routes per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List dynamic routes`,builder:W,handler:async c=>s({command:`ai-gateway dynamic-routing list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.dynamicRouting.list({account_id:u,gateway_id:c[`gateway-id`],...s}));i(d,{successLabel:`Loaded`})})};function K(e){return e.usage(`$0 ai-gateway dynamic-routing update <id>
|
|
36
|
+
|
|
37
|
+
Updates the name of a dynamic route. To change routing behaviour, create and deploy a new version.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`update <id>`,describe:`Rename a dynamic route`,builder:K,handler:async l=>s({command:`ai-gateway dynamic-routing update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/routes/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{"gateway-id":String(l[`gateway-id`]??``),id:String(l.id??``)},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.aiGateway.dynamicRouting.update({...e,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(t,{successLabel:`Updated`});return}l.name===void 0&&(l.name=await f(`name`,`The name field`));let m=u({name:d(l.name,`name`,`text`)}),h=await o(`Updating`,async()=>s.aiGateway.dynamicRouting.update({...m,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(h,{successLabel:`Updated`})})};function J(e){return e.usage(`$0 ai-gateway dynamic-routing versions create <id>
|
|
38
|
+
|
|
39
|
+
Creates a new version of a dynamic route from the specified routing elements. The version does not serve traffic until you deploy it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. 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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create <id>`,describe:`Create a dynamic route version`,builder:J,handler:async d=>s({command:`ai-gateway dynamic-routing versions create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${d[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(d[`gateway-id`]))}/routes/${d.id==null?`<id>`:encodeURIComponent(String(d.id))}/versions`,pathParams:{"gateway-id":String(d[`gateway-id`]??``),id:String(d.id??``)},bodyKind:`json`,body:d.body===void 0?u({elements:l(d.elements,`elements`)}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.versions.create({...e,account_id:f,gateway_id:d[`gateway-id`],id:d.id}));i(t,{successLabel:`Created`});return}if(d.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);let p=u({elements:l(d.elements,`elements`)}),m=await o(`Creating`,async()=>s.aiGateway.dynamicRouting.versions.create({...p,account_id:f,gateway_id:d[`gateway-id`],id:d.id}));i(m,{successLabel:`Created`})})};function X(e){return e.usage(`$0 ai-gateway dynamic-routing versions get <version-id>
|
|
40
|
+
|
|
41
|
+
Retrieves a saved version of a dynamic route, including its routing elements.`).positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <version-id>`,describe:`Get a dynamic route version`,builder:X,handler:async c=>s({command:`ai-gateway dynamic-routing versions get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/versions/${c[`version-id`]==null?`<version-id>`:encodeURIComponent(String(c[`version-id`]))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``),"version-id":String(c[`version-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.dynamicRouting.versions.get({account_id:l,gateway_id:c[`gateway-id`],id:c.id,version_id:c[`version-id`]}));i(u,{successLabel:`Loaded`})})};function Q(e){return e.usage(`$0 ai-gateway dynamic-routing versions list
|
|
42
|
+
|
|
43
|
+
Lists the saved versions of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`List dynamic route versions`,builder:Q,handler:async c=>s({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway dynamic-routing versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/routes/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/versions`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.dynamicRouting.versions.list({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})},re={command:`versions`,describe:`Create and inspect saved versions of a dynamic route`,builder:e=>e.command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(P).command(I).command(U).command(G).command(q).command(V).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 ai-gateway gateways create
|
|
44
|
+
|
|
45
|
+
Creates an AI Gateway in the account with the specified caching, rate limiting, logging, and authentication settings. The gateway ID appears in request URLs and must be unique within the account.`).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`]}).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).option(`id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`}).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`]}).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`]}).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).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(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).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`],default:`postpaid`}).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`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`].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 oe={command:`create`,describe:`Create a gateway`,builder:ae,handler:async p=>s({command:`ai-gateway gateways create`,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(`.`)}},p,async()=>{if(p.dryRun){let e=await n();a({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({authentication:p.authentication,byok_only:p[`byok-only`],cache_invalidate_on_update:p[`cache-invalidate-on-update`],cache_ttl:p[`cache-ttl`],collect_logs:p[`collect-logs`],guardrails:{prompt:{P1:d(p[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:d(p[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:d(p[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:d(p[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:d(p[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:d(p[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:d(p[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:d(p[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:d(p[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:d(p[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:d(p[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:d(p[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:d(p[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:d(p[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:d(p[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:d(p[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:d(p[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:d(p[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:d(p[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:d(p[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:d(p[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:d(p[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:d(p[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:d(p[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:d(p[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:d(p[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:d(p[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:d(p[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},id:d(p.id,`id`,`text`),log_classification:p[`log-classification`],log_management:p[`log-management`],log_management_strategy:d(p[`log-management-strategy`],`log-management-strategy`,`text`),logpush:p.logpush,logpush_public_key:d(p[`logpush-public-key`],`logpush-public-key`,`text`),otel:l(p.otel,`otel`),rate_limiting_interval:p[`rate-limiting-interval`],rate_limiting_limit:p[`rate-limiting-limit`],rate_limiting_technique:d(p[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:d(p[`retry-backoff`],`retry-backoff`,`text`),retry_delay:p[`retry-delay`],retry_max_attempts:p[`retry-max-attempts`],spend_limits:{enabled:p[`spend-limits-enabled`]},store_id:d(p[`store-id`],`store-id`,`text`),stripe:{authorization:d(p[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:d(p[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:p.zdr}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body),t=await o(`Creating`,async()=>s.aiGateway.gateways.create({...e,account_id:m}));i(t,{successLabel:`Created`});return}if(p[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(p[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(p[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(p.id===void 0&&(p.id=await f(`id`,`Unique identifier of the AI Gateway within the account.`)),p[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(p[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let h=u({authentication:p.authentication,byok_only:p[`byok-only`],cache_invalidate_on_update:p[`cache-invalidate-on-update`],cache_ttl:p[`cache-ttl`],collect_logs:p[`collect-logs`],guardrails:{prompt:{P1:d(p[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:d(p[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:d(p[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:d(p[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:d(p[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:d(p[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:d(p[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:d(p[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:d(p[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:d(p[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:d(p[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:d(p[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:d(p[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:d(p[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:d(p[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:d(p[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:d(p[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:d(p[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:d(p[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:d(p[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:d(p[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:d(p[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:d(p[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:d(p[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:d(p[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:d(p[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:d(p[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:d(p[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},id:d(p.id,`id`,`text`),log_classification:p[`log-classification`],log_management:p[`log-management`],log_management_strategy:d(p[`log-management-strategy`],`log-management-strategy`,`text`),logpush:p.logpush,logpush_public_key:d(p[`logpush-public-key`],`logpush-public-key`,`text`),otel:l(p.otel,`otel`),rate_limiting_interval:p[`rate-limiting-interval`],rate_limiting_limit:p[`rate-limiting-limit`],rate_limiting_technique:d(p[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:d(p[`retry-backoff`],`retry-backoff`,`text`),retry_delay:p[`retry-delay`],retry_max_attempts:p[`retry-max-attempts`],spend_limits:{enabled:p[`spend-limits-enabled`]},store_id:d(p[`store-id`],`store-id`,`text`),stripe:{authorization:d(p[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:d(p[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:p.zdr}),g=await o(`Creating`,async()=>s.aiGateway.gateways.create({...h,account_id:m}));i(g,{successLabel:`Created`})})};function se(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
|
|
46
|
+
|
|
47
|
+
Permanently deletes an AI Gateway, its configuration, and its stored logs.`).positional(`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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ce={command:`delete <gateway-id>`,describe:`Delete a gateway`,builder:se,handler:async c=>s({command:`ai-gateway gateways delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force,message:`This permanently deletes the gateway, its configuration, and its stored logs. Requests sent to this gateway will fail. This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
48
|
+
`);return}let u=await o(`Deleting`,async()=>s.aiGateway.gateways.delete({account_id:l,"gateway-id":c[`gateway-id`]}));i(u,{successLabel:`Deleted`})})};function le(e){return e.usage(`$0 ai-gateway gateways get-url <provider>
|
|
49
|
+
|
|
50
|
+
Retrieves the endpoint URL for an AI Gateway.`).positional(`provider`,{type:`string`,description:`Provider`,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 ue={command:`get-url <provider>`,describe:`Get Gateway URL`,builder:le,handler:async c=>s({command:`ai-gateway gateways get-url`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways get-url`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/url/${c.provider==null?`<provider>`:encodeURIComponent(String(c.provider))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),provider:String(c.provider??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.gateways.getUrl({account_id:l,gateway_id:c[`gateway-id`],provider:c.provider}));i(u,{successLabel:`Loaded`})})};function de(e){return e.usage(`$0 ai-gateway gateways get <gateway-id>
|
|
51
|
+
|
|
52
|
+
Retrieves the configuration of an AI Gateway.`).positional(`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 fe={command:`get <gateway-id>`,describe:`Get a gateway`,builder:de,handler:async c=>s({command:`ai-gateway gateways get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.gateways.get({account_id:l,"gateway-id":c[`gateway-id`]}));i(u,{successLabel:`Loaded`})})};function pe(e){return e.usage(`$0 ai-gateway gateways list
|
|
53
|
+
|
|
54
|
+
Lists the AI Gateways in the account. Use \`search\` to filter by gateway ID.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`List gateways`,builder:pe,handler:async c=>s({command:`ai-gateway gateways list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],search:c.search};if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.gateways.list({account_id:u,...s}));i(d,{successLabel:`Loaded`})})};function he(e){return e.usage(`$0 ai-gateway gateways providers create <gateway-id>
|
|
55
|
+
|
|
56
|
+
Stores an upstream AI provider API key for an AI Gateway in the Secrets Store configured on the gateway, with an optional rate limit. Pass \`secret\` to store a new key, or omit it to use an existing Secrets Store secret.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`alias`,{type:`string`,description:`The alias field`}).option(`default-config`,{type:`boolean`,description:`The default_config field`}).option(`provider-slug`,{type:`string`,description:`The provider_slug field`}).option(`rate-limit`,{type:`number`,description:`The rate_limit field`}).option(`rate-limit-period`,{type:`number`,description:`The rate_limit_period field`,default:60}).option(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).option(`secret-id`,{type:`string`,description:`The secret_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`create <gateway-id>`,describe:`Store a provider key`,builder:he,handler:async l=>s({command:`ai-gateway gateways providers create`,classification:{safeFlags:[`default-config`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway gateways providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(l[`gateway-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({alias:d(l.alias,`alias`,`text`),default_config:l[`default-config`],provider_slug:d(l[`provider-slug`],`provider-slug`,`text`),rate_limit:l[`rate-limit`],rate_limit_period:l[`rate-limit-period`],secret:d(l.secret,`secret`,`text`),secret_id:d(l[`secret-id`],`secret-id`,`text`)}):c(l.body),sensitiveBodyPaths:[[`secret`]]});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.aiGateway.gateways.providers.create({...e,account_id:p,gateway_id:l[`gateway-id`]}));i(t,{successLabel:`Created`});return}if(l.alias===void 0&&(l.alias=await f(`alias`,`The alias field`)),l[`default-config`]===void 0)throw Error(`--default-config is required (or pass --body with this field set).`);l[`provider-slug`]===void 0&&(l[`provider-slug`]=await f(`provider-slug`,`The provider_slug field`));let m=u({alias:d(l.alias,`alias`,`text`),default_config:l[`default-config`],provider_slug:d(l[`provider-slug`],`provider-slug`,`text`),rate_limit:l[`rate-limit`],rate_limit_period:l[`rate-limit-period`],secret:d(l.secret,`secret`,`text`),secret_id:d(l[`secret-id`],`secret-id`,`text`)}),h=await o(`Creating`,async()=>s.aiGateway.gateways.providers.create({...m,account_id:p,gateway_id:l[`gateway-id`]}));i(h,{successLabel:`Created`})})};function _e(e){return e.usage(`$0 ai-gateway gateways providers delete <id>
|
|
57
|
+
|
|
58
|
+
Deletes a provider key configuration from an AI Gateway and deletes its secret from the Secrets Store.`).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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ve={command:`delete <id>`,describe:`Delete a provider key`,builder:_e,handler:async c=>s({command:`ai-gateway gateways providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/provider_configs/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force,message:`This deletes the stored provider key and its Secrets Store secret. Requests that rely on this key will stop authenticating with it.`})){process.stderr.write(`Aborted.
|
|
59
|
+
`);return}let u=await o(`Deleting`,async()=>s.aiGateway.gateways.providers.delete({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Deleted`})})};function ye(e){return e.usage(`$0 ai-gateway gateways providers get <id>
|
|
60
|
+
|
|
61
|
+
Retrieves a provider key configuration for an AI Gateway. The response shows a masked preview of the key, never the key itself.`).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 be={command:`get <id>`,describe:`Get a provider key`,builder:ye,handler:async c=>s({command:`ai-gateway gateways providers get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/provider_configs/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{"gateway-id":String(c[`gateway-id`]??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.gateways.providers.get({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})};function xe(e){return e.usage(`$0 ai-gateway gateways providers list
|
|
62
|
+
|
|
63
|
+
Lists the provider keys stored for an AI Gateway. Responses show a masked preview of each key, never the key itself.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List provider keys`,builder:xe,handler:async c=>s({command:`ai-gateway gateways providers list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){let e=await n();a({command:`cf ai-gateway gateways providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.gateways.providers.list({account_id:u,gateway_id:c[`gateway-id`],...s}));i(d,{successLabel:`Loaded`})})};function Ce(e){return e.usage(`$0 ai-gateway gateways providers update <id>
|
|
64
|
+
|
|
65
|
+
Replaces the stored API key of a provider key configuration. Only the key can change.`).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(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).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 we={command:`update <id>`,describe:`Rotate a provider key`,builder:Ce,handler:async l=>s({command:`ai-gateway gateways providers update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway gateways providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/provider_configs/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{"gateway-id":String(l[`gateway-id`]??``),id:String(l.id??``)},bodyKind:`json`,body:l.body===void 0?u({secret:d(l.secret,`secret`,`text`)}):c(l.body),sensitiveBodyPaths:[[`secret`]]});return}let s=await t(l),p=l.local?e:await r();if(l.accountId=p,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.aiGateway.gateways.providers.update({...e,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(t,{successLabel:`Updated`});return}l.secret===void 0&&(l.secret=await f(`secret`,`Provider API key to store in the Secrets Store configured on the gateway.`,{kind:`secret`}));let m=u({secret:d(l.secret,`secret`,`text`)}),h=await o(`Updating`,async()=>s.aiGateway.gateways.providers.update({...m,account_id:p,gateway_id:l[`gateway-id`],id:l.id}));i(h,{successLabel:`Updated`})})},Te={command:`providers`,describe:`Store and rotate upstream AI provider keys for a gateway`,builder:e=>e.command(ge).command(ve).command(be).command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.usage(`$0 ai-gateway gateways update <gateway-id>
|
|
66
|
+
|
|
67
|
+
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`]}).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).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`]}).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`]}).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).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(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).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`]}).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`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`].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 De={command:`update <gateway-id>`,describe:`Update a gateway`,builder:Ee,handler:async f=>s({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(`.`)}},f,async()=>{if(f.dryRun){let e=await n();a({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${f[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(f[`gateway-id`]))}`,pathParams:{"gateway-id":String(f[`gateway-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({authentication:f.authentication,byok_only:f[`byok-only`],cache_invalidate_on_update:f[`cache-invalidate-on-update`],cache_ttl:f[`cache-ttl`],collect_logs:f[`collect-logs`],guardrails:{prompt:{P1:d(f[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:d(f[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:d(f[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:d(f[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:d(f[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:d(f[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:d(f[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:d(f[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:d(f[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:d(f[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:d(f[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:d(f[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:d(f[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:d(f[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:d(f[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:d(f[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:d(f[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:d(f[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:d(f[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:d(f[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:d(f[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:d(f[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:d(f[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:d(f[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:d(f[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:d(f[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:d(f[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:d(f[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:f[`log-classification`],log_management:f[`log-management`],log_management_strategy:d(f[`log-management-strategy`],`log-management-strategy`,`text`),logpush:f.logpush,logpush_public_key:d(f[`logpush-public-key`],`logpush-public-key`,`text`),otel:l(f.otel,`otel`),rate_limiting_interval:f[`rate-limiting-interval`],rate_limiting_limit:f[`rate-limiting-limit`],rate_limiting_technique:d(f[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:d(f[`retry-backoff`],`retry-backoff`,`text`),retry_delay:f[`retry-delay`],retry_max_attempts:f[`retry-max-attempts`],spend_limits:{enabled:f[`spend-limits-enabled`]},store_id:d(f[`store-id`],`store-id`,`text`),stripe:{authorization:d(f[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:d(f[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:f.zdr}):c(f.body)});return}let s=await t(f),p=f.local?e:await r();if(f.accountId=p,f.body){let e=c(f.body),t=await o(`Updating`,async()=>s.aiGateway.gateways.update({...e,account_id:p,"gateway-id":f[`gateway-id`]}));i(t,{successLabel:`Updated`});return}if(f[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(f[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(f[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(f[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(f[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let m=u({authentication:f.authentication,byok_only:f[`byok-only`],cache_invalidate_on_update:f[`cache-invalidate-on-update`],cache_ttl:f[`cache-ttl`],collect_logs:f[`collect-logs`],guardrails:{prompt:{P1:d(f[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:d(f[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:d(f[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:d(f[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:d(f[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:d(f[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:d(f[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:d(f[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:d(f[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:d(f[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:d(f[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:d(f[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:d(f[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:d(f[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:d(f[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:d(f[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:d(f[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:d(f[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:d(f[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:d(f[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:d(f[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:d(f[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:d(f[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:d(f[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:d(f[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:d(f[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:d(f[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:d(f[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:f[`log-classification`],log_management:f[`log-management`],log_management_strategy:d(f[`log-management-strategy`],`log-management-strategy`,`text`),logpush:f.logpush,logpush_public_key:d(f[`logpush-public-key`],`logpush-public-key`,`text`),otel:l(f.otel,`otel`),rate_limiting_interval:f[`rate-limiting-interval`],rate_limiting_limit:f[`rate-limiting-limit`],rate_limiting_technique:d(f[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:d(f[`retry-backoff`],`retry-backoff`,`text`),retry_delay:f[`retry-delay`],retry_max_attempts:f[`retry-max-attempts`],spend_limits:{enabled:f[`spend-limits-enabled`]},store_id:d(f[`store-id`],`store-id`,`text`),stripe:{authorization:d(f[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:d(f[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:f.zdr}),h=await o(`Updating`,async()=>s.aiGateway.gateways.update({...m,account_id:p,"gateway-id":f[`gateway-id`]}));i(h,{successLabel:`Updated`})})},Oe={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(oe).command(ce).command(fe).command(ue).command(me).command(De).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
|
|
68
|
+
|
|
69
|
+
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 Ae={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:m(ke),handler:async c=>s({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={order_by:c[`order-by`],order_by_direction:c[`order-by-direction`],filters:c.filters,limit:c.limit};if(c.dryRun){let e=await n();a({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();if(c.accountId=u,!await p({force:!!c.force,message:`This permanently deletes every stored log entry on the gateway that matches the filters. Deleted logs cannot be recovered.`})){process.stderr.write(`Aborted.
|
|
70
|
+
`);return}let d=await o(`Deleting`,async()=>l.aiGateway.logs.delete({account_id:u,gateway_id:c[`gateway-id`],...s}));i(d,{successLabel:`Deleted`})})};function je(e){return e.usage(`$0 ai-gateway logs get-request <id>
|
|
71
|
+
|
|
72
|
+
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 Me={command:`get-request <id>`,describe:`Get Gateway Log Request`,builder:je,handler:async c=>s({command:`ai-gateway logs get-request`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway logs get-request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/logs/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/request`,pathParams:{id:String(c.id??``),"gateway-id":String(c[`gateway-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.logs.getRequest({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})};function Ne(e){return e.usage(`$0 ai-gateway logs get-response <id>
|
|
73
|
+
|
|
74
|
+
Retrieves the response 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 Pe={command:`get-response <id>`,describe:`Get Gateway Log Response`,builder:Ne,handler:async c=>s({command:`ai-gateway logs get-response`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway logs get-response`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/logs/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/response`,pathParams:{id:String(c.id??``),"gateway-id":String(c[`gateway-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.logs.getResponse({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 ai-gateway logs get <id>
|
|
75
|
+
|
|
76
|
+
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 Fe={command:`get <id>`,describe:`Get Gateway Log Detail`,builder:$,handler:async c=>s({command:`ai-gateway logs get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/logs/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``),"gateway-id":String(c[`gateway-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.aiGateway.logs.get({account_id:l,gateway_id:c[`gateway-id`],id:c.id}));i(u,{successLabel:`Loaded`})})};function Ie(e){return e.usage(`$0 ai-gateway logs list
|
|
77
|
+
|
|
78
|
+
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`]}).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(`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 Le={command:`list`,describe:`List Gateway Logs`,builder:m(Ie),handler:async c=>s({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},c,async()=>{let s={search:c.search,page:c.page,per_page:c[`per-page`],order_by:c[`order-by`],order_by_direction:c[`order-by-direction`],filters:c.filters,meta_info:c[`meta-info`],direction:c.direction,start_date:c[`start-date`],end_date:c[`end-date`],min_cost:c[`min-cost`],max_cost:c[`max-cost`],min_tokens_in:c[`min-tokens-in`],max_tokens_in:c[`max-tokens-in`],min_tokens_out:c[`min-tokens-out`],max_tokens_out:c[`max-tokens-out`],min_total_tokens:c[`min-total-tokens`],max_total_tokens:c[`max-total-tokens`],min_duration:c[`min-duration`],max_duration:c[`max-duration`],feedback:c.feedback,success:c.success,cached:c.cached,model:c.model,model_type:c[`model-type`],provider:c.provider,request_content_type:c[`request-content-type`],response_content_type:c[`response-content-type`]};if(c.dryRun){let e=await n();a({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${c[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(c[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(c[`gateway-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.aiGateway.logs.list({account_id:u,gateway_id:c[`gateway-id`],...s}));i(d,{successLabel:`Loaded`})})};function Re(e){return e.usage(`$0 ai-gateway logs update <id>
|
|
79
|
+
|
|
80
|
+
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(`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 ze={command:`update <id>`,describe:`Patch Gateway Log`,builder:Re,handler:async l=>s({command:`ai-gateway logs update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf ai-gateway logs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/logs/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{id:String(l.id??``),"gateway-id":String(l[`gateway-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({feedback:l.feedback,score:l.score}):c(l.body)});return}let s=await t(l),d=l.local?e:await r();if(l.accountId=d,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.aiGateway.logs.update({...e,account_id:d,gateway_id:l[`gateway-id`],id:l.id}));i(t,{successLabel:`Updated`});return}let f=u({feedback:l.feedback,score:l.score}),p=await o(`Updating`,async()=>s.aiGateway.logs.update({...f,account_id:d,gateway_id:l[`gateway-id`],id:l.id}));i(p,{successLabel:`Updated`})})},Be={command:`logs`,describe:`Inspect, annotate, and delete gateway request logs stored by Legacy Logs`,builder:e=>e.command(Ae).command(Fe).command(Me).command(Pe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ve={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(x).command(M).command(ie).command(Oe).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ve as default};
|