cf 1.0.0-beta.8 → 1.0.0-beta.9
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 +546 -25
- package/dist/_meta/schemas.json +400 -1
- package/dist/{abuse-reports-D9LttL99.mjs → abuse-reports-LBVv-g3M.mjs} +1 -1
- package/dist/{access-CSUG9fDH.mjs → access-lTeHFhwl.mjs} +1 -1
- package/dist/{account-tags-BkmuF6bd.mjs → account-tags-BJOkTRcJ.mjs} +1 -1
- package/dist/{accounts-CmqKD3xG.mjs → accounts-CxfmZ26h.mjs} +1 -1
- package/dist/{acm-D9WirG6Y.mjs → acm-Lwxk9U-L.mjs} +1 -1
- package/dist/{addressing-DAdzF3M5.mjs → addressing-C4Y5vVvy.mjs} +1 -1
- package/dist/{agent-memory-CIEk0dD-.mjs → agent-memory-DD0BUFmc.mjs} +1 -1
- package/dist/{ai-Dq1GOYn7.mjs → ai-D9GX6Huo.mjs} +1 -1
- package/dist/{ai-audit-D5XtqDkx.mjs → ai-audit-COn-Iiyc.mjs} +1 -1
- package/dist/{ai-gateway-D16_7Zbq.mjs → ai-gateway-CYMqceyk.mjs} +16 -14
- package/dist/{ai-search-Ce3p9ccc.mjs → ai-search-DbpDgJAl.mjs} +1 -1
- package/dist/{ai-security-BodoNshv.mjs → ai-security-bRPA5p1v.mjs} +1 -1
- package/dist/{alerting-DuF0tdhO.mjs → alerting-Bo1lxRbE.mjs} +1 -1
- package/dist/{analytics-DmnqxoBT.mjs → analytics-85GRwRHh.mjs} +4 -5
- package/dist/{analytics_engine-BOYHgzoX.mjs → analytics_engine-DgSsozQ2.mjs} +1 -1
- package/dist/{api-security-B3v-EKrg.mjs → api-security-B0Y0gif0.mjs} +1 -1
- package/dist/{argo-BsSvWev6.mjs → argo-BFxaIesT.mjs} +1 -1
- package/dist/{artifacts-Dq5t2ZQO.mjs → artifacts-DicFDolv.mjs} +2 -2
- package/dist/{audit-logs-DpszUSNO.mjs → audit-logs-DN1mQRY_.mjs} +1 -1
- package/dist/{auth-BjxUTZWb.mjs → auth-C_-fMmUL.mjs} +2 -2
- package/dist/{auth-skaSvH3I.mjs → auth-CeiDicp4.mjs} +1 -1
- package/dist/{autoconfig-DXXV-Xyz.mjs → autoconfig-DPUztTL2.mjs} +1 -1
- package/dist/{basin-catalog-c_Z-KmdC.mjs → basin-catalog-CLd6aFV_.mjs} +1 -1
- package/dist/{billing-D8eSkPUk.mjs → billing-sbqGqYgk.mjs} +1 -1
- package/dist/{bot-management-gPqJF81w.mjs → bot-management-BDZwYRbv.mjs} +1 -1
- package/dist/{botnet-feed-B1TeX5OO.mjs → botnet-feed-BDs84Rk7.mjs} +1 -1
- package/dist/{brand-protection-jjdTCYeF.mjs → brand-protection-D4-67mgV.mjs} +1 -1
- package/dist/{browser-run-CkmofJ6D.mjs → browser-run-Cw4OgHMC.mjs} +1 -1
- package/dist/{build-B-tN7mO-.mjs → build-B5UYMEQH.mjs} +1 -1
- package/dist/build-DLZ9gBNA.mjs +2 -0
- package/dist/{builds-Ca9hPvgz.mjs → builds-CdS0Jjme.mjs} +1 -1
- package/dist/{cache-BnRnlPjP.mjs → cache-574Higpi.mjs} +1 -1
- package/dist/{certificate-authorities-D2J5rh-m.mjs → certificate-authorities-RpWY-yHx.mjs} +1 -1
- package/dist/{cli-xbKU3h28.mjs → cli-CIu0GeU7.mjs} +1 -1
- package/dist/{client-certificates-D3mKJGFa.mjs → client-certificates-C-aZxVUT.mjs} +1 -1
- package/dist/{client-side-security-DcO8apX2.mjs → client-side-security-ChUBdwcX.mjs} +1 -1
- package/dist/{cloud-connector-CCbT4xFi.mjs → cloud-connector-DTHuCkjj.mjs} +1 -1
- package/dist/{cloudforce-one-Cnj0OnZF.mjs → cloudforce-one-DiOsWYK2.mjs} +1 -1
- package/dist/{command-BxrOxsu9.mjs → command-4-_i7Drg.mjs} +1 -1
- package/dist/{command-8lsstsSi.mjs → command-BCag-xjk.mjs} +1 -1
- package/dist/{command-_4j_XD3U.mjs → command-BLJaqN2i.mjs} +1 -1
- package/dist/{command-BUWmTl5w.mjs → command-BS0D67wS.mjs} +1 -1
- package/dist/{command-CwsA28Vt.mjs → command-Bp-Ono5h.mjs} +1 -1
- package/dist/{command-D5vy9tlg.mjs → command-DFPF1MDP.mjs} +1 -1
- package/dist/{command-CUQF-QFP.mjs → command-DPZl5lDW.mjs} +1 -1
- package/dist/{command-CvzUv83h.mjs → command-DUafPVUr.mjs} +1 -1
- package/dist/{command-BtmIP6e1.mjs → command-DfffeX-k.mjs} +1 -1
- package/dist/{command-BvwvCWkB.mjs → command-DmCeLhAR.mjs} +1 -1
- package/dist/{command-BDCTd8Ra.mjs → command-DzHL5LKI.mjs} +1 -1
- package/dist/{command-BWUoVso3.mjs → command-HpcRetCI.mjs} +1 -1
- package/dist/{command-DwbJIcAA.mjs → command-qX0mcMdJ.mjs} +1 -1
- package/dist/{command-B9rrie65.mjs → command-siVEvKhD.mjs} +1 -1
- package/dist/{completions-EHied_ON.mjs → completions-Ksnj6C10.mjs} +1 -1
- package/dist/{connector-interrupts-CyeiC7gw.mjs → connector-interrupts-BMVVtRoe.mjs} +1 -1
- package/dist/{connector-telemetry-events-D-cL2RuW.mjs → connector-telemetry-events-BVIKzaGu.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-MrpBZ5fC.mjs → connector-telemetry-snapshots-ChUsGxJA.mjs} +1 -1
- package/dist/{connectors-Ds5PWdpP.mjs → connectors-v5tsuazm.mjs} +1 -1
- package/dist/{containers-D9masRwv.mjs → containers-CkVjC4WK.mjs} +1 -1
- package/dist/{containers-BR6paNcL.mjs → containers-D2NT0_6_.mjs} +1 -1
- package/dist/{content-scan-eX3wIB8J.mjs → content-scan-BhPn2Ri6.mjs} +1 -1
- package/dist/{context-M2Ho8pi3.mjs → context-Cibc7DIM.mjs} +1 -1
- package/dist/{cps-CyviY22M.mjs → cps-DjsEAp0Y.mjs} +1 -1
- package/dist/{csamScanner-CHF53DZw.mjs → csamScanner-NxvG2dHV.mjs} +1 -1
- package/dist/{ct-alerting-BORxnBtn.mjs → ct-alerting-Bx2UZEx6.mjs} +1 -1
- package/dist/{custom-certificates-KsS8xnfG.mjs → custom-certificates-nNHIgfAg.mjs} +1 -1
- package/dist/{custom-csrs-BtNQaSVn.mjs → custom-csrs-CWQYjo1J.mjs} +1 -1
- package/dist/{custom-hostnames-4tLpHtCK.mjs → custom-hostnames-Ba-AX6GI.mjs} +1 -1
- package/dist/{custom-nameservers-DYM29vGA.mjs → custom-nameservers-CBYeF3EA.mjs} +1 -1
- package/dist/{custom-pages-BIwM1IyN.mjs → custom-pages-B8npWgUd.mjs} +1 -1
- package/dist/{d1-Yhj_t0--.mjs → d1-C1jAzZdm.mjs} +1 -1
- package/dist/{dcv-delegation-DXspPfEr.mjs → dcv-delegation-BcWil-n0.mjs} +1 -1
- package/dist/{deploy-su0BR90P.mjs → deploy-C1YhIsYf.mjs} +1 -1
- package/dist/{deploy-input-DJWWJs3a.mjs → deploy-input-DTjBGloL.mjs} +1 -1
- package/dist/{dev-DqgkwmRH.mjs → dev-BML-bpNU.mjs} +1 -1
- package/dist/{diagnostics-B6FqDbQY.mjs → diagnostics-Dhv2hv7H.mjs} +1 -1
- package/dist/discover-DwczTkRX.mjs +2 -0
- package/dist/{dist-CxGYQfpW.mjs → dist-BOwFXRl5.mjs} +1 -1
- package/dist/{dls-CDvZjyjo.mjs → dls-D1r38j3_.mjs} +1 -1
- package/dist/{dns-DGMcGcBE.mjs → dns-BRFzX8NU.mjs} +1 -1
- package/dist/{dns-firewall-BahlWOJO.mjs → dns-firewall-DtLBYFPM.mjs} +1 -1
- package/dist/{durable-objects-Cnho3J7w.mjs → durable-objects-C2Aefs4L.mjs} +1 -1
- package/dist/{email-auth-CkqeIq8V.mjs → email-auth-YiFzQwVf.mjs} +1 -1
- package/dist/{email-routing-D_Mw8HSX.mjs → email-routing-z-z1rYZH.mjs} +1 -1
- package/dist/{email-security-D9yMRsXl.mjs → email-security-CGmTS-uF.mjs} +1 -1
- package/dist/{email-sending-CQfuE7h6.mjs → email-sending-D29kFQug.mjs} +1 -1
- package/dist/{error-sanitization-BXqhvJsR.mjs → error-sanitization-CJ5OLJrh.mjs} +1 -1
- package/dist/error-sanitization-hmi1CqE5.mjs +2 -0
- package/dist/{fieldExtractors-Bbbegy-c.mjs → fieldExtractors-pYznM75V.mjs} +1 -1
- package/dist/{firewall-DtlT_8mG.mjs → firewall-CZo7QDd9.mjs} +1 -1
- package/dist/{flagship-BWEdMJSQ.mjs → flagship-CXnjhYkL.mjs} +1 -1
- package/dist/{fraud-mszBJHV6.mjs → fraud-CSqdPZ71.mjs} +1 -1
- package/dist/generate-BPqoDbck.mjs +2 -0
- package/dist/{google-tag-gateway-DD8rztUs.mjs → google-tag-gateway-DX20Ia5e.mjs} +1 -1
- package/dist/{healthchecks-CzCJR3df.mjs → healthchecks-n2tjszDt.mjs} +1 -1
- package/dist/{hostnames-BTSxAv-T.mjs → hostnames-CCg1WdH6.mjs} +1 -1
- package/dist/{hyperdrive-Bg1T58qE.mjs → hyperdrive-GECLKycn.mjs} +1 -1
- package/dist/{iam-cAzxdXI7.mjs → iam-C4CHSG7c.mjs} +1 -1
- package/dist/{images-CfHt8v2n.mjs → images-6Cs-Feuz.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-9TwyFuzD.mjs → init-fa1wFHUX.mjs} +2 -2
- package/dist/{intel-WWPG0-t7.mjs → intel-DiCFqJET.mjs} +1 -1
- package/dist/{ips-CxSw5R88.mjs → ips-Bq1BTfPF.mjs} +1 -1
- package/dist/k2-BAQnWQIM.mjs +13 -0
- package/dist/{keyless-certificates-Jfsyada7.mjs → keyless-certificates-CZftNR60.mjs} +1 -1
- package/dist/{keys-BrDarg28.mjs → keys-BFqSZOfP.mjs} +1 -1
- package/dist/{kv-C8eauBSy.mjs → kv-Dpo1EtAM.mjs} +1 -1
- package/dist/{lazy-command-B0914_IJ.mjs → lazy-command-C8fVcK9z.mjs} +1 -1
- package/dist/{leaked-credential-checks-Y9mDSJKn.mjs → leaked-credential-checks-twflfhgD.mjs} +1 -1
- package/dist/{load-balancers-DsKJIF_U.mjs → load-balancers-DywhdyKf.mjs} +1 -1
- package/dist/{local-CQc36Viv.mjs → local-B5oRPTEN.mjs} +1 -1
- package/dist/local-Bj-l0TP6.mjs +2 -0
- package/dist/{local-runtime-CifOYlPq.mjs → local-runtime-CZnegFEM.mjs} +1 -1
- package/dist/{login-DGXSiCII.mjs → login-BWuV_6Ti.mjs} +1 -1
- package/dist/{login-DFZ3DEjI.mjs → login-CStejTNn.mjs} +1 -1
- package/dist/{logo-matches-D1vjZF-k.mjs → logo-matches-BbuNQTBr.mjs} +1 -1
- package/dist/{logos-CCEIMvE7.mjs → logos-mAj8GzO0.mjs} +1 -1
- package/dist/{logpush-DAx2y5MY.mjs → logpush-riOF9-YV.mjs} +1 -1
- package/dist/{logs-D9BsByMt.mjs → logs-DITH6eet.mjs} +1 -1
- package/dist/{magic-cloud-networking-C_FsIQoS.mjs → magic-cloud-networking-trqm-ciY.mjs} +1 -1
- package/dist/{magic-network-monitoring-DBo1mI3a.mjs → magic-network-monitoring-CF0uR3b_.mjs} +1 -1
- package/dist/{magic-transit-BgRq6ZeA.mjs → magic-transit-438AP90W.mjs} +1 -1
- package/dist/{managed-defense-BRdCrVVh.mjs → managed-defense-Criu9sDQ.mjs} +1 -1
- package/dist/{managed-transforms-cmvRuRQ7.mjs → managed-transforms-BdwEjDxz.mjs} +1 -1
- package/dist/{matches-B0bzP6tB.mjs → matches-DMLDhZbo.mjs} +1 -1
- package/dist/{mcp-CSxoAB-y.mjs → mcp-Caedd-uE.mjs} +1 -1
- package/dist/{mesh-C-n2gi4F.mjs → mesh-jh4ALI5y.mjs} +1 -1
- package/dist/{migrate-CipwWhJE.mjs → migrate-BJ9Go_wP.mjs} +1 -1
- package/dist/{monetization-DHFiy5qs.mjs → monetization-CgujyJxp.mjs} +1 -1
- package/dist/{mtls-certificates-o11WJKM1.mjs → mtls-certificates-B5b1_uyW.mjs} +1 -1
- package/dist/{network-Ck6XHs9j.mjs → network-CC3P2gHc.mjs} +1 -1
- package/dist/{network-interconnects-CT4a_D5b.mjs → network-interconnects-DOJI5uxJ.mjs} +1 -1
- package/dist/{oauth-D6EZEBcY.mjs → oauth-BYkPua5f.mjs} +1 -1
- package/dist/{oauth-D9jA6L9a.mjs → oauth-DrAKiya8.mjs} +1 -1
- package/dist/{oauth-clients-DRBvDDNL.mjs → oauth-clients-DxU4Eo_n.mjs} +1 -1
- package/dist/{oauth-scopes-eV0VbNV-.mjs → oauth-scopes-CgWZFINf.mjs} +1 -1
- package/dist/{observability-CBCuWCen.mjs → observability-D0CSfZP3.mjs} +1 -1
- package/dist/{organization-3y27rtm7.mjs → organization-432YJF6t.mjs} +1 -1
- package/dist/{organizations-Q9QPbB-p.mjs → organizations-DDTdCDHF.mjs} +1 -1
- package/dist/{origin-ca-certificates-CbTgmQ2N.mjs → origin-ca-certificates-Ky57Fh6y.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-D5zeAJJ1.mjs → origin-post-quantum-encryption-OIFZe2l_.mjs} +1 -1
- package/dist/{origin-tls-client-auth-V5hB1Bwu.mjs → origin-tls-client-auth-BfbHQSxd.mjs} +1 -1
- package/dist/{page-rules-BYYBcKRU.mjs → page-rules-DPbQjYvh.mjs} +1 -1
- package/dist/{pages-CfinrrWX.mjs → pages-CPcDlbnc.mjs} +1 -1
- package/dist/{pay-per-crawl-C-S5WxQT.mjs → pay-per-crawl-AWBV8rpZ.mjs} +1 -1
- package/dist/{pay-per-use-B3gl7GQo.mjs → pay-per-use-C8ZCkTrQ.mjs} +1 -1
- package/dist/{pipelines-lfvTXng7.mjs → pipelines-BWGZv1kD.mjs} +2 -2
- package/dist/{precursor-CNm5rIPl.mjs → precursor-DX32b7mu.mjs} +1 -1
- package/dist/{previews-DV7OxoSM.mjs → previews-B6xfp2lU.mjs} +1 -1
- package/dist/{progress-BnIv4lh5.mjs → progress-BtNgm5yx.mjs} +1 -1
- package/dist/{prompt-DjRAo2Up.mjs → prompt-CbKaAX24.mjs} +1 -1
- package/dist/{queries-D0obyA9I.mjs → queries-z5ok-W9I.mjs} +1 -1
- package/dist/{queues-G1CS4M1H.mjs → queues-BcCod15K.mjs} +1 -1
- package/dist/{r2-BLXUGlGq.mjs → r2--_Gw1ru7.mjs} +1 -1
- package/dist/{radar-hGFsVuHs.mjs → radar-CJonQ35E.mjs} +1 -1
- package/dist/{raw-fetch-CuMHmrn0.mjs → raw-fetch-CAZrlsc6.mjs} +1 -1
- package/dist/{realtime-CZYwfmjr.mjs → realtime-4WdJ83cQ.mjs} +1 -1
- package/dist/{registrar-dvv2gU93.mjs → registrar-14yKfqak.mjs} +1 -1
- package/dist/{registrar-sandbox-Cnqn9BDJ.mjs → registrar-sandbox-D53qdGoh.mjs} +1 -1
- package/dist/{reporting-Bfwnpc7z.mjs → reporting-ZQmJVXcc.mjs} +1 -1
- package/dist/{request-headers-DaUqNccK.mjs → request-headers-B72_sA_G.mjs} +1 -1
- package/dist/{request-tracers-CF4_bzqx.mjs → request-tracers-DAKyy7Om.mjs} +1 -1
- package/dist/{resource-sharing-DaY7ISTQ.mjs → resource-sharing-BLsx1Nmo.mjs} +1 -1
- package/dist/{resource-tagging-D669i7sI.mjs → resource-tagging-B6EReDYx.mjs} +1 -1
- package/dist/{rules-C9w-8uyl.mjs → rules-CbCrIq7Y.mjs} +1 -1
- package/dist/{rulesets-yYRTXZ71.mjs → rulesets-CyCCWsk4.mjs} +1 -1
- package/dist/{rum-DPrqqYSC.mjs → rum-Cyl674km.mjs} +1 -1
- package/dist/{run-Duj1fsxa.mjs → run-BqAAX99Z.mjs} +1 -1
- package/dist/run-DZYLWyvE.mjs +2 -0
- package/dist/{schema-flags-CK4J4XhG.mjs → schema-flags-CpW8oSUF.mjs} +1 -1
- package/dist/{scim-DAZek91U.mjs → scim-Cw0LvYqJ.mjs} +1 -1
- package/dist/{sdk-DzVznUuv.mjs → sdk-BCzcRJCi.mjs} +1 -1
- package/dist/{secrets-store-COlaXNll.mjs → secrets-store-Bxn1jdZE.mjs} +1 -1
- package/dist/{security-insights-DF6ffEWO.mjs → security-insights-BgI7_mM3.mjs} +1 -1
- package/dist/{security-txt-D1nLEOCZ.mjs → security-txt-B2FOknxR.mjs} +1 -1
- package/dist/{shared-_YyZp2AY.mjs → shared-ZaIcKXbz.mjs} +1 -1
- package/dist/{smart-shield-CKSVq1sT.mjs → smart-shield-CjhSz9Ea.mjs} +1 -1
- package/dist/{snippets-D5zLR7Nj.mjs → snippets-CJiarnnh.mjs} +1 -1
- package/dist/{spawn-DiZTRMi2.mjs → spawn-B0Sl8lUu.mjs} +1 -1
- package/dist/{spectrum-L56rh44p.mjs → spectrum-BXIQwKUp.mjs} +1 -1
- package/dist/{speed-CfufTtTk.mjs → speed-B91sRfsz.mjs} +1 -1
- package/dist/{src-BIRFlqDR.mjs → src-DkO1fDN2.mjs} +5 -5
- package/dist/{ssl-BrDo1vL9.mjs → ssl-DDOj0RIi.mjs} +1 -1
- package/dist/{stream-1BpcnrhV.mjs → stream-BbvWFDAg.mjs} +1 -1
- package/dist/{submit-C-ICyQA7.mjs → submit-C11F-D4G.mjs} +1 -1
- package/dist/{tags-BA2CG06z.mjs → tags-CI_8DCQk.mjs} +1 -1
- package/dist/{telemetry-D14VqvDU.mjs → telemetry-C34WnJUm.mjs} +1 -1
- package/dist/telemetry-DNHEg6tE.mjs +2 -0
- package/dist/{tenant-DZ4dgD2t.mjs → tenant-Ddq-iTue.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-YjOHEMtf.mjs → tenant-custom-nameservers-ClTjU8XP.mjs} +1 -1
- package/dist/{tunnels-l8YE_pie.mjs → tunnels-CMNU17n3.mjs} +1 -1
- package/dist/{turnstile-BQrUOlSx.mjs → turnstile-CR24j5Gf.mjs} +1 -1
- package/dist/update-check-CE0SmpBx.mjs +2 -0
- package/dist/{update-check-BPVQSvnH.mjs → update-check-DKJ_werM.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-info-D2l_0t3y.mjs → url-info-Dz-CeD1r.mjs} +1 -1
- package/dist/{url-normalization-K8zAzorz.mjs → url-normalization-C695-pdG.mjs} +1 -1
- package/dist/{url-scanner-Dv7lSDeH.mjs → url-scanner-CtLWYlOL.mjs} +1 -1
- package/dist/{user-DleZBZED.mjs → user-BHgQmcY6.mjs} +1 -1
- package/dist/{values-BnpLZYLh.mjs → values-vERAUyO1.mjs} +1 -1
- package/dist/{vectorize-DyHeuA7K.mjs → vectorize-czzldF6P.mjs} +1 -1
- package/dist/version-Di2YJMgh.mjs +2 -0
- package/dist/{waiting-rooms-CKp_ty0T.mjs → waiting-rooms-CGk6Vjlo.mjs} +1 -1
- package/dist/{web-assets-XrKWHvN4.mjs → web-assets-C97qTerK.mjs} +1 -1
- package/dist/{web3-Bntbgx_4.mjs → web3-DuImSXsP.mjs} +1 -1
- package/dist/{workers-DM3cs8PN.mjs → workers-ClNKh7z_.mjs} +1 -1
- package/dist/{workers-builds-02i1psK2.mjs → workers-builds-DD_B-7Tt.mjs} +1 -1
- package/dist/{workers-for-platforms-B5RlZXZK.mjs → workers-for-platforms-KBtgR7F_.mjs} +1 -1
- package/dist/{workers-vpc-kjiAIRuT.mjs → workers-vpc-CsaJobJQ.mjs} +1 -1
- package/dist/{workflows-BkuFC47X.mjs → workflows-BbIvMUTv.mjs} +1 -1
- package/dist/{wrangler-migration-BDnS1puc.mjs → wrangler-migration-CJEb9hY3.mjs} +1 -1
- package/dist/{zaraz-BPOqw7RU.mjs → zaraz-D-hdVlz2.mjs} +1 -1
- package/dist/{zero-trust-B4sjDfre.mjs → zero-trust-DroiBnoL.mjs} +1 -1
- package/dist/{zone-DkaGQuB6.mjs → zone-CanTvmfK.mjs} +1 -1
- package/dist/{zones-DIlihhZN.mjs → zones-B3-NxJ-8.mjs} +1 -1
- package/package.json +1 -1
- package/dist/build-D5D56lvE.mjs +0 -2
- package/dist/discover-CcGReXr0.mjs +0 -2
- package/dist/error-sanitization-CSlapZbU.mjs +0 -2
- package/dist/generate-t4dFfFRV.mjs +0 -2
- package/dist/local-B5d4OPhA.mjs +0 -2
- package/dist/run-Dkcz54xY.mjs +0 -2
- package/dist/telemetry-Bn5lYtiy.mjs +0 -2
- package/dist/update-check-zLVAcGWy.mjs +0 -2
- package/dist/version-CH8K5y4G.mjs +0 -2
- /package/dist/{cloudflared-C4KjWoEY.mjs → cloudflared-DGuau-lC.mjs} +0 -0
- /package/dist/{command-WCtue6i1.mjs → command-TCklVvOY.mjs} +0 -0
- /package/dist/{discover-B_3A4a_t.mjs → discover-C5aiI6u0.mjs} +0 -0
- /package/dist/{generate-QUDsysBJ.mjs → generate-CLqGOlOx.mjs} +0 -0
- /package/dist/{live-a01OfPf9.mjs → live-MeJQXIei.mjs} +0 -0
- /package/dist/{r2-data-catalog-DpktRU5y.mjs → r2-data-catalog-2jQrdAdo.mjs} +0 -0
- /package/dist/{rate-limit-analytics-YsGha5pH.mjs → rate-limit-analytics-CU55zqCU.mjs} +0 -0
- /package/dist/{rate-limits-kH13NRdf.mjs → rate-limits-CZ-qHDPK.mjs} +0 -0
- /package/dist/{ready-DYun4Fpn.mjs → ready-BOpbZ1pN.mjs} +0 -0
- /package/dist/{recent-submissions-18NaOGOo.mjs → recent-submissions-KDqD2HyS.mjs} +0 -0
- /package/dist/{refute-BhMiJcE1.mjs → refute-DkF4XIMw.mjs} +0 -0
- /package/dist/{registry-DWTPK8_Q.mjs → registry-Cg5lP8oo.mjs} +0 -0
- /package/dist/{scan-logo-7y0pqFMk.mjs → scan-logo-DQkf6glG.mjs} +0 -0
- /package/dist/{scan-page-B6jnK3QI.mjs → scan-page-CMOJ_E0n.mjs} +0 -0
- /package/dist/{schema-JVvksQ1J.mjs → schema-GdBsV4P7.mjs} +0 -0
- /package/dist/{search-Rn3Eefv8.mjs → search-Bre1Zwn3.mjs} +0 -0
- /package/dist/{signed-url-Dzwy9Xiw.mjs → signed-url-24ZbX4yV.mjs} +0 -0
- /package/dist/{submission-info-SNhkDRRZ.mjs → submission-info-BmkbZVqM.mjs} +0 -0
- /package/dist/{tools-CFEubTr4.mjs → tools-BJZ0DDlL.mjs} +0 -0
- /package/dist/{total-queries-B20xslrH.mjs → total-queries-j8OAF_cE.mjs} +0 -0
- /package/dist/{tracked-domains-BCvIOZOK.mjs → tracked-domains-fe3EWYmF.mjs} +0 -0
- /package/dist/{verify-DOeBG4PL.mjs → verify-CKgZYvln.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{a as r,r as i}from"./auth-C_-fMmUL.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-BtNgm5yx.mjs";import{t as c}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,n as h}from"./prompt-CbKaAX24.mjs";import{t as g}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
|
|
3
3
|
|
|
4
4
|
Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`domain`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`."}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).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 te={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:ee,handler:async r=>c({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({domain:p(r.domain,`domain`,`text`),minTLS:p(r[`min-tls`],`min-tls`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.customDomains.create({...e,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}r.domain===void 0&&(r.domain=await m(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),r[`zone-id`]===void 0&&(r[`zone-id`]=await m(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let d=f({domain:p(r.domain,`domain`,`text`),minTLS:p(r[`min-tls`],`min-tls`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`)});a(await s(`Creating`,async()=>c.aiGateway.customDomains.create({...d,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
|
|
5
5
|
|
|
@@ -42,7 +42,7 @@ Retrieves a saved version of a dynamic route, including its routing elements.`).
|
|
|
42
42
|
|
|
43
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 ie={command:`list`,describe:`List dynamic route versions`,builder:re,handler:async r=>c({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/routes/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/versions`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.dynamicRouting.versions.list({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})})},ae={command:`versions`,describe:`Create and inspect saved versions of a dynamic route`,builder:e=>e.command(Z).command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},oe={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(I).command(R).command(G).command(q).command(Y).command(U).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.usage(`$0 ai-gateway gateways create
|
|
44
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(`id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`}).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(`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(`store-id`,{type:`string`,description:`The store_id 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)`})}const ce={command:`create`,describe:`Create a gateway`,builder:se,handler:async r=>c({command:`ai-gateway gateways create`,classification:{safeFlags:[`authentication`,`byok-only`,`cache-invalidate-on-update`,`collect-logs`,`log-management-strategy`,`logpush`,`rate-limiting-technique`,`retry-backoff`,`workers-ai-billing-mode`,`zdr`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({authentication:r.authentication,byok_only:r[`byok-only`],cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],id:p(r.id,`id`,`text`),log_management:r[`log-management`],log_management_strategy:p(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:p(r[`logpush-public-key`],`logpush-public-key`,`text`),rate_limiting_interval:r[`rate-limiting-interval`],rate_limiting_limit:r[`rate-limiting-limit`],rate_limiting_technique:p(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],store_id:p(r[`store-id`],`store-id`,`text`),workers_ai_billing_mode:p(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.gateways.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(r[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(r[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(r.id===void 0&&(r.id=await m(`id`,`Unique identifier of the AI Gateway within the account.`)),r[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(r[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let d=f({authentication:r.authentication,byok_only:r[`byok-only`],cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],id:p(r.id,`id`,`text`),log_management:r[`log-management`],log_management_strategy:p(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:p(r[`logpush-public-key`],`logpush-public-key`,`text`),rate_limiting_interval:r[`rate-limiting-interval`],rate_limiting_limit:r[`rate-limiting-limit`],rate_limiting_technique:p(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],store_id:p(r[`store-id`],`store-id`,`text`),workers_ai_billing_mode:p(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr});a(await s(`Creating`,async()=>c.aiGateway.gateways.create({...d,account_id:l})),{successLabel:`Created`})})};function le(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
|
|
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 ce={command:`create`,describe:`Create a gateway`,builder:se,handler:async r=>c({command:`ai-gateway gateways create`,classification:{safeFlags:`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(`.`)}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({authentication:r.authentication,byok_only:r[`byok-only`],cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],guardrails:{prompt:{P1:p(r[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:p(r[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:p(r[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:p(r[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:p(r[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:p(r[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:p(r[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:p(r[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:p(r[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:p(r[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:p(r[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:p(r[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:p(r[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:p(r[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:p(r[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:p(r[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:p(r[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:p(r[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:p(r[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:p(r[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:p(r[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:p(r[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:p(r[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:p(r[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:p(r[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:p(r[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:p(r[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:p(r[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},id:p(r.id,`id`,`text`),log_classification:r[`log-classification`],log_management:r[`log-management`],log_management_strategy:p(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:p(r[`logpush-public-key`],`logpush-public-key`,`text`),otel:d(r.otel,`otel`),rate_limiting_interval:r[`rate-limiting-interval`],rate_limiting_limit:r[`rate-limiting-limit`],rate_limiting_technique:p(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],spend_limits:{enabled:r[`spend-limits-enabled`]},store_id:p(r[`store-id`],`store-id`,`text`),stripe:{authorization:p(r[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:p(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.gateways.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(r[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(r[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(r.id===void 0&&(r.id=await m(`id`,`Unique identifier of the AI Gateway within the account.`)),r[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(r[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let h=f({authentication:r.authentication,byok_only:r[`byok-only`],cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],guardrails:{prompt:{P1:p(r[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:p(r[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:p(r[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:p(r[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:p(r[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:p(r[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:p(r[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:p(r[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:p(r[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:p(r[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:p(r[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:p(r[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:p(r[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:p(r[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:p(r[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:p(r[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:p(r[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:p(r[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:p(r[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:p(r[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:p(r[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:p(r[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:p(r[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:p(r[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:p(r[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:p(r[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:p(r[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:p(r[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},id:p(r.id,`id`,`text`),log_classification:r[`log-classification`],log_management:r[`log-management`],log_management_strategy:p(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:p(r[`logpush-public-key`],`logpush-public-key`,`text`),otel:d(r.otel,`otel`),rate_limiting_interval:r[`rate-limiting-interval`],rate_limiting_limit:r[`rate-limiting-limit`],rate_limiting_technique:p(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],spend_limits:{enabled:r[`spend-limits-enabled`]},store_id:p(r[`store-id`],`store-id`,`text`),stripe:{authorization:p(r[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:p(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr});a(await s(`Creating`,async()=>c.aiGateway.gateways.create({...h,account_id:l})),{successLabel:`Created`})})};function le(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
|
|
46
46
|
|
|
47
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 ue={command:`delete <gateway-id>`,describe:`Delete a gateway`,builder:le,handler:async l=>c({command:`ai-gateway gateways delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){o({command:`cf ai-gateway gateways delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}`,pathParams:{"gateway-id":String(l[`gateway-id`]??``)},bodyKind:`none`});return}let c=await i(l),u=l.local?e:await n();if(l.accountId=u,!await h({force:!!l.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
48
|
`);return}a(await s(`Deleting`,async()=>r(c,`DELETE`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(l[`gateway-id`]))}`)),{successLabel:`Deleted`})})};function de(e){return e.usage(`$0 ai-gateway gateways get-url <provider>
|
|
@@ -56,25 +56,27 @@ Lists the AI Gateways in the account. Use \`search\` to filter by gateway ID.`).
|
|
|
56
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 ve={command:`create <gateway-id>`,describe:`Store a provider key`,builder:_e,handler:async r=>c({command:`ai-gateway gateways providers create`,classification:{safeFlags:[`default-config`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({alias:p(r.alias,`alias`,`text`),default_config:r[`default-config`],provider_slug:p(r[`provider-slug`],`provider-slug`,`text`),rate_limit:r[`rate-limit`],rate_limit_period:r[`rate-limit-period`],secret:p(r.secret,`secret`,`text`),secret_id:p(r[`secret-id`],`secret-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.gateways.providers.create({...e,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}if(r.alias===void 0&&(r.alias=await m(`alias`,`The alias field`)),r[`default-config`]===void 0)throw Error(`--default-config is required (or pass --body with this field set).`);r[`provider-slug`]===void 0&&(r[`provider-slug`]=await m(`provider-slug`,`The provider_slug field`));let d=f({alias:p(r.alias,`alias`,`text`),default_config:r[`default-config`],provider_slug:p(r[`provider-slug`],`provider-slug`,`text`),rate_limit:r[`rate-limit`],rate_limit_period:r[`rate-limit-period`],secret:p(r.secret,`secret`,`text`),secret_id:p(r[`secret-id`],`secret-id`,`text`)});a(await s(`Creating`,async()=>c.aiGateway.gateways.providers.create({...d,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})})};function ye(e){return e.usage(`$0 ai-gateway gateways providers delete <id>
|
|
57
57
|
|
|
58
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 be={command:`delete <id>`,describe:`Delete a provider key`,builder:ye,handler:async r=>c({command:`ai-gateway gateways providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/provider_configs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await h({force:!!r.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}a(await s(`Deleting`,async()=>c.aiGateway.gateways.providers.delete({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Deleted`})})};function xe(e){return e.usage(`$0 ai-gateway gateways providers
|
|
59
|
+
`);return}a(await s(`Deleting`,async()=>c.aiGateway.gateways.providers.delete({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Deleted`})})};function xe(e){return e.usage(`$0 ai-gateway gateways providers get <id>
|
|
60
60
|
|
|
61
|
-
|
|
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 Se={command:`get <id>`,describe:`Get a provider key`,builder:xe,handler:async r=>c({command:`ai-gateway gateways providers get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/provider_configs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.gateways.providers.get({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})})};function Ce(e){return e.usage(`$0 ai-gateway gateways providers list
|
|
62
62
|
|
|
63
|
-
|
|
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 we={command:`list`,describe:`List provider keys`,builder:Ce,handler:async r=>c({command:`ai-gateway gateways providers list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf ai-gateway gateways providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.gateways.providers.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})})};function Te(e){return e.usage(`$0 ai-gateway gateways providers update <id>
|
|
64
64
|
|
|
65
|
-
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 m=>c({command:`ai-gateway gateways update`,classification:{safeFlags:`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(`.`)}},m,async()=>{if(m.dryRun){o({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${m[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(m[`gateway-id`]))}`,pathParams:{"gateway-id":String(m[`gateway-id`]??``)},bodyKind:`json`,body:m.body===void 0?f({authentication:m.authentication,byok_only:m[`byok-only`],cache_invalidate_on_update:m[`cache-invalidate-on-update`],cache_ttl:m[`cache-ttl`],collect_logs:m[`collect-logs`],guardrails:{prompt:{P1:p(m[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:p(m[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:p(m[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:p(m[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:p(m[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:p(m[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:p(m[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:p(m[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:p(m[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:p(m[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:p(m[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:p(m[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:p(m[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:p(m[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:p(m[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:p(m[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:p(m[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:p(m[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:p(m[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:p(m[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:p(m[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:p(m[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:p(m[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:p(m[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:p(m[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:p(m[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:p(m[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:p(m[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:m[`log-classification`],log_management:m[`log-management`],log_management_strategy:p(m[`log-management-strategy`],`log-management-strategy`,`text`),logpush:m.logpush,logpush_public_key:p(m[`logpush-public-key`],`logpush-public-key`,`text`),otel:d(m.otel,`otel`),rate_limiting_interval:m[`rate-limiting-interval`],rate_limiting_limit:m[`rate-limiting-limit`],rate_limiting_technique:p(m[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(m[`retry-backoff`],`retry-backoff`,`text`),retry_delay:m[`retry-delay`],retry_max_attempts:m[`retry-max-attempts`],spend_limits:{enabled:m[`spend-limits-enabled`]},store_id:p(m[`store-id`],`store-id`,`text`),stripe:{authorization:p(m[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:p(m[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:m.zdr}):u(m.body)});return}let c=await i(m),h=m.local?e:await n();if(m.accountId=h,m.body){let e=u(m.body);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(m[`gateway-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(m[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(m[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(m[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(m[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(m[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let g={};m.authentication!==void 0&&l(g,[`authentication`],m.authentication),m[`byok-only`]!==void 0&&l(g,[`byok_only`],m[`byok-only`]),m[`cache-invalidate-on-update`]!==void 0&&l(g,[`cache_invalidate_on_update`],m[`cache-invalidate-on-update`]),m[`cache-ttl`]!==void 0&&l(g,[`cache_ttl`],m[`cache-ttl`]),m[`collect-logs`]!==void 0&&l(g,[`collect_logs`],m[`collect-logs`]),m[`guardrails-prompt-p1`]!==void 0&&l(g,[`guardrails`,`prompt`,`P1`],p(m[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`)),m[`guardrails-prompt-s1`]!==void 0&&l(g,[`guardrails`,`prompt`,`S1`],p(m[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`)),m[`guardrails-prompt-s10`]!==void 0&&l(g,[`guardrails`,`prompt`,`S10`],p(m[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`)),m[`guardrails-prompt-s11`]!==void 0&&l(g,[`guardrails`,`prompt`,`S11`],p(m[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`)),m[`guardrails-prompt-s12`]!==void 0&&l(g,[`guardrails`,`prompt`,`S12`],p(m[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`)),m[`guardrails-prompt-s13`]!==void 0&&l(g,[`guardrails`,`prompt`,`S13`],p(m[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`)),m[`guardrails-prompt-s2`]!==void 0&&l(g,[`guardrails`,`prompt`,`S2`],p(m[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`)),m[`guardrails-prompt-s3`]!==void 0&&l(g,[`guardrails`,`prompt`,`S3`],p(m[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`)),m[`guardrails-prompt-s4`]!==void 0&&l(g,[`guardrails`,`prompt`,`S4`],p(m[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`)),m[`guardrails-prompt-s5`]!==void 0&&l(g,[`guardrails`,`prompt`,`S5`],p(m[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`)),m[`guardrails-prompt-s6`]!==void 0&&l(g,[`guardrails`,`prompt`,`S6`],p(m[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`)),m[`guardrails-prompt-s7`]!==void 0&&l(g,[`guardrails`,`prompt`,`S7`],p(m[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`)),m[`guardrails-prompt-s8`]!==void 0&&l(g,[`guardrails`,`prompt`,`S8`],p(m[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`)),m[`guardrails-prompt-s9`]!==void 0&&l(g,[`guardrails`,`prompt`,`S9`],p(m[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)),m[`guardrails-response-p1`]!==void 0&&l(g,[`guardrails`,`response`,`P1`],p(m[`guardrails-response-p1`],`guardrails-response-p1`,`text`)),m[`guardrails-response-s1`]!==void 0&&l(g,[`guardrails`,`response`,`S1`],p(m[`guardrails-response-s1`],`guardrails-response-s1`,`text`)),m[`guardrails-response-s10`]!==void 0&&l(g,[`guardrails`,`response`,`S10`],p(m[`guardrails-response-s10`],`guardrails-response-s10`,`text`)),m[`guardrails-response-s11`]!==void 0&&l(g,[`guardrails`,`response`,`S11`],p(m[`guardrails-response-s11`],`guardrails-response-s11`,`text`)),m[`guardrails-response-s12`]!==void 0&&l(g,[`guardrails`,`response`,`S12`],p(m[`guardrails-response-s12`],`guardrails-response-s12`,`text`)),m[`guardrails-response-s13`]!==void 0&&l(g,[`guardrails`,`response`,`S13`],p(m[`guardrails-response-s13`],`guardrails-response-s13`,`text`)),m[`guardrails-response-s2`]!==void 0&&l(g,[`guardrails`,`response`,`S2`],p(m[`guardrails-response-s2`],`guardrails-response-s2`,`text`)),m[`guardrails-response-s3`]!==void 0&&l(g,[`guardrails`,`response`,`S3`],p(m[`guardrails-response-s3`],`guardrails-response-s3`,`text`)),m[`guardrails-response-s4`]!==void 0&&l(g,[`guardrails`,`response`,`S4`],p(m[`guardrails-response-s4`],`guardrails-response-s4`,`text`)),m[`guardrails-response-s5`]!==void 0&&l(g,[`guardrails`,`response`,`S5`],p(m[`guardrails-response-s5`],`guardrails-response-s5`,`text`)),m[`guardrails-response-s6`]!==void 0&&l(g,[`guardrails`,`response`,`S6`],p(m[`guardrails-response-s6`],`guardrails-response-s6`,`text`)),m[`guardrails-response-s7`]!==void 0&&l(g,[`guardrails`,`response`,`S7`],p(m[`guardrails-response-s7`],`guardrails-response-s7`,`text`)),m[`guardrails-response-s8`]!==void 0&&l(g,[`guardrails`,`response`,`S8`],p(m[`guardrails-response-s8`],`guardrails-response-s8`,`text`)),m[`guardrails-response-s9`]!==void 0&&l(g,[`guardrails`,`response`,`S9`],p(m[`guardrails-response-s9`],`guardrails-response-s9`,`text`)),m[`log-classification`]!==void 0&&l(g,[`log_classification`],m[`log-classification`]),m[`log-management`]!==void 0&&l(g,[`log_management`],m[`log-management`]),m[`log-management-strategy`]!==void 0&&l(g,[`log_management_strategy`],p(m[`log-management-strategy`],`log-management-strategy`,`text`)),m.logpush!==void 0&&l(g,[`logpush`],m.logpush),m[`logpush-public-key`]!==void 0&&l(g,[`logpush_public_key`],p(m[`logpush-public-key`],`logpush-public-key`,`text`)),m.otel!==void 0&&l(g,[`otel`],d(m.otel,`otel`)),m[`rate-limiting-interval`]!==void 0&&l(g,[`rate_limiting_interval`],m[`rate-limiting-interval`]),m[`rate-limiting-limit`]!==void 0&&l(g,[`rate_limiting_limit`],m[`rate-limiting-limit`]),m[`rate-limiting-technique`]!==void 0&&l(g,[`rate_limiting_technique`],p(m[`rate-limiting-technique`],`rate-limiting-technique`,`text`)),m[`retry-backoff`]!==void 0&&l(g,[`retry_backoff`],p(m[`retry-backoff`],`retry-backoff`,`text`)),m[`retry-delay`]!==void 0&&l(g,[`retry_delay`],m[`retry-delay`]),m[`retry-max-attempts`]!==void 0&&l(g,[`retry_max_attempts`],m[`retry-max-attempts`]),m[`spend-limits-enabled`]!==void 0&&l(g,[`spend_limits`,`enabled`],m[`spend-limits-enabled`]),m[`store-id`]!==void 0&&l(g,[`store_id`],p(m[`store-id`],`store-id`,`text`)),m[`stripe-authorization`]!==void 0&&l(g,[`stripe`,`authorization`],p(m[`stripe-authorization`],`stripe-authorization`,`text`)),m[`workers-ai-billing-mode`]!==void 0&&l(g,[`workers_ai_billing_mode`],p(m[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`)),m.zdr!==void 0&&l(g,[`zdr`],m.zdr),a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(m[`gateway-id`]))}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})})},Oe={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(ce).command(ue).command(me).command(fe).command(ge).command(De).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
|
|
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 Ee={command:`update <id>`,describe:`Rotate a provider key`,builder:Te,handler:async r=>c({command:`ai-gateway gateways providers update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/provider_configs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?f({secret:p(r.secret,`secret`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.aiGateway.gateways.providers.update({...e,account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}r.secret===void 0&&(r.secret=await m(`secret`,`Provider API key to store in the Secrets Store configured on the gateway.`,{kind:`secret`}));let d=f({secret:p(r.secret,`secret`,`text`)});a(await s(`Updating`,async()=>c.aiGateway.gateways.providers.update({...d,account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})})},De={command:`providers`,describe:`Store and rotate upstream AI provider keys for a gateway`,builder:e=>e.command(ve).command(be).command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.usage(`$0 ai-gateway gateways update <gateway-id>
|
|
66
66
|
|
|
67
|
-
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:g(ke),handler:async r=>c({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let c={order_by:r[`order-by`],order_by_direction:r[`order-by-direction`],filters:r.filters,limit:r.limit};if(r.dryRun){o({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();if(r.accountId=u,!await h({force:!!r.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.
|
|
68
|
-
`);return}a(await s(`Deleting`,async()=>l.aiGateway.logs.delete({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Deleted`})})};function je(e){return e.usage(`$0 ai-gateway logs get-request <id>
|
|
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 ke={command:`update <gateway-id>`,describe:`Update a gateway`,builder:Oe,handler:async m=>c({command:`ai-gateway gateways update`,classification:{safeFlags:`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(`.`)}},m,async()=>{if(m.dryRun){o({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${m[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(m[`gateway-id`]))}`,pathParams:{"gateway-id":String(m[`gateway-id`]??``)},bodyKind:`json`,body:m.body===void 0?f({authentication:m.authentication,byok_only:m[`byok-only`],cache_invalidate_on_update:m[`cache-invalidate-on-update`],cache_ttl:m[`cache-ttl`],collect_logs:m[`collect-logs`],guardrails:{prompt:{P1:p(m[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:p(m[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:p(m[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:p(m[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:p(m[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:p(m[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:p(m[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:p(m[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:p(m[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:p(m[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:p(m[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:p(m[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:p(m[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:p(m[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:p(m[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:p(m[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:p(m[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:p(m[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:p(m[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:p(m[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:p(m[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:p(m[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:p(m[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:p(m[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:p(m[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:p(m[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:p(m[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:p(m[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:m[`log-classification`],log_management:m[`log-management`],log_management_strategy:p(m[`log-management-strategy`],`log-management-strategy`,`text`),logpush:m.logpush,logpush_public_key:p(m[`logpush-public-key`],`logpush-public-key`,`text`),otel:d(m.otel,`otel`),rate_limiting_interval:m[`rate-limiting-interval`],rate_limiting_limit:m[`rate-limiting-limit`],rate_limiting_technique:p(m[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:p(m[`retry-backoff`],`retry-backoff`,`text`),retry_delay:m[`retry-delay`],retry_max_attempts:m[`retry-max-attempts`],spend_limits:{enabled:m[`spend-limits-enabled`]},store_id:p(m[`store-id`],`store-id`,`text`),stripe:{authorization:p(m[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:p(m[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:m.zdr}):u(m.body)});return}let c=await i(m),h=m.local?e:await n();if(m.accountId=h,m.body){let e=u(m.body);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(m[`gateway-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(m[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(m[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(m[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(m[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(m[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let g={};m.authentication!==void 0&&l(g,[`authentication`],m.authentication),m[`byok-only`]!==void 0&&l(g,[`byok_only`],m[`byok-only`]),m[`cache-invalidate-on-update`]!==void 0&&l(g,[`cache_invalidate_on_update`],m[`cache-invalidate-on-update`]),m[`cache-ttl`]!==void 0&&l(g,[`cache_ttl`],m[`cache-ttl`]),m[`collect-logs`]!==void 0&&l(g,[`collect_logs`],m[`collect-logs`]),m[`guardrails-prompt-p1`]!==void 0&&l(g,[`guardrails`,`prompt`,`P1`],p(m[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`)),m[`guardrails-prompt-s1`]!==void 0&&l(g,[`guardrails`,`prompt`,`S1`],p(m[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`)),m[`guardrails-prompt-s10`]!==void 0&&l(g,[`guardrails`,`prompt`,`S10`],p(m[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`)),m[`guardrails-prompt-s11`]!==void 0&&l(g,[`guardrails`,`prompt`,`S11`],p(m[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`)),m[`guardrails-prompt-s12`]!==void 0&&l(g,[`guardrails`,`prompt`,`S12`],p(m[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`)),m[`guardrails-prompt-s13`]!==void 0&&l(g,[`guardrails`,`prompt`,`S13`],p(m[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`)),m[`guardrails-prompt-s2`]!==void 0&&l(g,[`guardrails`,`prompt`,`S2`],p(m[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`)),m[`guardrails-prompt-s3`]!==void 0&&l(g,[`guardrails`,`prompt`,`S3`],p(m[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`)),m[`guardrails-prompt-s4`]!==void 0&&l(g,[`guardrails`,`prompt`,`S4`],p(m[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`)),m[`guardrails-prompt-s5`]!==void 0&&l(g,[`guardrails`,`prompt`,`S5`],p(m[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`)),m[`guardrails-prompt-s6`]!==void 0&&l(g,[`guardrails`,`prompt`,`S6`],p(m[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`)),m[`guardrails-prompt-s7`]!==void 0&&l(g,[`guardrails`,`prompt`,`S7`],p(m[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`)),m[`guardrails-prompt-s8`]!==void 0&&l(g,[`guardrails`,`prompt`,`S8`],p(m[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`)),m[`guardrails-prompt-s9`]!==void 0&&l(g,[`guardrails`,`prompt`,`S9`],p(m[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)),m[`guardrails-response-p1`]!==void 0&&l(g,[`guardrails`,`response`,`P1`],p(m[`guardrails-response-p1`],`guardrails-response-p1`,`text`)),m[`guardrails-response-s1`]!==void 0&&l(g,[`guardrails`,`response`,`S1`],p(m[`guardrails-response-s1`],`guardrails-response-s1`,`text`)),m[`guardrails-response-s10`]!==void 0&&l(g,[`guardrails`,`response`,`S10`],p(m[`guardrails-response-s10`],`guardrails-response-s10`,`text`)),m[`guardrails-response-s11`]!==void 0&&l(g,[`guardrails`,`response`,`S11`],p(m[`guardrails-response-s11`],`guardrails-response-s11`,`text`)),m[`guardrails-response-s12`]!==void 0&&l(g,[`guardrails`,`response`,`S12`],p(m[`guardrails-response-s12`],`guardrails-response-s12`,`text`)),m[`guardrails-response-s13`]!==void 0&&l(g,[`guardrails`,`response`,`S13`],p(m[`guardrails-response-s13`],`guardrails-response-s13`,`text`)),m[`guardrails-response-s2`]!==void 0&&l(g,[`guardrails`,`response`,`S2`],p(m[`guardrails-response-s2`],`guardrails-response-s2`,`text`)),m[`guardrails-response-s3`]!==void 0&&l(g,[`guardrails`,`response`,`S3`],p(m[`guardrails-response-s3`],`guardrails-response-s3`,`text`)),m[`guardrails-response-s4`]!==void 0&&l(g,[`guardrails`,`response`,`S4`],p(m[`guardrails-response-s4`],`guardrails-response-s4`,`text`)),m[`guardrails-response-s5`]!==void 0&&l(g,[`guardrails`,`response`,`S5`],p(m[`guardrails-response-s5`],`guardrails-response-s5`,`text`)),m[`guardrails-response-s6`]!==void 0&&l(g,[`guardrails`,`response`,`S6`],p(m[`guardrails-response-s6`],`guardrails-response-s6`,`text`)),m[`guardrails-response-s7`]!==void 0&&l(g,[`guardrails`,`response`,`S7`],p(m[`guardrails-response-s7`],`guardrails-response-s7`,`text`)),m[`guardrails-response-s8`]!==void 0&&l(g,[`guardrails`,`response`,`S8`],p(m[`guardrails-response-s8`],`guardrails-response-s8`,`text`)),m[`guardrails-response-s9`]!==void 0&&l(g,[`guardrails`,`response`,`S9`],p(m[`guardrails-response-s9`],`guardrails-response-s9`,`text`)),m[`log-classification`]!==void 0&&l(g,[`log_classification`],m[`log-classification`]),m[`log-management`]!==void 0&&l(g,[`log_management`],m[`log-management`]),m[`log-management-strategy`]!==void 0&&l(g,[`log_management_strategy`],p(m[`log-management-strategy`],`log-management-strategy`,`text`)),m.logpush!==void 0&&l(g,[`logpush`],m.logpush),m[`logpush-public-key`]!==void 0&&l(g,[`logpush_public_key`],p(m[`logpush-public-key`],`logpush-public-key`,`text`)),m.otel!==void 0&&l(g,[`otel`],d(m.otel,`otel`)),m[`rate-limiting-interval`]!==void 0&&l(g,[`rate_limiting_interval`],m[`rate-limiting-interval`]),m[`rate-limiting-limit`]!==void 0&&l(g,[`rate_limiting_limit`],m[`rate-limiting-limit`]),m[`rate-limiting-technique`]!==void 0&&l(g,[`rate_limiting_technique`],p(m[`rate-limiting-technique`],`rate-limiting-technique`,`text`)),m[`retry-backoff`]!==void 0&&l(g,[`retry_backoff`],p(m[`retry-backoff`],`retry-backoff`,`text`)),m[`retry-delay`]!==void 0&&l(g,[`retry_delay`],m[`retry-delay`]),m[`retry-max-attempts`]!==void 0&&l(g,[`retry_max_attempts`],m[`retry-max-attempts`]),m[`spend-limits-enabled`]!==void 0&&l(g,[`spend_limits`,`enabled`],m[`spend-limits-enabled`]),m[`store-id`]!==void 0&&l(g,[`store_id`],p(m[`store-id`],`store-id`,`text`)),m[`stripe-authorization`]!==void 0&&l(g,[`stripe`,`authorization`],p(m[`stripe-authorization`],`stripe-authorization`,`text`)),m[`workers-ai-billing-mode`]!==void 0&&l(g,[`workers_ai_billing_mode`],p(m[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`)),m.zdr!==void 0&&l(g,[`zdr`],m.zdr),a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(m[`gateway-id`]))}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})})},Ae={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(ce).command(ue).command(me).command(fe).command(ge).command(ke).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
|
|
69
68
|
|
|
70
|
-
|
|
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 Me={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:g(je),handler:async r=>c({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let c={order_by:r[`order-by`],order_by_direction:r[`order-by-direction`],filters:r.filters,limit:r.limit};if(r.dryRun){o({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();if(r.accountId=u,!await h({force:!!r.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}a(await s(`Deleting`,async()=>l.aiGateway.logs.delete({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Deleted`})})};function Ne(e){return e.usage(`$0 ai-gateway logs get-request <id>
|
|
71
71
|
|
|
72
|
-
Retrieves the
|
|
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 Pe={command:`get-request <id>`,describe:`Get Gateway Log Request`,builder:Ne,handler:async r=>c({command:`ai-gateway logs get-request`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway logs get-request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/request`,pathParams:{id:String(r.id??``),"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.logs.getRequest({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 ai-gateway logs get-response <id>
|
|
73
73
|
|
|
74
|
-
Retrieves
|
|
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 Fe={command:`get-response <id>`,describe:`Get Gateway Log Response`,builder:$,handler:async r=>c({command:`ai-gateway logs get-response`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway logs get-response`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/response`,pathParams:{id:String(r.id??``),"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.logs.getResponse({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})})};function Ie(e){return e.usage(`$0 ai-gateway logs get <id>
|
|
75
75
|
|
|
76
|
-
|
|
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 Le={command:`get <id>`,describe:`Get Gateway Log Detail`,builder:Ie,handler:async r=>c({command:`ai-gateway logs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``),"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.logs.get({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})})};function Re(e){return e.usage(`$0 ai-gateway logs list
|
|
77
77
|
|
|
78
|
-
|
|
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 ze={command:`list`,describe:`List Gateway Logs`,builder:g(Re),handler:async r=>c({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},r,async()=>{let c={search:r.search,page:r.page,per_page:r[`per-page`],order_by:r[`order-by`],order_by_direction:r[`order-by-direction`],filters:r.filters,meta_info:r[`meta-info`],direction:r.direction,start_date:r[`start-date`],end_date:r[`end-date`],min_cost:r[`min-cost`],max_cost:r[`max-cost`],min_tokens_in:r[`min-tokens-in`],max_tokens_in:r[`max-tokens-in`],min_tokens_out:r[`min-tokens-out`],max_tokens_out:r[`max-tokens-out`],min_total_tokens:r[`min-total-tokens`],max_total_tokens:r[`max-total-tokens`],min_duration:r[`min-duration`],max_duration:r[`max-duration`],feedback:r.feedback,success:r.success,cached:r.cached,model:r.model,model_type:r[`model-type`],provider:r.provider,request_content_type:r[`request-content-type`],response_content_type:r[`response-content-type`]};if(r.dryRun){o({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.logs.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})})};function Be(e){return e.usage(`$0 ai-gateway logs update <id>
|
|
79
79
|
|
|
80
|
-
|
|
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 Ve={command:`update <id>`,describe:`Patch Gateway Log`,builder:Be,handler:async r=>c({command:`ai-gateway logs update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway logs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/logs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``),"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({feedback:r.feedback,score:r.score}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.aiGateway.logs.update({...e,account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}let d=f({feedback:r.feedback,score:r.score});a(await s(`Updating`,async()=>c.aiGateway.logs.update({...d,account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})})},He={command:`logs`,describe:`Inspect, annotate, and delete gateway request logs stored by Legacy Logs`,builder:e=>e.command(Me).command(Le).command(Pe).command(Fe).command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ue(e){return e.usage(`$0 ai-gateway web-search
|
|
81
|
+
|
|
82
|
+
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 We={command:`web-search`,describe:`Search the web through AI Gateway`,builder:Ue,handler:async r=>c({command:`ai-gateway web-search`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway web-search`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai/websearch`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({byokAlias:p(r[`byok-alias`],`byok-alias`,`text`),limit:r.limit,options:{gateway:{id:p(r[`options-gateway-id`],`options-gateway-id`,`text`)}},provider:p(r.provider,`provider`,`text`),query:p(r.query,`query`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.webSearch({...e,account_id:l})),{successLabel:`Created`});return}r[`options-gateway-id`]===void 0&&(r[`options-gateway-id`]=await m(`options-gateway-id`,`The options.gateway.id field`)),r.query===void 0&&(r.query=await m(`query`,`The query field`));let d=f({byokAlias:p(r[`byok-alias`],`byok-alias`,`text`),limit:r.limit,options:{gateway:{id:p(r[`options-gateway-id`],`options-gateway-id`,`text`)}},provider:p(r.provider,`provider`,`text`),query:p(r.query,`query`,`text`)});a(await s(`Creating`,async()=>c.aiGateway.webSearch({...d,account_id:l})),{successLabel:`Created`})})},Ge={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(We).command(C).command(P).command(oe).command(Ae).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ge as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{a as r,r as i}from"./auth-C_-fMmUL.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-BtNgm5yx.mjs";import{t as c}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f,t as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-CbKaAX24.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";import{n as ee,t as te}from"./raw-fetch-CAZrlsc6.mjs";function v(e){return e.usage(`$0 ai-search chat-completions <id>
|
|
3
3
|
|
|
4
4
|
Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`chat-completions <id>`,describe:`Chat Completions`,builder:v,handler:async r=>c({command:`ai-search chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-search/namespaces/${r.name==null?`<name>`:encodeURIComponent(String(r.name))}/instances/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/chat/completions`,pathParams:{id:String(r.id??``),name:String(r.name??``)},bodyKind:`json`,body:r.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(r[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:r[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:r[`ai-search-options-query-rewrite-enabled`],model:f(r[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(r[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:r[`ai-search-options-reranking-enabled`],match_threshold:r[`ai-search-options-reranking-match-threshold`],model:f(r[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:r[`ai-search-options-retrieval-context-expansion`],fusion_method:f(r[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(r[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:r[`ai-search-options-retrieval-match-threshold`],max_num_results:r[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(r[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:r[`ai-search-options-retrieval-return-on-failure`]}},messages:u(r.messages,`messages`),model:f(r.model,`model`,`text`),stream:r.stream}):l(r.body)});return}let c=await i(r),p=r.local?e:await n();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.aiSearch.chatCompletions({...e,account_id:p,name:r.name,id:r.id})),{successLabel:`Created`});return}if(r.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let m=d({ai_search_options:{cache:{cache_threshold:f(r[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:r[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:r[`ai-search-options-query-rewrite-enabled`],model:f(r[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(r[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:r[`ai-search-options-reranking-enabled`],match_threshold:r[`ai-search-options-reranking-match-threshold`],model:f(r[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:r[`ai-search-options-retrieval-context-expansion`],fusion_method:f(r[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(r[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:r[`ai-search-options-retrieval-match-threshold`],max_num_results:r[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(r[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:r[`ai-search-options-retrieval-return-on-failure`]}},messages:u(r.messages,`messages`),model:f(r.model,`model`,`text`),stream:r.stream});a(await s(`Creating`,async()=>c.aiSearch.chatCompletions({...m,account_id:p,name:r.name,id:r.id})),{successLabel:`Created`})})};function b(e){return e.usage(`$0 ai-search create <name> <id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e}from"./context-
|
|
2
|
+
import{i as e}from"./context-Cibc7DIM.mjs";import{r as t}from"./auth-C_-fMmUL.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-BtNgm5yx.mjs";import{t as a}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as o,r as s,t as c}from"./body-parser-hh2avzkz.mjs";import{n as l}from"./prompt-CbKaAX24.mjs";function u(e){return e.usage(`$0 ai-security custom-topics get
|
|
3
3
|
|
|
4
4
|
Get the custom topic categories defined for the zone. While AI Security for Apps is enabled, it scores every incoming prompt against these topics and writes the scores to the \`cf.llm.prompt.custom_topic_categories\` field, keyed by topic label. Topics can be configured while the detection is disabled, but no prompt is scored until you enable it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Get the AI Security for Apps custom topics of a zone.`,builder:u,handler:async o=>a({command:`ai-security custom-topics get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf ai-security custom-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/ai-security/custom-topics`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.aiSecurity.customTopics.get({zone_id:s})),{successLabel:`Loaded`})})};function f(e){return e.usage("$0 ai-security custom-topics update\n\nUpdate the custom topic list of the zone, overwriting it entirely with the topics in the request, so include every topic you want to keep. Changes can take up to a minute to propagate. Each entry has a `label`, used to reference the topic in rule expressions and analytics, and a `topic` description, which the classifier scores prompts against while AI Security for Apps is enabled. The following rules apply: - A zone can hold at most 20 topics. - `label` must be 2–20 characters, using only lowercase letters (a–z), digits (0–9), and hyphens. - `topic` must be 2–50 printable ASCII characters. - Labels must be unique within the zone, and so must topic descriptions.").option(`topics`,{type:`string`,description:`Custom topic categories for AI Security for Apps content detection. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`update`,describe:`Update the AI Security for Apps custom topics of a zone.`,builder:f,handler:async u=>a({command:`ai-security custom-topics update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},u,async()=>{if(u.dryRun){r({command:`cf ai-security custom-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/ai-security/custom-topics`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({topics:s(u.topics,`topics`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,!await l({force:!!u.force,message:`This operation overwrites the AI Security for Apps custom topics for a zone.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}if(u.body){let e=o(u.body);n(await i(`Deleting`,async()=>a.aiSecurity.customTopics.update({body:e,zone_id:d})),{successLabel:`Deleted`});return}let f=c({topics:s(u.topics,`topics`)});n(await i(`Deleting`,async()=>a.aiSecurity.customTopics.update({body:f,zone_id:d})),{successLabel:`Deleted`})})},m={command:`custom-topics`,describe:`Organization-specific topic categories used by AI Security for Apps content detection`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.usage(`$0 ai-security get
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{r}from"./auth-C_-fMmUL.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-BtNgm5yx.mjs";import{t as s}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,i as f,n as p}from"./prompt-CbKaAX24.mjs";import{n as m,t as h}from"./raw-fetch-CAZrlsc6.mjs";function ee(e){return e.usage(`$0 alerting available-alerts list
|
|
3
3
|
|
|
4
4
|
Gets a list of all alert types for which an account is eligible.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Get Alert Types`,builder:ee,handler:async c=>s({command:`alerting available-alerts list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf alerting available-alerts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/alerting/v3/available_alerts`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.alerting.availableAlerts.list({account_id:l})),{successLabel:`Loaded`})})},_={command:`available-alerts`,describe:`Operations for available-alerts`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.usage(`$0 alerting destinations eligible get
|
|
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-B5oRPTEN.mjs";import{a as t,i as n,t as r}from"./context-Cibc7DIM.mjs";import{a as i,r as a}from"./auth-C_-fMmUL.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-BtNgm5yx.mjs";import{t as l}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-hh2avzkz.mjs";import{n as m,t as h}from"./input-validation-Dk52b0me.mjs";import{a as g}from"./prompt-CbKaAX24.mjs";function _(e){return e.usage(`$0 analytics latency colos get
|
|
3
3
|
|
|
4
4
|
Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Argo Analytics for a zone at different PoPs`,builder:_,handler:async e=>l({command:`analytics latency colos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,o(await c(`Loading`,async()=>t.analytics.latency.colos.get({zone_id:r})),{successLabel:`Loaded`})})},y={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 analytics latency get
|
|
5
5
|
|
|
@@ -14,8 +14,7 @@ Returns merged time-bucketed CASB findings.`).option(`filters`,{type:`string`,de
|
|
|
14
14
|
Returns aggregate summary stats for a dataset. Includes current-period and previous-period totals for trend comparison.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const N={command:`summary <dataset>`,describe:`Query analytics summary`,builder:M,handler:async n=>l({command:`analytics query summary`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf analytics query summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics/query/${n.dataset==null?`<dataset>`:encodeURIComponent(String(n.dataset))}/summary`,pathParams:{dataset:String(n.dataset??``)},bodyKind:`json`,body:n.body===void 0?p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.analytics.query.summary({...e,account_id:l,dataset:n.dataset})),{successLabel:`Created`});return}if(n.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(n.from===void 0&&(n.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),n[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(n.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);n.to===void 0&&(n.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`));let u=p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`)});o(await c(`Creating`,async()=>i.analytics.query.summary({...u,account_id:l,dataset:n.dataset})),{successLabel:`Created`})})};function P(e){return e.usage("$0 analytics query timeseries <dataset>\n\nReturns time-bucketed analytics data for a dataset. Includes time slots, each containing the requested stats, group-by dimensions, and resolution-controlled bucket size (e.g. `hour`, `day`).").positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`resolution`,{type:`string`,description:`Time bucket size for grouping results. Controls the granularity of the returned time slots.
|
|
15
15
|
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const F={command:`timeseries <dataset>`,describe:`Query analytics timeseries`,builder:P,handler:async n=>l({command:`analytics query timeseries`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf analytics query timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics/query/${n.dataset==null?`<dataset>`:encodeURIComponent(String(n.dataset))}/timeseries`,pathParams:{dataset:String(n.dataset??``)},bodyKind:`json`,body:n.body===void 0?p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),resolution:m(n.resolution,`resolution`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.analytics.query.timeseries({...e,account_id:l,dataset:n.dataset})),{successLabel:`Created`});return}if(n.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(n.from===void 0&&(n.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),n[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(n.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);n.to===void 0&&(n.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),n.resolution===void 0&&(n.resolution=await g(`resolution`,`Time bucket size for grouping results. Controls the granularity of the returned time slots. `));let u=p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),resolution:m(n.resolution,`resolution`,`text`)});o(await c(`Creating`,async()=>i.analytics.query.timeseries({...u,account_id:l,dataset:n.dataset})),{successLabel:`Created`})})};function I(e){return e.usage(`$0 analytics query top-n <dataset>
|
|
16
16
|
|
|
17
|
-
Returns the top N results for a dataset by a specified stat. Includes an array of result rows, each containing the requested stats and group-by dimensions.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`n`,{type:`number`,description:`Maximum number of results to return.`}).option(`order-by`,{type:`string`,description:`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const L={command:`top-n <dataset>`,describe:`Query analytics top-N`,builder:I,handler:async n=>l({command:`analytics query top-n`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf analytics query top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics/query/${n.dataset==null?`<dataset>`:encodeURIComponent(String(n.dataset))}/top-n`,pathParams:{dataset:String(n.dataset??``)},bodyKind:`json`,body:n.body===void 0?p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),n:n.n,orderBy:m(n[`order-by`],`order-by`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.analytics.query.topN({...e,account_id:l,dataset:n.dataset})),{successLabel:`Created`});return}if(n.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(n.from===void 0&&(n.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),n[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(n.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);if(n.to===void 0&&(n.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),n.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);n[`order-by`]===void 0&&(n[`order-by`]=await g(`order-by`,`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`));let u=p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),n:n.n,orderBy:m(n[`order-by`],`order-by`,`text`)});o(await c(`Creating`,async()=>i.analytics.query.topN({...u,account_id:l,dataset:n.dataset})),{successLabel:`Created`})})},R={command:`query`,describe:`Operations for query`,builder:e=>e.command(N).command(F).command(L).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage("$0 analytics sql get\n\nExecutes a SQL query against the analytics datasets available to the caller. SQL placeholders can be bound with query parameters named `param_<name>`, such as `param_status=404` for `$status`.").option(`query`,{type:`string`,description:`SQL query to execute.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Query analytics datasets`,builder:z,handler:async e=>l({command:`analytics sql get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={query:e.query};if(e.dryRun){s({command:`cf analytics sql get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.analytics.sql.get(t)),{successLabel:`Loaded`})})};function V(e){return e.usage("$0 analytics sql introspection get\n\nReturns the analytics dataset catalogue. By default, the response contains dataset names, titles, descriptions, and kinds. Set `include_columns` to include each dataset's column names, descriptions, and data types. The caller must have Account Analytics Read permission on the account identified by `account_tag`. Dataset names, descriptions, and columns are the same for every authorized account. When `include_custom_attributes` is set, the response also includes custom attribute names and types discovered from that account's own data, which legitimately differs per caller. The catalogue lists the datasets this deployment is able to describe, which is not a fixed list. Some datasets are described by the service that owns them and are listed only where that service is available, so the same account may see a different catalogue in different environments, and datasets may appear or disappear without a change to this API. Clients should query the catalogue rather than hard-coding it, and should not treat a dataset's absence as proof that it does not exist. Workers Analytics Engine datasets are named by the account that writes them, so they are discovered from that account's own data rather than from a fixed list. They appear as `events.analyticsEngine.<dataset_name>` and differ per account. A dataset is listed for as long as any of its data is retained, so it does not disappear from the catalogue merely because writes have stopped. An account with a very large number of datasets may receive a truncated list. Set `include_wae=false` to omit them. Log Explorer datasets are listed only where the account has them, so they differ per account and are not part of the static catalogue. Set `include_lex=false` to omit them.").option(`account-tag`,{type:`string`,description:`Account whose available analytics datasets are returned.`,demandOption:!0}).option(`include-columns`,{type:`boolean`,description:`Include column metadata for each returned dataset.`}).option(`include-custom-attributes`,{type:`boolean`,description:`Include a capped set of custom attribute names and types observed during the preceding seven days. Requires a nonempty dataset_name.`}).option(`include-wae`,{type:`boolean`,description:"Include Workers Analytics Engine datasets, which are discovered from the account's own data. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`include-lex`,{type:`boolean`,description:"Include Log Explorer datasets, which are listed only where the account has them. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`dataset-name`,{type:`string`,description:"Return only the dataset with this exact name. An empty value is treated as if the parameter had been omitted, and does not filter the catalogue. A name that matches no dataset in this deployment's catalogue is rejected with `422`; a dataset that exists but is not describable here is rejected identically, so the two cases cannot be told apart.\n\nA Workers Analytics Engine dataset is named in full, as `events.analyticsEngine.<dataset_name>`; the namespace on its own returns every such dataset the account has. A `dataset_name` the account does not have is rejected with `422` like any other unknown name."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`List available analytics datasets`,builder:V,handler:async e=>l({command:`analytics sql introspection get`,classification:{safeFlags:[`include-columns`,`include-custom-attributes`,`include-wae`,`include-lex`,`dry-run`]}},e,async()=>{let t={account_tag:e[`account-tag`],include_columns:e[`include-columns`],include_custom_attributes:e[`include-custom-attributes`],include_wae:e[`include-wae`],include_lex:e[`include-lex`],dataset_name:e[`dataset-name`]};if(e.dryRun){s({command:`cf analytics sql introspection get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql/introspection`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.analytics.sql.introspection.get(t)),{successLabel:`Loaded`})})},U={command:`introspection`,describe:`Operations for sql.introspection`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 analytics sql post
|
|
18
|
-
|
|
19
|
-
Executes a SQL query against the analytics datasets available to the caller. Send either raw SQL or a JSON object containing the query and optional positional or named parameters, time range, and account or zone scope. Raw SQL placeholders can also be bound with query parameters named \`param_<name>\`.`).option(`query`,{type:`string`,description:`SQL query to execute.`}).option(`scope-account-tag`,{type:`string`,description:`Account tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
|
|
17
|
+
Returns the top N results for a dataset by a specified stat. Includes an array of result rows, each containing the requested stats and group-by dimensions.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`n`,{type:`number`,description:`Maximum number of results to return.`}).option(`order-by`,{type:`string`,description:`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const L={command:`top-n <dataset>`,describe:`Query analytics top-N`,builder:I,handler:async n=>l({command:`analytics query top-n`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf analytics query top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics/query/${n.dataset==null?`<dataset>`:encodeURIComponent(String(n.dataset))}/top-n`,pathParams:{dataset:String(n.dataset??``)},bodyKind:`json`,body:n.body===void 0?p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),n:n.n,orderBy:m(n[`order-by`],`order-by`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.analytics.query.topN({...e,account_id:l,dataset:n.dataset})),{successLabel:`Created`});return}if(n.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(n.from===void 0&&(n.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),n[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(n.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);if(n.to===void 0&&(n.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),n.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);n[`order-by`]===void 0&&(n[`order-by`]=await g(`order-by`,`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`));let u=p({filters:f(n.filters,`filters`),from:m(n.from,`from`,`text`),groupBy:n[`group-by`],stats:n.stats,to:m(n.to,`to`,`text`),n:n.n,orderBy:m(n[`order-by`],`order-by`,`text`)});o(await c(`Creating`,async()=>i.analytics.query.topN({...u,account_id:l,dataset:n.dataset})),{successLabel:`Created`})})},R={command:`query`,describe:`Operations for query`,builder:e=>e.command(N).command(F).command(L).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage("$0 analytics sql get\n\nExecutes a SQL query against the analytics datasets available to the caller. SQL placeholders can be bound with query parameters named `param_<name>`, such as `param_status=404` for `$status`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").option(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Query analytics datasets`,builder:z,handler:async e=>l({command:`analytics sql get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={query:e.query};if(e.dryRun){s({command:`cf analytics sql get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.analytics.sql.get(t)),{successLabel:`Loaded`})})};function V(e){return e.usage("$0 analytics sql introspection get\n\nReturns the analytics dataset catalogue. By default, the response contains dataset names, titles, descriptions, and kinds. Set `include_columns` to include each dataset's column names, descriptions, and data types. The caller must have Account Analytics Read permission on the account identified by `account_tag`. Dataset names, descriptions, and columns are the same for every authorized account. When `include_custom_attributes` is set, the response also includes custom attribute names and types discovered from that account's own data, which legitimately differs per caller. The catalogue lists the datasets this deployment is able to describe, which is not a fixed list. Some datasets are described by the service that owns them and are listed only where that service is available, so the same account may see a different catalogue in different environments, and datasets may appear or disappear without a change to this API. Clients should query the catalogue rather than hard-coding it, and should not treat a dataset's absence as proof that it does not exist. Workers Analytics Engine datasets are named by the account that writes them, so they are discovered from that account's own data rather than from a fixed list. They appear as `events.analyticsEngine.<dataset_name>` and differ per account. A dataset is listed for as long as any of its data is retained, so it does not disappear from the catalogue merely because writes have stopped. An account with a very large number of datasets may receive a truncated list. Set `include_wae=false` to omit them. Log Explorer datasets are listed only where the account has them, so they differ per account and are not part of the static catalogue. Set `include_lex=false` to omit them.").option(`account-tag`,{type:`string`,description:`Account whose available analytics datasets are returned.`,demandOption:!0}).option(`include-columns`,{type:`boolean`,description:`Include column metadata for each returned dataset.`}).option(`include-custom-attributes`,{type:`boolean`,description:`Include a capped set of custom attribute names and types observed during the preceding seven days. Requires a nonempty dataset_name.`}).option(`include-wae`,{type:`boolean`,description:"Include Workers Analytics Engine datasets, which are discovered from the account's own data. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`include-lex`,{type:`boolean`,description:"Include Log Explorer datasets, which are listed only where the account has them. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`dataset-name`,{type:`string`,description:"Return only the dataset with this exact name. An empty value is treated as if the parameter had been omitted, and does not filter the catalogue. A name that matches no dataset in this deployment's catalogue is rejected with `422`; a dataset that exists but is not describable here is rejected identically, so the two cases cannot be told apart.\n\nA Workers Analytics Engine dataset is named in full, as `events.analyticsEngine.<dataset_name>`; the namespace on its own returns every such dataset the account has. A `dataset_name` the account does not have is rejected with `422` like any other unknown name."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`List available analytics datasets`,builder:V,handler:async e=>l({command:`analytics sql introspection get`,classification:{safeFlags:[`include-columns`,`include-custom-attributes`,`include-wae`,`include-lex`,`dry-run`]}},e,async()=>{let t={account_tag:e[`account-tag`],include_columns:e[`include-columns`],include_custom_attributes:e[`include-custom-attributes`],include_wae:e[`include-wae`],include_lex:e[`include-lex`],dataset_name:e[`dataset-name`]};if(e.dryRun){s({command:`cf analytics sql introspection get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql/introspection`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.analytics.sql.introspection.get(t)),{successLabel:`Loaded`})})},U={command:`introspection`,describe:`Operations for sql.introspection`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage("$0 analytics sql post\n\nExecutes a SQL query against the analytics datasets available to the caller. Send either raw SQL or a JSON object containing the query and optional positional or named parameters, time range, and account or zone scope. Raw SQL placeholders can also be bound with query parameters named `param_<name>`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").option(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset.
|
|
18
|
+
`}).option(`scope-account-tag`,{type:`string`,description:`Account tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
|
|
20
19
|
`}).option(`scope-zone-tag`,{type:`string`,description:`Zone tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
|
|
21
|
-
`}).option(`time-range-end`,{type:`string`,description:`Inclusive upper bound for the dataset's timestamp column.`}).option(`time-range-start`,{type:`string`,description:`Inclusive lower bound for the dataset's timestamp column.`}).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`}).conflicts(`scope-account-tag`,[`scope-zone-tag`]).conflicts(`scope-zone-tag`,[`scope-account-tag`]).check(e=>{if([`time-range-end`,`time-range-start`].some(t=>e[t]!==void 0)){let t=[`time-range-start`].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 --time_range-* flag is set`)}return!0})}const G={command:`post`,describe:`Query analytics datasets`,builder:W,handler:async e=>l({command:`analytics sql post`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics sql post`,method:`POST`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?p({query:m(e.query,`query`,`text`),scope:{accountTag:m(e[`scope-account-tag`],`scope-account-tag`,`text`),zoneTag:m(e[`scope-zone-tag`],`scope-zone-tag`,`text`)},time_range:{end:m(e[`time-range-end`],`time-range-end`,`text`),start:m(e[`time-range-start`],`time-range-start`,`text`)}}):d(e.body):{file:e.file}});return}let t=await a(e);if(e.file){let n=h(e.file);o(await c(`Creating`,async()=>i(t,`POST`,`/analytics/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let n=d(e.body);o(await c(`Creating`,async()=>i(t,`POST`,`/analytics/sql`,{body:n})),{successLabel:`Created`});return}e.query===void 0&&(e.query=await g(`query`,`SQL query to execute
|
|
20
|
+
`}).option(`time-range-end`,{type:`string`,description:`Inclusive upper bound for the dataset's timestamp column.`}).option(`time-range-start`,{type:`string`,description:`Inclusive lower bound for the dataset's timestamp column.`}).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`}).conflicts(`scope-account-tag`,[`scope-zone-tag`]).conflicts(`scope-zone-tag`,[`scope-account-tag`]).check(e=>{if([`time-range-end`,`time-range-start`].some(t=>e[t]!==void 0)){let t=[`time-range-start`].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 --time_range-* flag is set`)}return!0})}const G={command:`post`,describe:`Query analytics datasets`,builder:W,handler:async e=>l({command:`analytics sql post`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics sql post`,method:`POST`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?p({query:m(e.query,`query`,`text`),scope:{accountTag:m(e[`scope-account-tag`],`scope-account-tag`,`text`),zoneTag:m(e[`scope-zone-tag`],`scope-zone-tag`,`text`)},time_range:{end:m(e[`time-range-end`],`time-range-end`,`text`),start:m(e[`time-range-start`],`time-range-start`,`text`)}}):d(e.body):{file:e.file}});return}let t=await a(e);if(e.file){let n=h(e.file);o(await c(`Creating`,async()=>i(t,`POST`,`/analytics/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let n=d(e.body);o(await c(`Creating`,async()=>i(t,`POST`,`/analytics/sql`,{body:n})),{successLabel:`Created`});return}e.query===void 0&&(e.query=await g(`query`,`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset. `));let n={};e.query!==void 0&&u(n,[`query`],m(e.query,`query`,`text`)),e[`scope-account-tag`]!==void 0&&u(n,[`scope`,`accountTag`],m(e[`scope-account-tag`],`scope-account-tag`,`text`)),e[`scope-zone-tag`]!==void 0&&u(n,[`scope`,`zoneTag`],m(e[`scope-zone-tag`],`scope-zone-tag`,`text`)),e[`time-range-end`]!==void 0&&u(n,[`time_range`,`end`],m(e[`time-range-end`],`time-range-end`,`text`)),e[`time-range-start`]!==void 0&&u(n,[`time_range`,`start`],m(e[`time-range-start`],`time-range-start`,`text`)),o(await c(`Creating`,async()=>i(t,`POST`,`/analytics/sql`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Created`})})},K={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(B).command(G).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`analytics`,describe:`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,builder:e=>e.command(S).command(R).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{a as r,r as i}from"./auth-C_-fMmUL.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-BtNgm5yx.mjs";import{t as c}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as l,t as u}from"./input-validation-Dk52b0me.mjs";function d(e){return e.usage(`$0 analytics_engine sql query
|
|
3
3
|
|
|
4
4
|
Executes a SQL query against Workers Analytics Engine data. Pass the SQL query in the request body as plain text. The response uses newline-delimited JSON (NDJSON) by default, or a single JSON object when the query includes a FORMAT JSON clause. Prefer this method for longer queries that may exceed URL length limits.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const f={command:`query`,describe:`Execute an Analytics Engine SQL query via request body`,builder:d,handler:async d=>c({command:`analytics_engine sql query`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf analytics_engine sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics_engine/sql`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await n();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Loading`,async()=>r(c,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Loading`,async()=>r(c,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}a(await s(`Loading`,async()=>c.analyticsEngine.sql.query({account_id:f})),{successLabel:`Loaded`})})},p={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`analytics_engine`,describe:`analytics_engine`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,i as n,t as r}from"./context-Cibc7DIM.mjs";import{a as i,r as a}from"./auth-C_-fMmUL.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-BtNgm5yx.mjs";import{t as l}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-CbKaAX24.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 api-security schema-validation schemas create
|
|
3
3
|
|
|
4
4
|
Uploads an OpenAPI schema that defines expected request formats for API operations.`).option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Upload a schema`,builder:ee,handler:async e=>l({command:`api-security schema-validation schemas create`,classification:{safeFlags:[`kind`,`validation-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf api-security schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({kind:p(e.kind,`kind`,`text`),name:p(e.name,`name`,`text`),source:p(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]}):u(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=u(e.body);o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...n,zone_id:r})),{successLabel:`Created`});return}if(e.kind===void 0&&(e.kind=await h(`kind`,`The kind of the schema`,[`openapi_v3`])),e.name===void 0&&(e.name=await m(`name`,`A human-readable name for the schema`)),e.source===void 0&&(e.source=await m(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),e[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let i=f({kind:p(e.kind,`kind`,`text`),name:p(e.name,`name`,`text`),source:p(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]});o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...i,zone_id:r})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 api-security schema-validation schemas delete <schema-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e}from"./context-
|
|
2
|
+
import{i as e}from"./context-Cibc7DIM.mjs";import{r as t}from"./auth-C_-fMmUL.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-BtNgm5yx.mjs";import{t as a}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as o,t as s}from"./body-parser-hh2avzkz.mjs";import{n as c}from"./input-validation-Dk52b0me.mjs";import{i as l}from"./prompt-CbKaAX24.mjs";function u(e){return e.usage(`$0 argo smart-routing edit
|
|
3
3
|
|
|
4
4
|
Configures the value of the Argo Smart Routing enablement setting.`).option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const d={command:`edit`,describe:`Patch Argo Smart Routing setting`,builder:u,handler:async u=>a({command:`argo smart-routing edit`,classification:{safeFlags:[`value`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({value:c(u.value,`value`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.argo.smartRouting.edit({...e,zone_id:d})),{successLabel:`Updated`});return}u.value===void 0&&(u.value=await l(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let f=s({value:c(u.value,`value`,`text`)});n(await i(`Updating`,async()=>a.argo.smartRouting.edit({...f,zone_id:d})),{successLabel:`Updated`})})};function f(e){return e.usage(`$0 argo smart-routing get
|
|
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-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{r}from"./auth-C_-fMmUL.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-BtNgm5yx.mjs";import{t as s}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,n as f}from"./prompt-CbKaAX24.mjs";import{t as p}from"./cli-types-DoVT5q_M.mjs";import{n as m,t as h}from"./raw-fetch-CAZrlsc6.mjs";function ee(e){return e.usage(`$0 artifacts namespaces create
|
|
3
3
|
|
|
4
4
|
Creates an empty Artifacts namespace for an account.`).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`unrestricted`,`us`,`eu`,`fedramp`],default:`unrestricted`}).option(`namespace`,{type:`string`,description:`The namespace field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a namespace`,builder:ee,handler:async f=>s({command:`artifacts namespaces create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf artifacts namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/artifacts/namespaces`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({jurisdiction:u(f.jurisdiction,`jurisdiction`,`text`),namespace:u(f.namespace,`namespace`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.artifacts.namespaces.create({...e,account_id:p})),{successLabel:`Created`});return}f.namespace===void 0&&(f.namespace=await d(`namespace`,`The namespace field`));let m=l({jurisdiction:u(f.jurisdiction,`jurisdiction`,`text`),namespace:u(f.namespace,`namespace`,`text`)});i(await o(`Creating`,async()=>s.artifacts.namespaces.create({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 artifacts namespaces delete <namespace>
|
|
5
5
|
|
|
@@ -39,5 +39,5 @@ Returns decoded entries for an immutable Git tree object. Tree responses are cac
|
|
|
39
39
|
|
|
40
40
|
Creates a scoped Git token for a repository.`).positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`repo`,{type:`string`,description:`The repo field`}).option(`scope`,{type:`string`,description:`The scope field`,choices:[`read`,`write`]}).option(`ttl`,{type:`number`,description:`The ttl field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`create <namespace>`,describe:`Create a repository token`,builder:ae,handler:async f=>s({command:`artifacts namespaces tokens create`,classification:{safeFlags:[`scope`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf artifacts namespaces tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/artifacts/namespaces/${f.namespace==null?`<namespace>`:encodeURIComponent(String(f.namespace))}/tokens`,pathParams:{namespace:String(f.namespace??``)},bodyKind:`json`,body:f.body===void 0?l({repo:u(f.repo,`repo`,`text`),scope:u(f.scope,`scope`,`text`),ttl:f.ttl}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.artifacts.namespaces.tokens.create({...e,account_id:p,namespace:f.namespace})),{successLabel:`Created`});return}f.repo===void 0&&(f.repo=await d(`repo`,`The repo field`));let m=l({repo:u(f.repo,`repo`,`text`),scope:u(f.scope,`scope`,`text`),ttl:f.ttl});i(await o(`Creating`,async()=>s.artifacts.namespaces.tokens.create({...m,account_id:p,namespace:f.namespace})),{successLabel:`Created`})})};function $(e){return e.usage(`$0 artifacts namespaces tokens revoke <id>
|
|
41
41
|
|
|
42
|
-
Revokes an Artifacts repository token.`).positional(`id`,{type:`string`,description:`Token ID. Must match /^[0-9a-z]{16}$/.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,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 se={command:`revoke <id>`,describe:`Revoke a token`,builder:$,handler:async c=>s({command:`artifacts namespaces tokens revoke`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf artifacts namespaces tokens revoke`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/artifacts/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tokens/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{namespace:String(c.namespace??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
42
|
+
Revokes an Artifacts repository token. Token IDs are resolved through an eventually consistent index, so revoking a token within about a second of creating it can return 404; retry after a short delay.`).positional(`id`,{type:`string`,description:`Token ID. Must match /^[0-9a-z]{16}$/.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,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 se={command:`revoke <id>`,describe:`Revoke a token`,builder:$,handler:async c=>s({command:`artifacts namespaces tokens revoke`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf artifacts namespaces tokens revoke`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/artifacts/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tokens/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{namespace:String(c.namespace??``),id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
43
43
|
`);return}i(await o(`Deleting`,async()=>s.artifacts.namespaces.tokens.revoke({account_id:l,namespace:c.namespace,id:c.id})),{successLabel:`Deleted`})})},ce={command:`tokens`,describe:`Operations for namespaces.tokens`,builder:e=>e.command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(g).command(v).command(b).command(S).command(ie).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ue={command:`artifacts`,describe:`artifacts`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ue as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-B5oRPTEN.mjs";import{a as t,t as n}from"./context-Cibc7DIM.mjs";import{r}from"./auth-C_-fMmUL.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-BtNgm5yx.mjs";import{t as s}from"./run-BqAAX99Z.mjs";import"./telemetry-DNHEg6tE.mjs";import{t as c}from"./cli-types-DoVT5q_M.mjs";function l(e){return e.usage(`$0 audit-logs list
|
|
3
3
|
|
|
4
4
|
Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.`).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`export`,{type:`boolean`,description:`Indicates that this request is an export of logs in CSV format.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-ip`,{type:`string`,description:`Filters by the IP address of the request that made the change by specific IP address or valid CIDR Range.`}).option(`actor-email`,{type:`string`,description:`Filters by the email address of the actor that made the change.`}).option(`since`,{type:`string`,description:"Limits the returned results to logs newer than the specified date. A `full-date` that conforms to RFC3339."}).option(`before`,{type:`string`,description:"Limits the returned results to logs older than the specified date. A `full-date` that conforms to RFC3339."}).option(`zone-name`,{type:`string`,description:`Filters by the name of the zone associated to the change.`}).option(`direction`,{type:`string`,description:`Changes the direction of the chronological sorting.`,choices:[`desc`,`asc`]}).option(`per-page`,{type:`number`,description:`Sets the number of results to return per page.`}).option(`page`,{type:`number`,description:`Defines which page of results to return.`}).option(`hide-user-logs`,{type:`boolean`,description:`Indicates whether or not to hide user level audit logs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Get account audit logs`,builder:c(l),handler:async c=>s({command:`audit-logs list`,classification:{safeFlags:[`export`,`direction`,`hide-user-logs`,`dry-run`]}},c,async()=>{let s={id:c.id,export:c.export,"action.type":c[`action-type`],"actor.ip":c[`actor-ip`],"actor.email":c[`actor-email`],since:c.since,before:c.before,"zone.name":c[`zone-name`],direction:c.direction,per_page:c[`per-page`],page:c.page,hide_user_logs:c[`hide-user-logs`]};if(c.dryRun){a({command:`cf audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/audit_logs`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.auditLogs.list({account_id:u,...s})),{successLabel:`Loaded`})})},d={command:`audit-logs`,describe:`audit-logs`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,r as t,t as n}from"./sdk-
|
|
2
|
+
import{n as e,r as t,t as n}from"./sdk-BCzcRJCi.mjs";import{G as r}from"./dist-BuCJ_55d.mjs";import{o as i}from"./chunk-FT2NMTJB-1VFYM1Ro.mjs";import{a,n as o}from"./context-Cibc7DIM.mjs";import{s}from"./oauth-BYkPua5f.mjs";import{n as c}from"./request-headers-B72_sA_G.mjs";const l=3e4,u=e.Default;function d(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function f(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function p(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function m(e,t,n){if(!(n==null||n===``)){if(Array.isArray(n)){for(let r of n)m(e,t,r);return}e.append(t,String(n))}}function h(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))m(t,n,r);return t.toString()}function g(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=h(n??{});return a&&(i.search=a),i.toString()}const _=new WeakMap;async function v(e,n,r,i={}){let a=g(r,_.get(e)??u,i.query),o={...i.headers},s;i.body!==void 0&&(d(i.body)||typeof i.body==`string`&&f(o)?s=i.body:(o[`Content-Type`]??=`application/json`,s=JSON.stringify(i.body)));let c;try{c=await e.fetch(a,{method:n,headers:o,body:s,signal:i.signal},{timeoutInSeconds:i.timeout?i.timeout/1e3:void 0,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e instanceof Error&&e.name===`AbortError`?Error(`Request timed out after ${i.timeout??3e4}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!c.ok)throw new t({statusCode:c.status,body:await p(c),rawResponse:{status:c.status,statusText:c.statusText,url:c.url||a,headers:c.headers,redirected:c.redirected,type:c.type}});if(c.status===204)return null;let l=c.headers.get(`content-type`)??``;if(!l.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await c.arrayBuffer());let m=await c.text();if(m===``)return null;if(!l.includes(`application/json`))return m;let h=JSON.parse(m);if(h.success===!1)throw new t({message:`API error: ${h.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`}`,statusCode:c.status,body:h});return`result`in h?h.result:h}function y(e){let t=e.baseURL??u,r=new n({baseUrl:t,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??3e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch});return _.set(r,t),r}async function b(){let e=i({allowGlobalAuthKey:!1});if(e&&`apiToken`in e)return e.apiToken;let t=await s();if(t)return t;throw Error(`No authentication token found.
|
|
3
3
|
|
|
4
4
|
Please set one of the following:
|
|
5
5
|
1. Set the CLOUDFLARE_API_TOKEN environment variable
|
|
6
6
|
2. Run 'cf auth login' to authenticate via OAuth
|
|
7
7
|
|
|
8
|
-
For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function x(e){let t=await a();if(t)return t;try{let t=await b(),n=r({compliance_region:await o()}),i=e-Date.now();if(i<=0)return;let a=y({apiToken:t,baseURL:n,defaultHeaders:c()}),s={timeoutInSeconds:i/1e3,maxRetries:0},[l,u]=await Promise.allSettled([a.accounts.list({per_page:50},s),a.user.memberships.list({per_page:50},s)]);if(l.status===`rejected`)return;let d=l.value;if((d.result_info?.total_count??d.result.length)>d.result.length)return;let f=d.result;if(u.status===`fulfilled`){let e=u.value.result??[];if((u.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));f=f.filter(e=>t.has(e.id))}return f.length===1?f[0]?.id:void 0}catch{return}}async function S(e){let t=r({compliance_region:await o()});if(e.local){let{createLocalFetch:n}=await import(`./local-
|
|
8
|
+
For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function x(e){let t=await a();if(t)return t;try{let t=await b(),n=r({compliance_region:await o()}),i=e-Date.now();if(i<=0)return;let a=y({apiToken:t,baseURL:n,defaultHeaders:c()}),s={timeoutInSeconds:i/1e3,maxRetries:0},[l,u]=await Promise.allSettled([a.accounts.list({per_page:50},s),a.user.memberships.list({per_page:50},s)]);if(l.status===`rejected`)return;let d=l.value;if((d.result_info?.total_count??d.result.length)>d.result.length)return;let f=d.result;if(u.status===`fulfilled`){let e=u.value.result??[];if((u.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));f=f.filter(e=>t.has(e.id))}return f.length===1?f[0]?.id:void 0}catch{return}}async function S(e){let t=r({compliance_region:await o()});if(e.local){let{createLocalFetch:n}=await import(`./local-Bj-l0TP6.mjs`);return y({apiToken:`cf-local-mode-no-auth`,baseURL:t,defaultHeaders:c(),fetch:n({persistTo:e.persistTo,apiBaseUrl:t})})}return y({apiToken:await b(),baseURL:t,defaultHeaders:c()})}export{v as a,b as i,y as n,x as o,S as r,l as t};
|