cf 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/dist/_meta/agent-context.json +12 -4
- package/dist/_meta/commands.json +2249 -262
- package/dist/_meta/hand-written-commands.json +784 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-sDBTV0qZ.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-DcNzuCue.mjs} +1 -1
- package/dist/account-BX90zXn5.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-Bz3JG5hI.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-DCuW3xyZ.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-zjfShZLS.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-DORQ64Ux.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BgPR_aQr.mjs} +1 -1
- package/dist/agent-memory-C0hAUMeC.mjs +6 -0
- package/dist/ai-BpEBGMT2.mjs +5 -0
- package/dist/ai-audit-DnU3vn3E.mjs +2 -0
- package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
- package/dist/ai-search-DKbN9Tyd.mjs +7 -0
- package/dist/ai-security-C_I5lo58.mjs +4 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-4T8gmZs-.mjs} +1 -1
- package/dist/analytics-Bxh4TCP7.mjs +3 -0
- package/dist/analytics_engine-fV56bjVN.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-COk_i184.mjs} +20 -20
- package/dist/argo-DIRfvxvv.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-BBfXNfUg.mjs} +1 -1
- package/dist/audit-logs-BlOrlAWe.mjs +2 -0
- package/dist/{auth-MQEamPN9.mjs → auth-D3X9HYhD.mjs} +3 -3
- package/dist/auth-DPhNN3Ly.mjs +5 -0
- package/dist/billing-B9e4PnvN.mjs +3 -0
- package/dist/body-parser-BshbixEq.mjs +2 -0
- package/dist/bot-management-D2JVeS-V.mjs +5 -0
- package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
- package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
- package/dist/browser-run-CHGOCTdG.mjs +4 -0
- package/dist/build-D0FhOj40.mjs +8 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-C6V7PbQM.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-Bye8Tyy-.mjs} +1 -1
- package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
- package/dist/cf-Ds4JFovl.mjs +18 -0
- package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
- package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
- package/dist/cloud-connector-CL1jPQud.mjs +2 -0
- package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
- package/dist/command-C9VP3xaA.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
- package/dist/config.d.mts +1460 -1348
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
- package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-BQwyBJ4_.mjs} +1 -1
- package/dist/{containers-CKW081JA.mjs → containers-BrQtGiNp.mjs} +12 -8
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-DNzhXYkY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
- package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
- package/dist/custom-csrs-bhClr2SU.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-C0eiGvG9.mjs} +1 -1
- package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
- package/dist/custom-pages-DTINMR30.mjs +3 -0
- package/dist/d1-sKdExJYF.mjs +20 -0
- package/dist/data-security-mV3a6UfW.mjs +7 -0
- package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-CZ7bgNDu.mjs → deploy-BL59O1O1.mjs} +1 -1
- package/dist/deploy-input-Dz6q-__n.mjs +2 -0
- package/dist/{dev-V10MG-Bg.mjs → dev-BDaavgH1.mjs} +2 -2
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-CJV6qWUA.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-B5zCMusW.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
- package/dist/dist-BHi7UhXO.mjs +72 -0
- package/dist/dist-BWpErtDM.mjs +384 -0
- package/dist/{dls-BF5iN78p.mjs → dls-t0hnIe_P.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-C8FC2hbh.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-DL2V6yFm.mjs +2 -0
- package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
- package/dist/email-auth-BmYrl0pO.mjs +2 -0
- package/dist/email-routing-CF3_Z957.mjs +6 -0
- package/dist/email-security-F7OYcMkZ.mjs +18 -0
- package/dist/email-sending-EyU3WvGQ.mjs +7 -0
- package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-8YWWy4iB.mjs} +9 -9
- package/dist/flagship-C4x0l-8J.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-HR_SdUx3.mjs} +1 -1
- package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-4qOvjrTN.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-DehdYOMz.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
- package/dist/iam-DR72hmii.mjs +6 -0
- package/dist/images-CeKc5JPh.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DtFix9WL.mjs} +1 -1
- package/dist/{interactive-DtsCYfrK.mjs → interactive-C7M55Wxx.mjs} +1 -1
- package/dist/ips-CtWCjXAN.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
- package/dist/keys-BmhG6Kn1.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-BuVPAuZP.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
- package/dist/load-balancers-CylN-l7n.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-Be3lg_9E.mjs} +1 -1
- package/dist/{local-runtime-Dh3keC5v.mjs → local-runtime-Ce7k598H.mjs} +1 -1
- package/dist/logexplorer-CvRPoKbj.mjs +17 -0
- package/dist/logo-matches-Heuft3yF.mjs +2 -0
- package/dist/logos-DRYjGBDq.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-Dve9jOMp.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-SC86FE89.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
- package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
- package/dist/magic-transit-BK_3asH2.mjs +111 -0
- package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
- package/dist/matches-Iss9Fo4R.mjs +2 -0
- package/dist/mcp-8wxXT6JU.mjs +4 -0
- package/dist/mesh-Bf9UAS4J.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-ZKMFOeVz.mjs} +1 -1
- package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-B1lBARU9.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
- package/dist/oauth-DuEONNgC.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
- package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
- package/dist/observability-Jya7-zkl.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-CYxYV4e0.mjs} +6 -6
- package/dist/organizations-SacGUW44.mjs +2 -0
- package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
- package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-Ccqw2WOb.mjs} +1 -1
- package/dist/page-rules-BqEyFR2c.mjs +27 -0
- package/dist/pages-CQ7ZVWk1.mjs +14 -0
- package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
- package/dist/pipelines-6De2Pe2C.mjs +6 -0
- package/dist/precursor-iwK-1P_d.mjs +4 -0
- package/dist/progress-BqQcF5QH.mjs +2 -0
- package/dist/project-settings-C_1-JI6Y.mjs +3 -0
- package/dist/prompt-B0sWIs9c.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
- package/dist/queries-c7zvnfEQ.mjs +3 -0
- package/dist/queues-BU6y16qS.mjs +6 -0
- package/dist/r2-Jo3QMahK.mjs +24 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
- package/dist/radar-DIYAMEof.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-DewOcznT.mjs} +1 -1
- package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-cnZEVNDn.mjs} +1 -1
- package/dist/registrar-BsWr_aPM.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-BlcpUyIH.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-jifR3_Y6.mjs} +1 -1
- package/dist/reporting--1AyTV7k.mjs +2 -0
- package/dist/request-tracers-C_VX7X6-.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
- package/dist/resource-tagging-C33U6T74.mjs +2 -0
- package/dist/rules-BfjzALMi.mjs +4 -0
- package/dist/rulesets-3i_1Vwt-.mjs +5 -0
- package/dist/rum-CjmIckiR.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-1mwmslUV.mjs} +1 -1
- package/dist/schema-flags-llLJuFFw.mjs +5 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-pApmzA5B.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-DBC9WJau.mjs} +1 -1
- package/dist/security-center-Djm06dq-.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-Dj-MNXrw.mjs} +4 -4
- package/dist/shared-BJvq4DkR.mjs +290 -0
- package/dist/smart-shield--8EpJjrF.mjs +4 -0
- package/dist/snippets-Dyz0PH60.mjs +4 -0
- package/dist/{spawn-O1RS01vr.mjs → spawn-C5Z7oWdp.mjs} +108 -112
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-rAHWz8rH.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-BKepWBXj.mjs} +1 -1
- package/dist/src-gJma71Ec.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-KdFiY3ev.mjs} +1 -1
- package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-Cu3cItUg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-CKJ6Tb0M.mjs} +13 -13
- package/dist/submit-BxbKKhBn.mjs +2 -0
- package/dist/tags-DA8dq9fx.mjs +2 -0
- package/dist/tenant-DLXw48hS.mjs +2 -0
- package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-x8bj9E6b.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CNQA5Flp.mjs} +1 -1
- package/dist/tunnels-CC10EOsU.mjs +2 -0
- package/dist/turnstile-CH58hnf4.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-CmnnBm_O.mjs} +1 -1
- package/dist/url-info-BpCgdUtL.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BzuynEy1.mjs} +1 -1
- package/dist/url-scanner-APIZbhB7.mjs +2 -0
- package/dist/user-2-NGebfI.mjs +12 -0
- package/dist/values-S_bNv819.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-Bv7feLBC.mjs} +1 -1
- package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-C1UmOyzD.mjs} +1 -1
- package/dist/web3-GnUocVYH.mjs +4 -0
- package/dist/workers-J1-PLwdl.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-DCHmWOMS.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-CArfEI2c.mjs} +1 -1
- package/dist/zaraz-mg2YlR3_.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DVdUPtj1.mjs} +67 -66
- package/dist/zone-DMAfrDJX.mjs +2 -0
- package/dist/zones-CNwxUi7I.mjs +21 -0
- package/package.json +10 -7
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-input-CrvuoDGJ.mjs +0 -242
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-15-IW4jE.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-CFwRkEKw.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-BgT1vu9B.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-BlCK85Me.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-BbpcII3_.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-DuCiimXl.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-C7LBxPBt.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-DZFfafkX.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-BKHC2D1Y.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-DwCvDmaH.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-D9H2zHHI.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-2W8NLCN4.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-CWhta3x7.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-DZmBQJL9.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-CQrmWgz5.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-C98A0bqq.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-BZoaFoDE.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-4e4L9IRk.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";function a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`activate`,describe:`Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`,builder:a,handler:async a=>{if(a.dryRun){r({command:`cf zone activate`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/activation_check`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Updating`,async()=>o.zone.activate({zone_id:s})),{successLabel:`Updated`})}},s={command:`zone`,describe:`zone`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,r as o,t as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./input-validation-QDIYu7Vb.mjs";import{a as l,i as u,n as d}from"./prompt-B0sWIs9c.mjs";import{t as f}from"./cli-types-DAYeL_Mj.mjs";function ee(e){return e.option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`edit`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:ee,handler:async o=>{if(o.dryRun){r({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:{enabled:o[`value-enabled`],pool_id:c(o[`value-pool-id`],`value-pool-id`,`text`)}}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.aegis.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({value:{enabled:o[`value-enabled`],pool_id:c(o[`value-pool-id`],`value-pool-id`,`text`)}});n(await i(`Updating`,async()=>l.zones.aegis.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:m,handler:async a=>{if(a.dryRun){r({command:`cf zones aegis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.aegis.get({zone_id:s})),{successLabel:`Loaded`})}},g={command:`aegis`,describe:`Operations for aegis`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`account-id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial zone is
|
|
3
|
+
typically a partner-hosted zone or a CNAME setup.
|
|
4
|
+
`,choices:[`full`,`partial`,`secondary`,`internal`],default:`full`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Creates a new zone (domain) in your Cloudflare account. The zone is created in a pending state and must be activated by updating your domain's nameservers to point to Cloudflare, or by completing the verification process for partial (CNAME) setups.`,builder:_,handler:async e=>{if(e.dryRun){r({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({account:{id:c(e[`account-id`],`account-id`,`text`)},name:c(e.name,`name`,`text`),type:c(e.type,`type`,`text`)}):a(e.body)});return}let o=await t(e);if(e.body){let t=a(e.body);n(await i(`Creating`,async()=>o.zones.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await l(`name`,`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`));let u=s({account:{id:c(e[`account-id`],`account-id`,`text`)},name:c(e.name,`name`,`text`),type:c(e.type,`type`,`text`)});n(await i(`Creating`,async()=>o.zones.create({...u})),{successLabel:`Created`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete`,describe:`Deletes an existing zone.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await d({force:!!a.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}n(await i(`Deleting`,async()=>o.zones.delete({zone_id:s})),{successLabel:`Deleted`})}};function x(e){return e.option(`paused`,{type:`boolean`,description:`Indicates whether the zone is only using Cloudflare DNS services. A
|
|
6
|
+
true value means the zone will not receive security or performance
|
|
7
|
+
benefits.
|
|
8
|
+
`}).option(`plan-id`,{type:`string`,description:`Identifier`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial
|
|
9
|
+
zone is typically a partner-hosted zone or a CNAME setup. This
|
|
10
|
+
parameter is only available to Enterprise customers or if it has
|
|
11
|
+
been explicitly enabled on a zone.
|
|
12
|
+
`,choices:[`full`,`partial`,`secondary`,`internal`]}).option(`vanity-name-servers`,{type:`string`,array:!0,description:`An array of domains used for custom name servers. This is only
|
|
13
|
+
available for Business and Enterprise plans.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:x,handler:async o=>{if(o.dryRun){r({command:`cf zones edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({paused:o.paused,plan:{id:c(o[`plan-id`],`plan-id`,`text`)},type:c(o.type,`type`,`text`),vanity_name_servers:o[`vanity-name-servers`]}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({paused:o.paused,plan:{id:c(o[`plan-id`],`plan-id`,`text`)},type:c(o.type,`type`,`text`),vanity_name_servers:o[`vanity-name-servers`]});n(await i(`Updating`,async()=>l.zones.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function C(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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 w={command:`edit`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:C,handler:async o=>{if(o.dryRun){r({command:`cf zones fonts edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/fonts`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:c(o.value,`value`,`text`)}):a(o.body)});return}let l=await t(o),d=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.fonts.edit({...e,zone_id:d})),{successLabel:`Updated`});return}o.value===void 0&&(o.value=await u(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=s({value:c(o.value,`value`,`text`)});n(await i(`Updating`,async()=>l.zones.fonts.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:T,handler:async a=>{if(a.dryRun){r({command:`cf zones fonts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/fonts`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.fonts.get({zone_id:s})),{successLabel:`Loaded`})}},D={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Retrieves detailed information about a specific zone identified by its zone ID. Returns zone configuration, status, nameservers, and associated metadata.`,builder:O,handler:async a=>{if(a.dryRun){r({command:`cf zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.get({zone_id:s})),{successLabel:`Loaded`})}};function A(e){return e.option(`include-subdomains`,{type:`boolean`,description:`If provided, the zone hold will extend to block any subdomain of the given zone, as well
|
|
14
|
+
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
15
|
+
'example.com' and include_subdomains=true will block 'example.com',
|
|
16
|
+
'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. Zone holds cannot be enabled on CDN-only zones.`,builder:A,handler:async a=>{let o={include_subdomains:a[`include-subdomains`]};if(a.dryRun){r({command:`cf zones holds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Creating`,async()=>s.zones.holds.create({zone_id:c,...o})),{successLabel:`Created`})}};function M(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. Otherwise, the hold will be\ndisabled indefinitely. `hold_after` cannot be provided for CDN-only zones."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete`,describe:"Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. Existing zone holds can be removed from CDN-only zones when `hold_after` is not provided. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:M,handler:async a=>{let o={hold_after:a[`hold-after`]};if(a.dryRun){r({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});if(a.zoneId=c,!await d({force:!!a.force})){process.stderr.write(`Aborted.
|
|
17
|
+
`);return}n(await i(`Deleting`,async()=>s.zones.holds.delete({zone_id:c,...o})),{successLabel:`Deleted`})}};function P(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided and future-dated, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. A past-dated `hold_after` value will have\nno effect on an existing, enabled hold. Providing an empty string will set its value\nto the current time. Providing `null` will disable the hold indefinitely."}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
|
|
18
|
+
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
19
|
+
'example.com' and include_subdomains=true will block 'example.com',
|
|
20
|
+
'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`edit`,describe:"Update the `hold_after` and/or `include_subdomains` values on an existing zone hold. The hold is enabled if the `hold_after` date-time value is in the past. Existing zone holds can be removed from CDN-only zones by setting `hold_after` to `null`. Other zone hold updates cannot be made on CDN-only zones. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:P,handler:async o=>{if(o.dryRun){r({command:`cf zones holds edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({hold_after:c(o[`hold-after`],`hold-after`,`text`),include_subdomains:o[`include-subdomains`]}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.holds.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({hold_after:c(o[`hold-after`],`hold-after`,`text`),include_subdomains:o[`include-subdomains`]});n(await i(`Updating`,async()=>l.zones.holds.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:I,handler:async a=>{if(a.dryRun){r({command:`cf zones holds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.holds.get({zone_id:s})),{successLabel:`Loaded`})}},R={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(j).command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`name`,{type:`string`,description:"A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`status`,{type:`string`,description:`Specify a zone status to filter by.`,choices:[`initializing`,`pending`,`active`,`moved`]}).option(`type`,{type:`string`,description:`Zone types to filter by. Multiple types can be specified as a comma-separated list (e.g., ?type=full,partial,secondary). When this parameter is not provided, zones with type "internal" are excluded from the results.`}).option(`account-id`,{type:`string`,description:`Filter by an account ID.`}).option(`account-name`,{type:`string`,description:"An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`order`,{type:`string`,description:`Field to order zones by.`,choices:[`name`,`status`,`account.id`,`account.name`,`plan.id`]}).option(`direction`,{type:`string`,description:`Direction to order zones.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:f(z),handler:async e=>{let a={name:e.name,status:e.status,type:e.type,"account.id":e[`account-id`],"account.name":e[`account-name`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match};if(e.dryRun){r({command:`cf zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},query:a,bodyKind:`none`});return}let o=await t(e);n(await i(`Loading`,async()=>o.zones.list(a)),{successLabel:`Loaded`})}};function V(e){return e.option(`value`,{type:`number`,description:`Value of the Origin H2 Max Streams Setting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`edit`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:V,handler:async o=>{if(o.dryRun){r({command:`cf zones origin-h2-max-streams edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:o.value}):a(o.body)});return}let c=await t(o),l=await e({zone:o.zone},c,{quiet:o.quiet});if(o.zoneId=l,o.body){let e=a(o.body);n(await i(`Updating`,async()=>c.zones.originH2MaxStreams.edit({...e,zone_id:l})),{successLabel:`Updated`});return}if(o.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let u=s({value:o.value});n(await i(`Updating`,async()=>c.zones.originH2MaxStreams.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:U,handler:async a=>{if(a.dryRun){r({command:`cf zones origin-h2-max-streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.originH2MaxStreams.get({zone_id:s})),{successLabel:`Loaded`})}},G={command:`origin-h2-max-streams`,describe:`Operations for origin-h2-max-streams`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Max HTTP Version Setting.`,choices:[`2`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`edit`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:K,handler:async o=>{if(o.dryRun){r({command:`cf zones origin-max-http-version edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/origin_max_http_version`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:c(o.value,`value`,`text`)}):a(o.body)});return}let l=await t(o),d=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.originMaxHttpVersion.edit({...e,zone_id:d})),{successLabel:`Updated`});return}o.value===void 0&&(o.value=await u(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let f=s({value:c(o.value,`value`,`text`)});n(await i(`Updating`,async()=>l.zones.originMaxHttpVersion.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function J(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:J,handler:async a=>{if(a.dryRun){r({command:`cf zones origin-max-http-version get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/origin_max_http_version`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.originMaxHttpVersion.get({zone_id:s})),{successLabel:`Loaded`})}},Y={command:`origin-max-http-version`,describe:`Operations for origin-max-http-version`,builder:e=>e.command(q).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`plan-identifier`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <plan-identifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:X,handler:async a=>{if(a.dryRun){r({command:`cf zones plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_plans/${a[`plan-identifier`]==null?`<plan-identifier>`:encodeURIComponent(String(a[`plan-identifier`]))}`,pathParams:{"plan-identifier":String(a[`plan-identifier`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.plans.get({zone_id:s,plan_identifier:a[`plan-identifier`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:Q,handler:async a=>{if(a.dryRun){r({command:`cf zones plans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_plans`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.plans.list({zone_id:s})),{successLabel:`Loaded`})}},re={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:ie,handler:async a=>{if(a.dryRun){r({command:`cf zones rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_rate_plans`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.ratePlans.get({zone_id:s})),{successLabel:`Loaded`})}},oe={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`value`,{type:`string`,description:`Value can either be On or Off.`}).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:`edit`,describe:`Toggles RUM on/off for an existing zone.`,builder:se,handler:async o=>{if(o.dryRun){r({command:`cf zones rum edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/rum`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:c(o.value,`value`,`text`)}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.rum.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({value:c(o.value,`value`,`text`)});n(await i(`Updating`,async()=>l.zones.rum.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:le,handler:async a=>{if(a.dryRun){r({command:`cf zones rum get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/rum`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.rum.get({zone_id:s})),{successLabel:`Loaded`})}},de={command:`rum`,describe:`Rum operations`,builder:e=>e.command(ce).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`ssl-recommender enrollment setting.`}).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`value-cache-by-device-type`,{type:`boolean`,description:`Indicates whether or not [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) is enabled.`}).option(`value-cf`,{type:`boolean`,description:`Indicates whether or not Cloudflare proxy is enabled.`}).option(`value-hostnames`,{type:`string`,array:!0,description:`An array of hostnames where Automatic Platform Optimization for WordPress is activated.`}).option(`value-wordpress`,{type:`boolean`,description:`Indicates whether or not site is powered by WordPress.`}).option(`value-wp-plugin`,{type:`boolean`,description:`Indicates whether or not [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is installed.`}).option(`value-strict-transport-security-enabled`,{type:`boolean`,description:`Whether or not strict transport security is enabled.`}).option(`value-strict-transport-security-include-subdomains`,{type:`boolean`,description:`Include all subdomains for strict transport security.`}).option(`value-strict-transport-security-max-age`,{type:`number`,description:`Max age in seconds of the strict transport security.`}).option(`value-strict-transport-security-nosniff`,{type:`boolean`,description:`Whether or not to include 'X-Content-Type-Options: nosniff' header.`}).option(`value-strict-transport-security-preload`,{type:`boolean`,description:`Enable automatic preload of the HSTS configuration.`}).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)`}).conflicts(`value-pool-id`,[`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).conflicts(`value-cache-by-device-type`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cache-by-device-type`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`]).conflicts(`value-cf`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cf`,[`value-strict-transport-security-enabled`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-hostnames`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-hostnames`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-cache-by-device-type`]).conflicts(`value-wordpress`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wordpress`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-wp-plugin`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wp-plugin`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-hostnames`,`value-cache-by-device-type`]).implies(`value-strict-transport-security-enabled`,[`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-strict-transport-security-include-subdomains`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-max-age`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-nosniff`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-preload`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`])}const pe={command:`edit <setting-id>`,describe:`Updates a single zone setting by the identifier`,builder:fe,handler:async o=>{if(o.dryRun){r({command:`cf zones settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/${o[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(o[`setting-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"setting-id":String(o[`setting-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({enabled:o.enabled,value:{enabled:o[`value-enabled`],pool_id:c(o[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:o[`value-cache-by-device-type`],cf:o[`value-cf`],hostnames:o[`value-hostnames`],wordpress:o[`value-wordpress`],wp_plugin:o[`value-wp-plugin`],strict_transport_security:{enabled:o[`value-strict-transport-security-enabled`],include_subdomains:o[`value-strict-transport-security-include-subdomains`],max_age:o[`value-strict-transport-security-max-age`],nosniff:o[`value-strict-transport-security-nosniff`],preload:o[`value-strict-transport-security-preload`]}}}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.settings.edit({body:e,zone_id:u,setting_id:o[`setting-id`]})),{successLabel:`Updated`});return}let d=s({enabled:o.enabled,value:{enabled:o[`value-enabled`],pool_id:c(o[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:o[`value-cache-by-device-type`],cf:o[`value-cf`],hostnames:o[`value-hostnames`],wordpress:o[`value-wordpress`],wp_plugin:o[`value-wp-plugin`],strict_transport_security:{enabled:o[`value-strict-transport-security-enabled`],include_subdomains:o[`value-strict-transport-security-include-subdomains`],max_age:o[`value-strict-transport-security-max-age`],nosniff:o[`value-strict-transport-security-nosniff`],preload:o[`value-strict-transport-security-preload`]}}});n(await i(`Updating`,async()=>l.zones.settings.edit({body:d,zone_id:u,setting_id:o[`setting-id`]})),{successLabel:`Updated`})}};function me(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <setting-id>`,describe:`Fetch a single zone setting by name`,builder:me,handler:async a=>{if(a.dryRun){r({command:`cf zones settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/${a[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(a[`setting-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"setting-id":String(a[`setting-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.settings.get({zone_id:s,setting_id:a[`setting-id`]})),{successLabel:`Loaded`})}},ge={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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:`edit`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:_e,handler:async o=>{if(o.dryRun){r({command:`cf zones speed-brain edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/speed_brain`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({value:c(o.value,`value`,`text`)}):a(o.body)});return}let l=await t(o),d=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.zones.speedBrain.edit({...e,zone_id:d})),{successLabel:`Updated`});return}o.value===void 0&&(o.value=await u(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=s({value:c(o.value,`value`,`text`)});n(await i(`Updating`,async()=>l.zones.speedBrain.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:ye,handler:async a=>{if(a.dryRun){r({command:`cf zones speed-brain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/speed_brain`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.speedBrain.get({zone_id:s})),{successLabel:`Loaded`})}},$={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`create`,describe:`Create a zone subscription, either plan or add-ons.`,builder:xe,handler:async l=>{if(l.dryRun){r({command:`cf zones subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({app:{install_id:c(l[`app-install-id`],`app-install-id`,`text`)},component_values:o(l[`component-values`],`component-values`),frequency:c(l.frequency,`frequency`,`text`),rate_plan:{currency:c(l[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:l[`rate-plan-externally-managed`],id:c(l[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:l[`rate-plan-is-contract`],public_name:c(l[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(l[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:l[`rate-plan-sets`]}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.zones.subscriptions.create({body:e,zone_id:d})),{successLabel:`Created`});return}let f=s({app:{install_id:c(l[`app-install-id`],`app-install-id`,`text`)},component_values:o(l[`component-values`],`component-values`),frequency:c(l.frequency,`frequency`,`text`),rate_plan:{currency:c(l[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:l[`rate-plan-externally-managed`],id:c(l[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:l[`rate-plan-is-contract`],public_name:c(l[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(l[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:l[`rate-plan-sets`]}});n(await i(`Creating`,async()=>u.zones.subscriptions.create({body:f,zone_id:d})),{successLabel:`Created`})}};function Ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const we={command:`delete`,describe:`Deletes a zone's subscription.`,builder:Ce,handler:async a=>{if(a.dryRun){r({command:`cf zones subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await d({force:!!a.force})){process.stderr.write(`Aborted.
|
|
21
|
+
`);return}n(await i(`Deleting`,async()=>o.zones.subscriptions.delete({zone_id:s})),{successLabel:`Deleted`})}};function Te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get`,describe:`Lists zone subscription details.`,builder:Te,handler:async a=>{if(a.dryRun){r({command:`cf zones subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.zones.subscriptions.get({zone_id:s})),{successLabel:`Loaded`})}};function De(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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:`update`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:De,handler:async l=>{if(l.dryRun){r({command:`cf zones subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({app:{install_id:c(l[`app-install-id`],`app-install-id`,`text`)},component_values:o(l[`component-values`],`component-values`),frequency:c(l.frequency,`frequency`,`text`),rate_plan:{currency:c(l[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:l[`rate-plan-externally-managed`],id:c(l[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:l[`rate-plan-is-contract`],public_name:c(l[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(l[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:l[`rate-plan-sets`]}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.zones.subscriptions.update({body:e,zone_id:d})),{successLabel:`Updated`});return}let f=s({app:{install_id:c(l[`app-install-id`],`app-install-id`,`text`)},component_values:o(l[`component-values`],`component-values`),frequency:c(l.frequency,`frequency`,`text`),rate_plan:{currency:c(l[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:l[`rate-plan-externally-managed`],id:c(l[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:l[`rate-plan-is-contract`],public_name:c(l[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(l[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:l[`rate-plan-sets`]}});n(await i(`Updating`,async()=>u.zones.subscriptions.update({body:f,zone_id:d})),{successLabel:`Updated`})}},ke={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Se).command(we).command(Ee).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ae={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(v).command(b).command(S).command(k).command(B).command(g).command(D).command(R).command(G).command(Y).command(re).command(oe).command(de).command(ge).command($).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ae as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "The Cloudflare CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -46,22 +46,23 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"blake3-wasm": "2.1.5",
|
|
49
|
-
"miniflare": "5.
|
|
49
|
+
"miniflare": "5.20260915.0-alpha"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@bomb.sh/tab": "0.0.15",
|
|
53
53
|
"@clack/core": "1.2.0",
|
|
54
54
|
"@clack/prompts": "^1.2.0",
|
|
55
|
-
"@cloudflare/autoconfig": "0.4.
|
|
55
|
+
"@cloudflare/autoconfig": "0.4.5",
|
|
56
56
|
"@cloudflare/build-output-utils": "0.4.0",
|
|
57
57
|
"@cloudflare/cli-shared-helpers": "^0.1.0",
|
|
58
|
-
"@cloudflare/config": "0.
|
|
59
|
-
"@cloudflare/deploy-helpers": "0.
|
|
58
|
+
"@cloudflare/config": "0.12.0",
|
|
59
|
+
"@cloudflare/deploy-helpers": "0.12.0",
|
|
60
60
|
"@cloudflare/forge": "file:../../vendor/cloudflare-forge-0.1.0.tgz",
|
|
61
61
|
"@cloudflare/forge-transformer-sdk-ts": "file:../../vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz",
|
|
62
|
-
"@cloudflare/workers-auth": "0.
|
|
63
|
-
"@cloudflare/workers-utils": "0.
|
|
62
|
+
"@cloudflare/workers-auth": "0.7.0",
|
|
63
|
+
"@cloudflare/workers-utils": "0.39.0",
|
|
64
64
|
"@types/node": "25.3.5",
|
|
65
|
+
"@types/shell-quote": "^1.7.5",
|
|
65
66
|
"@types/yargs": "17.0.35",
|
|
66
67
|
"am-i-vibing": "^0.1.1",
|
|
67
68
|
"chalk": "5.6.2",
|
|
@@ -70,8 +71,10 @@
|
|
|
70
71
|
"figures": "6.1.0",
|
|
71
72
|
"minimatch": "10.2.5",
|
|
72
73
|
"msw": "2.14.6",
|
|
74
|
+
"shell-quote": "^1.8.1",
|
|
73
75
|
"tsdown": "^0.21.0",
|
|
74
76
|
"tsx": "4.21.0",
|
|
77
|
+
"undici": "7.28.0",
|
|
75
78
|
"vitest": "4.1.0",
|
|
76
79
|
"yargs": "18.0.0",
|
|
77
80
|
"zod": "4.4.3"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u}from"./prompt-DdegNPpg.mjs";function d(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:d,handler:async e=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)}):s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await u(`destination-organization-id`,`Move accounts to this organization ID.`));let n=c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})}},p={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const h={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:m,handler:async d=>{if(d.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.account.move({...e,account_id:p})),{successLabel:`Created`});return}d[`destination-organization-id`]===void 0&&(d[`destination-organization-id`]=await u(`destination-organization-id`,`The destination_organization_id field`));let m=c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>f.account.move({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.account.organization.list({account_id:l})),{successLabel:`Loaded`})}},v={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.account.profile.get({account_id:l})),{successLabel:`Loaded`})}};function x(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 S={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:x,handler:async d=>{if(d.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}d[`business-address`]===void 0&&(d[`business-address`]=await u(`business-address`,`The business_address field`)),d[`business-email`]===void 0&&(d[`business-email`]=await u(`business-email`,`The business_email field`)),d[`business-name`]===void 0&&(d[`business-name`]=await u(`business-name`,`The business_name field`)),d[`business-phone`]===void 0&&(d[`business-phone`]=await u(`business-phone`,`The business_phone field`)),d[`external-metadata`]===void 0&&(d[`external-metadata`]=await u(`external-metadata`,`The external_metadata field`));let m=c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>f.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})}},C={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`account`,describe:`account`,builder:e=>e.command(h).command(p).command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Namespace name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create-namespace`,describe:`Creates a new memory namespace owned by the account.`,builder:p,handler:async d=>{if(d.dryRun){a({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.agentMemory.createNamespace({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Namespace name.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.createNamespace({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile 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 g={command:`delete-memory <memory-id>`,describe:`Deletes a memory by ID. Removes the memory and any source messages linked to it. Returns the deleted memory.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-memory`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories/${s[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(s[`memory-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"memory-id":String(s[`memory-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation deletes the memory and any source messages linked to it.`})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteMemory({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],memory_id:s[`memory-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`namespace-name`,{type:`string`,description:`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 v={command:`delete-namespace <namespace-name>`,describe:`Deletes a namespace.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-namespace`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation deletes the namespace along with all memory profiles, memories, and sessions it contains.`})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteNamespace({account_id:l,namespace_name:s[`namespace-name`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`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 b={command:`delete-profile <profile-name>`,describe:`Marks a profile for deletion.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-profile`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation deletes the profile along with all of its memories and messages.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteProfile({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`session-id`,{type:`string`,description:`Session identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile 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 S={command:`delete-session <session-id>`,describe:`Marks all memories and messages in a profile that are tagged with the given session ID for deletion.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-session`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/sessions/${s[`session-id`]==null?`<session-id>`:encodeURIComponent(String(s[`session-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"session-id":String(s[`session-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation deletes all memories and messages tagged with this session ID.`})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteSession({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],session_id:s[`session-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get-memory <memory-id>`,describe:`Retrieves a memory by ID.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory get-memory`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories/${s[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(s[`memory-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"memory-id":String(s[`memory-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.agentMemory.getMemory({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],memory_id:s[`memory-id`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get-namespace <namespace-name>`,describe:`Gets a namespace by name.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory get-namespace`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.agentMemory.getNamespace({account_id:l,namespace_name:s[`namespace-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Session identifier.`}).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 O={command:`ingest <profile-name>`,describe:`Processes a conversation and extracts structured memories from it. Agent Memory identifies facts, events, instructions, and tasks automatically.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf agent-memory ingest`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${u[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(u[`namespace-name`]))}/profiles/${u[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(u[`profile-name`]))}/ingest`,pathParams:{"namespace-name":String(u[`namespace-name`]??``),"profile-name":String(u[`profile-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({sessionId:l(u[`session-id`],`session-id`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.agentMemory.ingest({...e,account_id:f,namespace_name:u[`namespace-name`],profile_name:u[`profile-name`]})),{successLabel:`Created`});return}let p=c({sessionId:l(u[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>d.agentMemory.ingest({...p,account_id:f,namespace_name:u[`namespace-name`],profile_name:u[`profile-name`]})),{successLabel:`Created`})}};function k(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Continuation cursor for paginated results.`}).option(`session-id`,{type:`string`,description:`Session identifier for filtering.`}).option(`type`,{type:`string`,description:`Memory type for filtering.`,choices:[`fact`,`event`,`instruction`,`task`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list-memories <profile-name>`,describe:`List memories stored in a profile.`,builder:f(k),handler:async s=>{let c={per_page:s[`per-page`],cursor:s.cursor,session_id:s[`session-id`],type:s.type};if(s.dryRun){a({command:`cf agent-memory list-memories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listMemories({account_id:u,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`order`,{type:`string`,description:`Field to order the results by.`,choices:[`id`,`name`]}).option(`direction`,{type:`string`,description:`Direction to sort the results in.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor returned by a previous list response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-namespaces`,describe:`Lists all namespaces for the given account. Results are paginated.`,builder:f(j),handler:async s=>{let c={per_page:s[`per-page`],order:s.order,direction:s.direction,cursor:s.cursor};if(s.dryRun){a({command:`cf agent-memory list-namespaces`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listNamespaces({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque continuation cursor returned by a previous list response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list-profiles <namespace-name>`,describe:`Lists the profiles of a namespace, ordered by name. A profile appears once it has been used.`,builder:N,handler:async s=>{let c={per_page:s[`per-page`],cursor:s.cursor};if(s.dryRun){a({command:`cf agent-memory list-profiles`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listProfiles({account_id:u,namespace_name:s[`namespace-name`],...c})),{successLabel:`Loaded`})}};function F(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`query`,{type:`string`,description:`Natural-language query to match against stored memories.`}).option(`reference-date`,{type:`string`,description:`Temporal anchor for relative date references in the query.`}).option(`response-length`,{type:`string`,description:`Verbosity of the synthesized answer. Defaults to 'medium'.`,choices:[`short`,`medium`,`long`]}).option(`thinking-level`,{type:`string`,description:`Recall intensity / search depth. Defaults to 'low'.`,choices:[`low`,`medium`,`high`]}).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 I={command:`recall <profile-name>`,describe:`Retrieves memories relevant to the query and returns a synthesized answer.`,builder:F,handler:async d=>{if(d.dryRun){a({command:`cf agent-memory recall`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${d[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(d[`namespace-name`]))}/profiles/${d[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(d[`profile-name`]))}/recall`,pathParams:{"namespace-name":String(d[`namespace-name`]??``),"profile-name":String(d[`profile-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({query:l(d.query,`query`,`text`),referenceDate:l(d[`reference-date`],`reference-date`,`text`),responseLength:l(d[`response-length`],`response-length`,`text`),thinkingLevel:l(d[`thinking-level`],`thinking-level`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.agentMemory.recall({...e,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`});return}d.query===void 0&&(d.query=await u(`query`,`Natural-language query to match against stored memories.`));let m=c({query:l(d.query,`query`,`text`),referenceDate:l(d[`reference-date`],`reference-date`,`text`),responseLength:l(d[`response-length`],`response-length`,`text`),thinkingLevel:l(d[`thinking-level`],`thinking-level`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.recall({...m,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`})}};function L(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`content`,{type:`string`,description:`Raw memory content to store.`}).option(`session-id`,{type:`string`,description:`Session identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`remember <profile-name>`,describe:`Stores a single memory explicitly.`,builder:L,handler:async d=>{if(d.dryRun){a({command:`cf agent-memory remember`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${d[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(d[`namespace-name`]))}/profiles/${d[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(d[`profile-name`]))}/remember`,pathParams:{"namespace-name":String(d[`namespace-name`]??``),"profile-name":String(d[`profile-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({content:l(d.content,`content`,`text`),sessionId:l(d[`session-id`],`session-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.agentMemory.remember({...e,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`});return}d.content===void 0&&(d.content=await u(`content`,`Raw memory content to store.`));let m=c({content:l(d.content,`content`,`text`),sessionId:l(d[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.remember({...m,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`})}};function z(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Session identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`summary <profile-name>`,describe:`Generates a paste-ready prompt block summarizing everything stored in a memory profile.`,builder:z,handler:async u=>{if(u.dryRun){a({command:`cf agent-memory summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${u[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(u[`namespace-name`]))}/profiles/${u[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(u[`profile-name`]))}/summary`,pathParams:{"namespace-name":String(u[`namespace-name`]??``),"profile-name":String(u[`profile-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({sessionId:l(u[`session-id`],`session-id`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.agentMemory.summary({...e,account_id:f,namespace_name:u[`namespace-name`],profile_name:u[`profile-name`]})),{successLabel:`Created`});return}let p=c({sessionId:l(u[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>d.agentMemory.summary({...p,account_id:f,namespace_name:u[`namespace-name`],profile_name:u[`profile-name`]})),{successLabel:`Created`})}},V={command:`agent-memory`,describe:`agent-memory`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(M).command(P).command(I).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-B0ETkNcX.mjs";import{a as t,r as n}from"./auth-MQEamPN9.mjs";import{t as r}from"./output-DrpYYfnB.mjs";import{n as i,t as a}from"./progress-CsHIt3Tp.mjs";import{n as o}from"./body-parser-C-c9gfH1.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const c={command:`bulk-get`,describe:`Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`,builder:s,handler:async s=>{if(s.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s);if(s.zoneId=await e({zone:s.zone},c,{quiet:s.quiet}),s.body){let e=o(s.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let o=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:o}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function l(e){return e.option(`subdomain`,{type:`string`,description:`Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.`,builder:l,handler:async t=>{let o={subdomain:t.subdomain};if(t.dryRun){i({command:`cf ai-audit robots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/ai-audit/robots`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.aiAudit.robots.get({zone_id:c,...o})),{successLabel:`Loaded`})}},d={command:`robots`,describe:`Operations for robots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`ai-audit`,describe:`ai-audit`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,i as f,n as p}from"./prompt-DdegNPpg.mjs";import{t as m}from"./cli-types-BsTty22w.mjs";function ee(e){return e.option(`account-provider-id`,{type:`string`,description:`The account_provider_id field`}).option(`cost-in`,{type:`number`,description:`The cost_in field`}).option(`cost-out`,{type:`number`,description:`The cost_out field`}).option(`cost-type`,{type:`string`,description:`The cost_type field`,default:`tokens`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`model`,{type:`string`,description:`The model field`}).option(`model-rule`,{type:`string`,description:`The model_rule field`,choices:[`equals`,`starts-with`,`contains`],default:`equals`}).option(`token-pricing-input-audio-tokens`,{type:`number`,description:`The token_pricing.input_audio_tokens field`}).option(`token-pricing-input-cache-creation-tokens`,{type:`number`,description:`The token_pricing.input_cache_creation_tokens field`}).option(`token-pricing-input-cached-tokens`,{type:`number`,description:`The token_pricing.input_cached_tokens field`}).option(`token-pricing-input-image-count`,{type:`number`,description:`The token_pricing.input_image_count field`}).option(`token-pricing-input-image-tokens`,{type:`number`,description:`The token_pricing.input_image_tokens field`}).option(`token-pricing-input-text-tokens`,{type:`number`,description:`The token_pricing.input_text_tokens field`}).option(`token-pricing-input-tokens`,{type:`number`,description:`The token_pricing.input_tokens field`}).option(`token-pricing-input-video-tokens`,{type:`number`,description:`The token_pricing.input_video_tokens field`}).option(`token-pricing-output-image-count`,{type:`number`,description:`The token_pricing.output_image_count field`}).option(`token-pricing-output-reasoning-tokens`,{type:`number`,description:`The token_pricing.output_reasoning_tokens field`}).option(`token-pricing-output-tokens`,{type:`number`,description:`The token_pricing.output_tokens field`}).option(`token-pricing-total-tokens`,{type:`number`,description:`The token_pricing.total_tokens 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 te={command:`create`,describe:`Creates a new AI Gateway.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers costs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/costs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({account_provider_id:u(r[`account-provider-id`],`account-provider-id`,`text`),cost_in:r[`cost-in`],cost_out:r[`cost-out`],cost_type:u(r[`cost-type`],`cost-type`,`text`),enable:r.enable,model:u(r.model,`model`,`text`),model_rule:u(r[`model-rule`],`model-rule`,`text`),token_pricing:{input_audio_tokens:r[`token-pricing-input-audio-tokens`],input_cache_creation_tokens:r[`token-pricing-input-cache-creation-tokens`],input_cached_tokens:r[`token-pricing-input-cached-tokens`],input_image_count:r[`token-pricing-input-image-count`],input_image_tokens:r[`token-pricing-input-image-tokens`],input_text_tokens:r[`token-pricing-input-text-tokens`],input_tokens:r[`token-pricing-input-tokens`],input_video_tokens:r[`token-pricing-input-video-tokens`],output_image_count:r[`token-pricing-output-image-count`],output_reasoning_tokens:r[`token-pricing-output-reasoning-tokens`],output_tokens:r[`token-pricing-output-tokens`],total_tokens:r[`token-pricing-total-tokens`]}}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.accountProviders.costs.create({...e,account_id:p})),{successLabel:`Created`});return}r[`account-provider-id`]===void 0&&(r[`account-provider-id`]=await d(`account-provider-id`,`The account_provider_id field`)),r.model===void 0&&(r.model=await d(`model`,`The model field`));let m=l({account_provider_id:u(r[`account-provider-id`],`account-provider-id`,`text`),cost_in:r[`cost-in`],cost_out:r[`cost-out`],cost_type:u(r[`cost-type`],`cost-type`,`text`),enable:r.enable,model:u(r.model,`model`,`text`),model_rule:u(r[`model-rule`],`model-rule`,`text`),token_pricing:{input_audio_tokens:r[`token-pricing-input-audio-tokens`],input_cache_creation_tokens:r[`token-pricing-input-cache-creation-tokens`],input_cached_tokens:r[`token-pricing-input-cached-tokens`],input_image_count:r[`token-pricing-input-image-count`],input_image_tokens:r[`token-pricing-input-image-tokens`],input_text_tokens:r[`token-pricing-input-text-tokens`],input_tokens:r[`token-pricing-input-tokens`],input_video_tokens:r[`token-pricing-input-video-tokens`],output_image_count:r[`token-pricing-output-image-count`],output_reasoning_tokens:r[`token-pricing-output-reasoning-tokens`],output_tokens:r[`token-pricing-output-tokens`],total_tokens:r[`token-pricing-total-tokens`]}});a(await s(`Creating`,async()=>f.aiGateway.accountProviders.costs.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers costs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/costs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.accountProviders.costs.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function _(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers costs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/costs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.accountProviders.costs.get({account_id:l,id:r.id})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`account-provider-id`,{type:`string`,description:`Account provider ID`}).option(`model-rule`,{type:`string`,description:`Model rule`,choices:[`equals`,`starts-with`,`contains`]}).option(`cost-type`,{type:`string`,description:`Cost type`}).option(`search`,{type:`string`,description:`Search by model, changed_by`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:m(y),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],enable:r.enable,account_provider_id:r[`account-provider-id`],model_rule:r[`model-rule`],cost_type:r[`cost-type`],search:r.search};if(r.dryRun){o({command:`cf ai-gateway account-providers costs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/costs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.accountProviders.costs.list({account_id:u,...c})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`cost-in`,{type:`number`,description:`The cost_in field`}).option(`cost-out`,{type:`number`,description:`The cost_out field`}).option(`cost-type`,{type:`string`,description:`The cost_type field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`model`,{type:`string`,description:`The model field`}).option(`model-rule`,{type:`string`,description:`The model_rule field`,choices:[`equals`,`starts-with`,`contains`]}).option(`token-pricing-input-audio-tokens`,{type:`number`,description:`The token_pricing.input_audio_tokens field`}).option(`token-pricing-input-cache-creation-tokens`,{type:`number`,description:`The token_pricing.input_cache_creation_tokens field`}).option(`token-pricing-input-cached-tokens`,{type:`number`,description:`The token_pricing.input_cached_tokens field`}).option(`token-pricing-input-image-count`,{type:`number`,description:`The token_pricing.input_image_count field`}).option(`token-pricing-input-image-tokens`,{type:`number`,description:`The token_pricing.input_image_tokens field`}).option(`token-pricing-input-text-tokens`,{type:`number`,description:`The token_pricing.input_text_tokens field`}).option(`token-pricing-input-tokens`,{type:`number`,description:`The token_pricing.input_tokens field`}).option(`token-pricing-input-video-tokens`,{type:`number`,description:`The token_pricing.input_video_tokens field`}).option(`token-pricing-output-image-count`,{type:`number`,description:`The token_pricing.output_image_count field`}).option(`token-pricing-output-reasoning-tokens`,{type:`number`,description:`The token_pricing.output_reasoning_tokens field`}).option(`token-pricing-output-tokens`,{type:`number`,description:`The token_pricing.output_tokens field`}).option(`token-pricing-total-tokens`,{type:`number`,description:`The token_pricing.total_tokens 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 S={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers costs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/costs/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?l({cost_in:r[`cost-in`],cost_out:r[`cost-out`],cost_type:u(r[`cost-type`],`cost-type`,`text`),enable:r.enable,model:u(r.model,`model`,`text`),model_rule:u(r[`model-rule`],`model-rule`,`text`),token_pricing:{input_audio_tokens:r[`token-pricing-input-audio-tokens`],input_cache_creation_tokens:r[`token-pricing-input-cache-creation-tokens`],input_cached_tokens:r[`token-pricing-input-cached-tokens`],input_image_count:r[`token-pricing-input-image-count`],input_image_tokens:r[`token-pricing-input-image-tokens`],input_text_tokens:r[`token-pricing-input-text-tokens`],input_tokens:r[`token-pricing-input-tokens`],input_video_tokens:r[`token-pricing-input-video-tokens`],output_image_count:r[`token-pricing-output-image-count`],output_reasoning_tokens:r[`token-pricing-output-reasoning-tokens`],output_tokens:r[`token-pricing-output-tokens`],total_tokens:r[`token-pricing-total-tokens`]}}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.aiGateway.accountProviders.costs.update({...e,account_id:f,id:r.id})),{successLabel:`Updated`});return}let p=l({cost_in:r[`cost-in`],cost_out:r[`cost-out`],cost_type:u(r[`cost-type`],`cost-type`,`text`),enable:r.enable,model:u(r.model,`model`,`text`),model_rule:u(r[`model-rule`],`model-rule`,`text`),token_pricing:{input_audio_tokens:r[`token-pricing-input-audio-tokens`],input_cache_creation_tokens:r[`token-pricing-input-cache-creation-tokens`],input_cached_tokens:r[`token-pricing-input-cached-tokens`],input_image_count:r[`token-pricing-input-image-count`],input_image_tokens:r[`token-pricing-input-image-tokens`],input_text_tokens:r[`token-pricing-input-text-tokens`],input_tokens:r[`token-pricing-input-tokens`],input_video_tokens:r[`token-pricing-input-video-tokens`],output_image_count:r[`token-pricing-output-image-count`],output_reasoning_tokens:r[`token-pricing-output-reasoning-tokens`],output_tokens:r[`token-pricing-output-tokens`],total_tokens:r[`token-pricing-total-tokens`]}});a(await s(`Updating`,async()=>d.aiGateway.accountProviders.costs.update({...p,account_id:f,id:r.id})),{successLabel:`Updated`})}},C={command:`costs`,describe:`Operations for account-providers.costs`,builder:e=>e.command(te).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`The headers field`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Creates a new AI Gateway.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({base_url:u(r[`base-url`],`base-url`,`text`),beta:r.beta,curl_example:u(r[`curl-example`],`curl-example`,`text`),description:u(r.description,`description`,`text`),enable:r.enable,headers:u(r.headers,`headers`,`text`),js_example:u(r[`js-example`],`js-example`,`text`),link:u(r.link,`link`,`text`),name:u(r.name,`name`,`text`),position:r.position,slug:u(r.slug,`slug`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.accountProviders.create({...e,account_id:p})),{successLabel:`Created`});return}r[`base-url`]===void 0&&(r[`base-url`]=await d(`base-url`,`The base_url field`)),r.name===void 0&&(r.name=await d(`name`,`The name field`)),r.slug===void 0&&(r.slug=await d(`slug`,`The slug field`));let m=l({base_url:u(r[`base-url`],`base-url`,`text`),beta:r.beta,curl_example:u(r[`curl-example`],`curl-example`,`text`),description:u(r.description,`description`,`text`),enable:r.enable,headers:u(r.headers,`headers`,`text`),js_example:u(r[`js-example`],`js-example`,`text`),link:u(r.link,`link`,`text`),name:u(r.name,`name`,`text`),position:r.position,slug:u(r.slug,`slug`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.accountProviders.create({...m,account_id:p})),{successLabel:`Created`})}};function E(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.accountProviders.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function O(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.accountProviders.get({account_id:l,id:r.id})),{successLabel:`Loaded`})}};function A(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`beta`,{type:`boolean`,description:`Beta`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, slug`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:A,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],beta:r.beta,enable:r.enable,search:r.search};if(r.dryRun){o({command:`cf ai-gateway account-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.accountProviders.list({account_id:u,...c})),{successLabel:`Loaded`})}};function M(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`The headers field`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`logo`,{type:`string`,description:`The logo field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway account-providers update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/custom-providers/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?l({base_url:u(r[`base-url`],`base-url`,`text`),beta:r.beta,curl_example:u(r[`curl-example`],`curl-example`,`text`),description:u(r.description,`description`,`text`),enable:r.enable,headers:u(r.headers,`headers`,`text`),js_example:u(r[`js-example`],`js-example`,`text`),link:u(r.link,`link`,`text`),logo:u(r.logo,`logo`,`text`),name:u(r.name,`name`,`text`),position:r.position,slug:u(r.slug,`slug`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.aiGateway.accountProviders.update({...e,account_id:f,id:r.id})),{successLabel:`Updated`});return}let p=l({base_url:u(r[`base-url`],`base-url`,`text`),beta:r.beta,curl_example:u(r[`curl-example`],`curl-example`,`text`),description:u(r.description,`description`,`text`),enable:r.enable,headers:u(r.headers,`headers`,`text`),js_example:u(r[`js-example`],`js-example`,`text`),link:u(r.link,`link`,`text`),logo:u(r.logo,`logo`,`text`),name:u(r.name,`name`,`text`),position:r.position,slug:u(r.slug,`slug`,`text`)});a(await s(`Updating`,async()=>d.aiGateway.accountProviders.update({...p,account_id:f,id:r.id})),{successLabel:`Updated`})}},P={command:`account-providers`,describe:`Operations for account-providers`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`credit-balance`,describe:`Retrieve the current credit balance, payment method info, and top-up configuration.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing credit-balance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/credit-balance`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.billing.creditBalance({account_id:l})),{successLabel:`Loaded`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get-topup-limits`,describe:`Retrieve the minimum and maximum allowed top-up amounts (in cents) for this account.`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing get-topup-limits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/limits`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.billing.getTopupLimits({account_id:l})),{successLabel:`Loaded`})}};function z(e){return e.option(`type`,{type:`string`,description:`Filter invoice type: auto, manual, or all.`,choices:[`auto`,`all`,`manual`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`invoice-history`,describe:`Retrieve a list of past invoices with pagination, optionally filtered by type.`,builder:m(z),handler:async r=>{let c={type:r.type};if(r.dryRun){o({command:`cf ai-gateway billing invoice-history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/invoice-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.billing.invoiceHistory({account_id:u,...c})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`invoice-preview`,describe:`Retrieve a preview of the upcoming invoice including line items and tax.`,builder:V,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing invoice-preview`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/invoice-preview`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.billing.invoicePreview({account_id:l})),{successLabel:`Loaded`})}};function U(e){return e.option(`amount`,{type:`number`,description:`Spending limit amount in cents (min 100).`}).option(`duration`,{type:`string`,description:`Spending limit duration.`,choices:[`daily`,`weekly`,`monthly`]}).option(`strategy`,{type:`string`,description:`Spending limit strategy.`,choices:[`fixed`,`sliding`]}).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 W={command:`create`,describe:`Deprecated: spending limits can no longer be created, enabled, or modified and this endpoint always responds 403. Use the new AI Gateway spend limits instead: https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing limits can be removed via DELETE /spending-limit.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing spending-limit create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({amount:r.amount,duration:u(r.duration,`duration`,`text`),strategy:u(r.strategy,`strategy`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.aiGateway.billing.spendingLimit.create({...e,account_id:p})),{successLabel:`Created`});return}if(r.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);r.duration===void 0&&(r.duration=await f(`duration`,`Spending limit duration.`,[`daily`,`weekly`,`monthly`])),r.strategy===void 0&&(r.strategy=await f(`strategy`,`Spending limit strategy.`,[`fixed`,`sliding`]));let m=l({amount:r.amount,duration:u(r.duration,`duration`,`text`),strategy:u(r.strategy,`strategy`,`text`)});a(await s(`Creating`,async()=>d.aiGateway.billing.spendingLimit.create({...m,account_id:p})),{successLabel:`Created`})}};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const K={command:`delete`,describe:`Remove the spending limit for the account.`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing spending-limit delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.billing.spendingLimit.delete({account_id:l})),{successLabel:`Deleted`})}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get`,describe:`Retrieve the current spending limit configuration for the account.`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing spending-limit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.billing.spendingLimit.get({account_id:l})),{successLabel:`Loaded`})}},Y={command:`spending-limit`,describe:`Operations for billing.spending-limit`,builder:e=>e.command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`amount`,{type:`number`,description:`Auto top-up amount in cents (min 1000).`}).option(`threshold`,{type:`number`,description:`Balance threshold in cents that triggers auto top-up (min 500).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`create`,describe:`Configure auto top-up with a balance threshold and top-up amount.`,builder:X,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({amount:r.amount,threshold:r.threshold}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.aiGateway.billing.topup.config.create({...e,account_id:d})),{successLabel:`Created`});return}if(r.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);if(r.threshold===void 0)throw Error(`--threshold is required (or pass --body with this field set).`);let f=l({amount:r.amount,threshold:r.threshold});a(await s(`Creating`,async()=>u.aiGateway.billing.topup.config.create({...f,account_id:d})),{successLabel:`Created`})}};function Q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ne={command:`delete`,describe:`Remove the auto top-up configuration for the account.`,builder:Q,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.billing.topup.config.delete({account_id:l})),{successLabel:`Deleted`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Retrieve the current auto top-up threshold, amount, and any error state.`,builder:re,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.billing.topup.config.get({account_id:l})),{successLabel:`Loaded`})}},ae={command:`config`,describe:`Operations for billing.topup.config`,builder:e=>e.command(Z).command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`amount`,{type:`number`,description:`Top-up amount in cents (min 1000).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`create`,describe:`Create a credit top-up for the given account, charged to the account's default payment method.`,builder:oe,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({amount:r.amount}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.aiGateway.billing.topup.create({...e,account_id:d})),{successLabel:`Created`});return}if(r.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);let f=l({amount:r.amount});a(await s(`Creating`,async()=>u.aiGateway.billing.topup.create({...f,account_id:d})),{successLabel:`Created`})}};function ce(e){return e.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 le={command:`eligibility`,describe:`Determine whether an account can self-serve a credit top-up, and if not, why. The dashboard forwards the account's payment-method list in the body; the reason logic is owned here.`,builder:ce,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup eligibility`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/eligibility`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:c(r.body)});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.aiGateway.billing.topup.eligibility({...e,account_id:u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.aiGateway.billing.topup.eligibility({account_id:u})),{successLabel:`Created`})}};function ue(e){return e.option(`payment-intent-id`,{type:`string`,description:`Stripe invoice ID to check status for.`}).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 de={command:`status`,describe:`Get the payment processing status of a top-up by its invoice ID.`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway billing topup status`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/topup/status`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({payment_intent_id:u(r[`payment-intent-id`],`payment-intent-id`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.billing.topup.status({...e,account_id:p})),{successLabel:`Created`});return}r[`payment-intent-id`]===void 0&&(r[`payment-intent-id`]=await d(`payment-intent-id`,`Stripe invoice ID to check status for.`));let m=l({payment_intent_id:u(r[`payment-intent-id`],`payment-intent-id`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.billing.topup.status({...m,account_id:p})),{successLabel:`Created`})}},fe={command:`topup`,describe:`Operations for billing.topup`,builder:e=>e.command(se).command(le).command(de).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`value-grouping-window`,{type:`string`,description:`Grouping window for usage data.`,choices:[`day`,`hour`],demandOption:!0}).option(`start-time`,{type:`number`,description:`Start time as Unix timestamp in milliseconds.`}).option(`end-time`,{type:`number`,description:`End time as Unix timestamp in milliseconds.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`usage-history`,describe:`Retrieve aggregated usage meter event summaries for the given time range.`,builder:m(pe),handler:async r=>{let c={value_grouping_window:r[`value-grouping-window`],start_time:r[`start-time`],end_time:r[`end-time`]};if(r.dryRun){o({command:`cf ai-gateway billing usage-history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/billing/usage-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.billing.usageHistory({account_id:u,...c})),{successLabel:`Loaded`})}},he={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(I).command(R).command(B).command(H).command(me).command(Y).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`domain`,{type:`string`,description:`the customer-owned custom hostname`}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`zone-id`,{type:`string`,description:`Cloudflare Zone ID owning 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 _e={command:`create <gateway-id>`,describe:`Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`,builder:ge,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?l({domain:u(r.domain,`domain`,`text`),minTLS:u(r[`min-tls`],`min-tls`,`text`),zone_id:u(r[`zone-id`],`zone-id`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.customDomains.create({...e,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}r.domain===void 0&&(r.domain=await d(`domain`,`the customer-owned custom hostname`)),r[`zone-id`]===void 0&&(r[`zone-id`]=await d(`zone-id`,`Cloudflare Zone ID owning the custom hostname`));let m=l({domain:u(r.domain,`domain`,`text`),minTLS:u(r[`min-tls`],`min-tls`,`text`),zone_id:u(r[`zone-id`],`zone-id`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.customDomains.create({...m,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})}};function ve(e){return e.positional(`hostname`,{type:`string`,description:`the customer-owned custom hostname`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ye={command:`delete <hostname>`,describe:`Deletes an AI Gateway dataset.`,builder:ve,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway custom-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/custom-domains/${r.hostname==null?`<hostname>`:encodeURIComponent(String(r.hostname))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),hostname:String(r.hostname??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.customDomains.delete({account_id:l,gateway_id:r[`gateway-id`],hostname:r.hostname})),{successLabel:`Deleted`})}};function be(e){return e.positional(`hostname`,{type:`string`,description:`the customer-owned custom hostname`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <hostname>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:be,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway custom-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/custom-domains/${r.hostname==null?`<hostname>`:encodeURIComponent(String(r.hostname))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),hostname:String(r.hostname??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.customDomains.get({account_id:l,gateway_id:r[`gateway-id`],hostname:r.hostname})),{successLabel:`Loaded`})}};function Se(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Status`,choices:[`initializing`,`pending_dcv`,`active`,`blocked`,`error`]}).option(`search`,{type:`string`,description:`Search by hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:m(Se),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],status:r.status,search:r.search};if(r.dryRun){o({command:`cf ai-gateway custom-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.customDomains.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})}},we={command:`custom-domains`,describe:`Operations for custom-domains`,builder:e=>e.command(_e).command(ye).command(xe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`create <gateway-id>`,describe:`Creates a new AI Gateway.`,builder:Te,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/datasets`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({enable:r.enable,name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.datasets.create({...e,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}if(r.enable===void 0)throw Error(`--enable is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await d(`name`,`The name field`));let m=l({enable:r.enable,name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.datasets.create({...m,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})}};function De(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Oe={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:De,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/datasets/${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 t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.datasets.delete({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Deleted`})}};function ke(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:ke,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/datasets/${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 t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.datasets.get({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function je(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Name`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, filters`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:je,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],name:r.name,enable:r.enable,search:r.search};if(r.dryRun){o({command:`cf ai-gateway datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/datasets`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.datasets.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})}};function Ne(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:Ne,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/datasets/${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?l({enable:r.enable,name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.aiGateway.datasets.update({...e,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}if(r.enable===void 0)throw Error(`--enable is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await d(`name`,`The name field`));let m=l({enable:r.enable,name:u(r.name,`name`,`text`)});a(await s(`Updating`,async()=>f.aiGateway.datasets.update({...m,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})}},Fe={command:`datasets`,describe:`Curated collections of gateway logs used as inputs for evaluations and fine-tuning`,builder:e=>e.command(Ee).command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Le={command:`create-deployment <id>`,describe:`Create a new AI Gateway Dynamic Route Deployment.`,builder:Ie,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing create-deployment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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))}/deployments`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?l({version_id:u(r[`version-id`],`version-id`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.dynamicRouting.createDeployment({...e,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Created`});return}r[`version-id`]===void 0&&(r[`version-id`]=await d(`version-id`,`The version_id field`));let m=l({version_id:u(r[`version-id`],`version-id`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.dynamicRouting.createDeployment({...m,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Created`})}};function Re(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`create-version <id>`,describe:`Create a new AI Gateway Dynamic Route Version.`,builder:Re,handler:async l=>{if(l.dryRun){o({command:`cf ai-gateway dynamic-routing create-version`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${l[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(l[`gateway-id`]))}/routes/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions`,pathParams:{"gateway-id":String(l[`gateway-id`]??``),id:String(l.id??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);a(await s(`Creating`,async()=>u.aiGateway.dynamicRouting.createVersion({...e,account_id:d,gateway_id:l[`gateway-id`],id:l.id})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(u,`POST`,`/accounts/${d}/ai-gateway/gateways/${encodeURIComponent(String(l[`gateway-id`]))}/routes/${encodeURIComponent(String(l.id))}/versions`)),{successLabel:`Created`})}};function Be(e){return e.positional(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ve={command:`create <gateway-id>`,describe:`Create a new AI Gateway Dynamic Route.`,builder:Be,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.dynamicRouting.create({...e,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await d(`name`,`The name field`));let m=l({name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.dynamicRouting.create({...m,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})}};function He(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ue={command:`delete <id>`,describe:`Delete an AI Gateway Dynamic Route.`,builder:He,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.dynamicRouting.delete({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Deleted`})}};function We(e){return e.positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`get-version <version-id>`,describe:`Get an AI Gateway Dynamic Route Version.`,builder:We,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing get-version`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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/${r[`version-id`]==null?`<version-id>`:encodeURIComponent(String(r[`version-id`]))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``),"version-id":String(r[`version-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.dynamicRouting.getVersion({account_id:l,gateway_id:r[`gateway-id`],id:r.id,version_id:r[`version-id`]})),{successLabel:`Loaded`})}};function Ke(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qe={command:`get <id>`,describe:`Get an AI Gateway Dynamic Route.`,builder:Ke,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.dynamicRouting.get({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function Je(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`list-deployments <id>`,describe:`List all AI Gateway Dynamic Route Deployments.`,builder:Je,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing list-deployments`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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))}/deployments`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.dynamicRouting.listDeployments({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function Xe(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`list-versions <id>`,describe:`List all AI Gateway Dynamic Route Versions.`,builder:Xe,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing list-versions`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.dynamicRouting.listVersions({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function Qe(e){return e.option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of routes per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`list`,describe:`List all AI Gateway Dynamic Routes.`,builder:Qe,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf ai-gateway dynamic-routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.dynamicRouting.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})}};function et(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const tt={command:`update <id>`,describe:`Update an AI Gateway Dynamic Route.`,builder:et,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway dynamic-routing update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.aiGateway.dynamicRouting.update({...e,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await d(`name`,`The name field`));let m=l({name:u(r.name,`name`,`text`)});a(await s(`Updating`,async()=>f.aiGateway.dynamicRouting.update({...m,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})}},nt={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(Ve).command(Le).command(ze).command(Ue).command(qe).command(Ge).command($e).command(Ye).command(Ze).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order-by`,{type:`string`,description:`Order by`}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`list`,describe:`Lists all available evaluator types for scoring AI gateway responses.`,builder:m(rt),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],order_by:r[`order-by`],order_by_direction:r[`order-by-direction`]};if(r.dryRun){o({command:`cf ai-gateway evaluation-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/evaluation-types`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.evaluationTypes.list({account_id:u,...c})),{successLabel:`Loaded`})}},at={command:`evaluation-types`,describe:`Available evaluator types for scoring AI gateway responses (accuracy, toxicity, etc.)`,builder:e=>e.command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ot(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dataset-ids`,{type:`string`,array:!0,description:`The dataset_ids field`}).option(`evaluation-type-ids`,{type:`string`,array:!0,description:`The evaluation_type_ids field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const st={command:`create <gateway-id>`,describe:`Creates a new AI Gateway.`,builder:ot,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway evaluations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/evaluations`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({dataset_ids:r[`dataset-ids`],evaluation_type_ids:r[`evaluation-type-ids`],name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.evaluations.create({...e,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}if(r[`dataset-ids`]===void 0)throw Error(`--dataset-ids is required (or pass --body with this field set).`);if(r[`evaluation-type-ids`]===void 0)throw Error(`--evaluation-type-ids is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await d(`name`,`The name field`));let m=l({dataset_ids:r[`dataset-ids`],evaluation_type_ids:r[`evaluation-type-ids`],name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.evaluations.create({...m,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})}};function ct(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const lt={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:ct,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway evaluations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/evaluations/${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 t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
10
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.evaluations.delete({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Deleted`})}};function ut(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dt={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:ut,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway evaluations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/evaluations/${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 t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.evaluations.get({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function ft(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Name`}).option(`processed`,{type:`boolean`,description:`Processed`}).option(`search`,{type:`string`,description:`Search by id, name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:ft,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],name:r.name,processed:r.processed,search:r.search};if(r.dryRun){o({command:`cf ai-gateway evaluations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/evaluations`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.evaluations.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})}},mt={command:`evaluations`,describe:`Run quality evaluations against gateway logs or datasets to score model outputs`,builder:e=>e.command(st).command(lt).command(dt).command(pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ht(e){return e.option(`authentication`,{type:`boolean`,description:`The authentication field`}).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:`gateway id`}).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-5000)`}).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 gt={command:`create`,describe:`Creates a new AI Gateway.`,builder:ht,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({authentication:r.authentication,cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],id:u(r.id,`id`,`text`),log_management:r[`log-management`],log_management_strategy:u(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:u(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:u(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],store_id:u(r[`store-id`],`store-id`,`text`),workers_ai_billing_mode:u(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.gateways.create({...e,account_id:p})),{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 d(`id`,`gateway id`)),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 m=l({authentication:r.authentication,cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],id:u(r.id,`id`,`text`),log_management:r[`log-management`],log_management_strategy:u(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:u(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:u(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(r[`retry-backoff`],`retry-backoff`,`text`),retry_delay:r[`retry-delay`],retry_max_attempts:r[`retry-max-attempts`],store_id:u(r[`store-id`],`store-id`,`text`),workers_ai_billing_mode:u(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr});a(await s(`Creating`,async()=>f.aiGateway.gateways.create({...m,account_id:p})),{successLabel:`Created`})}};function _t(e){return e.positional(`id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vt={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:_t,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}a(await s(`Deleting`,async()=>c.aiGateway.gateways.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function yt(e){return e.positional(`id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bt={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:yt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.gateways.get({account_id:l,id:r.id})),{successLabel:`Loaded`})}};function xt(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:xt,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],search:r.search};if(r.dryRun){o({command:`cf ai-gateway gateways list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.gateways.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ct(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,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:`The secret field`}).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 wt={command:`create <gateway-id>`,describe:`Creates a new AI Gateway.`,builder:Ct,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?l({alias:u(r.alias,`alias`,`text`),default_config:r[`default-config`],provider_slug:u(r[`provider-slug`],`provider-slug`,`text`),rate_limit:r[`rate-limit`],rate_limit_period:r[`rate-limit-period`],secret:u(r.secret,`secret`,`text`),secret_id:u(r[`secret-id`],`secret-id`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.aiGateway.gateways.providers.create({...e,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}if(r.alias===void 0&&(r.alias=await d(`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 d(`provider-slug`,`The provider_slug field`));let m=l({alias:u(r.alias,`alias`,`text`),default_config:r[`default-config`],provider_slug:u(r[`provider-slug`],`provider-slug`,`text`),rate_limit:r[`rate-limit`],rate_limit_period:r[`rate-limit-period`],secret:u(r.secret,`secret`,`text`),secret_id:u(r[`secret-id`],`secret-id`,`text`)});a(await s(`Creating`,async()=>f.aiGateway.gateways.providers.create({...m,account_id:p,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})}};function Tt(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Et={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:Tt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);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 Dt(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,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 Ot={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:Dt,handler:async r=>{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 n()??`<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 t();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 kt(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`secret`,{type:`string`,description:`The secret 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 At={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:kt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?l({secret:u(r.secret,`secret`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.aiGateway.gateways.providers.update({...e,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}r.secret===void 0&&(r.secret=await d(`secret`,`The secret field`));let m=l({secret:u(r.secret,`secret`,`text`)});a(await s(`Updating`,async()=>f.aiGateway.gateways.providers.update({...m,account_id:p,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})}},jt={command:`providers`,describe:`Operations for gateways.providers`,builder:e=>e.command(wt).command(Et).command(Ot).command(At).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mt(e){return e.positional(`id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`authentication`,{type:`boolean`,description:`The authentication field`}).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(`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-5000)`}).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 Nt={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:Mt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?l({authentication:r.authentication,cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],guardrails:{prompt:{P1:u(r[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:u(r[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:u(r[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:u(r[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:u(r[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:u(r[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:u(r[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:u(r[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:u(r[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:u(r[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:u(r[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:u(r[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:u(r[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:u(r[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:u(r[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:u(r[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:u(r[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:u(r[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:u(r[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:u(r[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:u(r[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:u(r[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:u(r[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:u(r[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:u(r[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:u(r[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:u(r[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:u(r[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:r[`log-classification`],log_management:r[`log-management`],log_management_strategy:u(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:u(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:u(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(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:u(r[`store-id`],`store-id`,`text`),stripe:{authorization:u(r[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:u(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.aiGateway.gateways.update({...e,account_id:f,id:r.id})),{successLabel:`Updated`});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[`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 p=l({authentication:r.authentication,cache_invalidate_on_update:r[`cache-invalidate-on-update`],cache_ttl:r[`cache-ttl`],collect_logs:r[`collect-logs`],guardrails:{prompt:{P1:u(r[`guardrails-prompt-p1`],`guardrails-prompt-p1`,`text`),S1:u(r[`guardrails-prompt-s1`],`guardrails-prompt-s1`,`text`),S10:u(r[`guardrails-prompt-s10`],`guardrails-prompt-s10`,`text`),S11:u(r[`guardrails-prompt-s11`],`guardrails-prompt-s11`,`text`),S12:u(r[`guardrails-prompt-s12`],`guardrails-prompt-s12`,`text`),S13:u(r[`guardrails-prompt-s13`],`guardrails-prompt-s13`,`text`),S2:u(r[`guardrails-prompt-s2`],`guardrails-prompt-s2`,`text`),S3:u(r[`guardrails-prompt-s3`],`guardrails-prompt-s3`,`text`),S4:u(r[`guardrails-prompt-s4`],`guardrails-prompt-s4`,`text`),S5:u(r[`guardrails-prompt-s5`],`guardrails-prompt-s5`,`text`),S6:u(r[`guardrails-prompt-s6`],`guardrails-prompt-s6`,`text`),S7:u(r[`guardrails-prompt-s7`],`guardrails-prompt-s7`,`text`),S8:u(r[`guardrails-prompt-s8`],`guardrails-prompt-s8`,`text`),S9:u(r[`guardrails-prompt-s9`],`guardrails-prompt-s9`,`text`)},response:{P1:u(r[`guardrails-response-p1`],`guardrails-response-p1`,`text`),S1:u(r[`guardrails-response-s1`],`guardrails-response-s1`,`text`),S10:u(r[`guardrails-response-s10`],`guardrails-response-s10`,`text`),S11:u(r[`guardrails-response-s11`],`guardrails-response-s11`,`text`),S12:u(r[`guardrails-response-s12`],`guardrails-response-s12`,`text`),S13:u(r[`guardrails-response-s13`],`guardrails-response-s13`,`text`),S2:u(r[`guardrails-response-s2`],`guardrails-response-s2`,`text`),S3:u(r[`guardrails-response-s3`],`guardrails-response-s3`,`text`),S4:u(r[`guardrails-response-s4`],`guardrails-response-s4`,`text`),S5:u(r[`guardrails-response-s5`],`guardrails-response-s5`,`text`),S6:u(r[`guardrails-response-s6`],`guardrails-response-s6`,`text`),S7:u(r[`guardrails-response-s7`],`guardrails-response-s7`,`text`),S8:u(r[`guardrails-response-s8`],`guardrails-response-s8`,`text`),S9:u(r[`guardrails-response-s9`],`guardrails-response-s9`,`text`)}},log_classification:r[`log-classification`],log_management:r[`log-management`],log_management_strategy:u(r[`log-management-strategy`],`log-management-strategy`,`text`),logpush:r.logpush,logpush_public_key:u(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:u(r[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(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:u(r[`store-id`],`store-id`,`text`),stripe:{authorization:u(r[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:u(r[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:r.zdr});a(await s(`Updating`,async()=>d.aiGateway.gateways.update({...p,account_id:f,id:r.id})),{successLabel:`Updated`})}},Pt={command:`gateways`,describe:`Operations for gateways`,builder:e=>e.command(gt).command(vt).command(bt).command(St).command(Nt).command(jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ft(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const It={command:`get`,describe:`Returns the canonical logging platform and migration availability for an account.`,builder:Ft,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logging-state get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/logging-state`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.loggingState.get({account_id:l})),{successLabel:`Loaded`})}};function Lt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`update`,describe:`Irreversibly migrates an eligible account to Workers Observability logging.`,builder:Lt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logging-state update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/logging-state`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.aiGateway.loggingState.update({account_id:l})),{successLabel:`Updated`})}},zt={command:`logging-state`,describe:`Inspect and migrate the logging platform used by an AI Gateway account`,builder:e=>e.command(It).command(Rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bt(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,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 $={command:`delete <gateway-id>`,describe:`Deletes gateway log entries matching the specified criteria.`,builder:m(Bt),handler:async r=>{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 n()??`<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 t();if(r.accountId=u,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
13
|
-
`);return}a(await s(`Deleting`,async()=>l.aiGateway.logs.delete({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Deleted`})}};function Vt(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,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 Ht={command:`edit <id>`,describe:`Updates metadata for an AI Gateway log entry.`,builder:Vt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?l({feedback:r.feedback,score:r.score}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>u.aiGateway.logs.edit({...e,account_id:d,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`});return}let f=l({feedback:r.feedback,score:r.score});a(await s(`Updating`,async()=>u.aiGateway.logs.edit({...f,account_id:d,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Updated`})}};function Ut(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`get <id>`,describe:`Retrieves detailed information for a specific AI Gateway log entry.`,builder:Ut,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();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 Gt(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`search`,{type:`string`,description:`Search`}).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`}).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 Kt={command:`list`,describe:`Lists request/response log entries for the AI gateway with filtering and pagination.`,builder:m(Gt),handler:async r=>{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 n()??`<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 t();r.accountId=u,a(await s(`Loading`,async()=>l.aiGateway.logs.list({account_id:u,gateway_id:r[`gateway-id`],...c})),{successLabel:`Loaded`})}};function qt(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jt={command:`request <id>`,describe:`Retrieves the original request payload for an AI Gateway log entry.`,builder:qt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logs request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.logs.request({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}};function Yt(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xt={command:`response <id>`,describe:`Retrieves the response payload for an AI Gateway log entry.`,builder:Yt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway logs response`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.logs.response({account_id:l,gateway_id:r[`gateway-id`],id:r.id})),{successLabel:`Loaded`})}},Zt={command:`logs`,describe:`Inspect individual request/response pairs that passed through the gateway`,builder:e=>e.command($).command(Ht).command(Wt).command(Kt).command(Jt).command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qt(e){return e.positional(`provider`,{type:`string`,description:`Provider`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $t={command:`get <provider>`,describe:`Retrieves the endpoint URL for an AI Gateway.`,builder:Qt,handler:async r=>{if(r.dryRun){o({command:`cf ai-gateway urls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/url/${r.provider==null?`<provider>`:encodeURIComponent(String(r.provider))}`,pathParams:{"gateway-id":String(r[`gateway-id`]??``),provider:String(r.provider??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.aiGateway.urls.get({account_id:l,gateway_id:r[`gateway-id`],provider:r.provider})),{successLabel:`Loaded`})}},en={command:`urls`,describe:`Retrieve the gateway's proxy URL used by clients to send inference requests`,builder:e=>e.command($t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tn={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(P).command(he).command(we).command(Fe).command(nt).command(at).command(mt).command(Pt).command(zt).command(Zt).command(en).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{tn as default};
|