cf 0.13.0 → 0.15.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/dist/_meta/commands.json +6724 -3970
- package/dist/_meta/hand-written-commands.json +150 -32
- package/dist/_meta/schemas.json +2083 -2159
- package/dist/abuse-reports-BAQR1w79.mjs +26 -0
- package/dist/access-C8KMplzp.mjs +27 -0
- package/dist/account-B-KQSR0L.mjs +12 -0
- package/dist/account-tags-EncLJpLc.mjs +15 -0
- package/dist/accounts-BA4Mp3A_.mjs +132 -0
- package/dist/acm-ByxUJcqF.mjs +15 -0
- package/dist/addressing-C-ym0h0G.mjs +93 -0
- package/dist/agent-memory-CkPSiZDI.mjs +34 -0
- package/dist/ai-DkE_Q64s.mjs +31 -0
- package/dist/ai-audit-pPcjYWI5.mjs +6 -0
- package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
- package/dist/ai-search-DLD_kDS1.mjs +79 -0
- package/dist/ai-security-jyZcBl9g.mjs +10 -0
- package/dist/alerting-DOROjm8E.mjs +56 -0
- package/dist/analytics-rQ-h-plT.mjs +21 -0
- package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
- package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-B8p8vp8u.mjs +154 -0
- package/dist/argo-g8SjUb_t.mjs +10 -0
- package/dist/artifacts-B1PaeF5h.mjs +43 -0
- package/dist/audit-logs-DmU_PHy_.mjs +4 -0
- package/dist/auth-CZqics6E.mjs +2 -0
- package/dist/auth-Cp7gT-AF.mjs +8 -0
- package/dist/billing-CvTbUg-H.mjs +23 -0
- package/dist/bot-management-z53tbcbH.mjs +9 -0
- package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
- package/dist/brand-protection-DzV211IQ.mjs +27 -0
- package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
- package/dist/browser-run-DYQvMAyo.mjs +46 -0
- package/dist/build-BPIp8J5F.mjs +2 -0
- package/dist/build-OC77a1zq.mjs +2 -0
- package/dist/builds-CwKRqjQ5.mjs +71 -0
- package/dist/cache-CugNPPsJ.mjs +45 -0
- package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
- package/dist/cf-oadujOtC.mjs +18 -0
- package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
- package/dist/chunk-DL5FNmn1.mjs +2 -0
- package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
- package/dist/client-certificates-DZUIqBTB.mjs +13 -0
- package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
- package/dist/cloud-connector-avpf86kG.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
- package/dist/command-B2Qe-WUa.mjs +2 -0
- package/dist/command-CF0giIIc.mjs +3 -0
- package/dist/command-D45NW-R3.mjs +2 -0
- package/dist/command-DIvPLK8x.mjs +2 -0
- package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/config.d.mts +1 -1729
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
- package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
- package/dist/connectors-BSmhzNB7.mjs +15 -0
- package/dist/containers-B5vDcFzo.mjs +78 -0
- package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
- package/dist/content-scan-CeLZAcbT.mjs +14 -0
- package/dist/cps-BlI_Od72.mjs +6 -0
- package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
- package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
- package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
- package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
- package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
- package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
- package/dist/custom-pages-BgfhGksj.mjs +21 -0
- package/dist/d1-P2kWbdID.mjs +45 -0
- package/dist/data-security-pBIozmRL.mjs +71 -0
- package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
- package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
- package/dist/dev-PPUBjWcm.mjs +4 -0
- package/dist/diagnostics-C62habGQ.mjs +15 -0
- package/dist/dialog-C_ccBiZp.mjs +2 -0
- package/dist/dist-B4pQ4CXK.mjs +48 -0
- package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-CpkcyQ8C.mjs +17 -0
- package/dist/dns-DG1X4Wap.mjs +135 -0
- package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
- package/dist/dry-run-CLX6Pbtq.mjs +2 -0
- package/dist/durable-objects-D214VhxH.mjs +8 -0
- package/dist/email-auth-Ba4ONan2.mjs +6 -0
- package/dist/email-routing-BlqKnqNM.mjs +45 -0
- package/dist/email-security-Dl1E1Dko.mjs +160 -0
- package/dist/email-sending-DIRSSRIz.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
- package/dist/firewall-DdsDh8GD.mjs +56 -0
- package/dist/flagship-CkUIVW7c.mjs +28 -0
- package/dist/fraud-BUpZgvQT.mjs +22 -0
- package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
- package/dist/healthchecks-DjQWb3EM.mjs +22 -0
- package/dist/hostnames-ClBLPbct.mjs +11 -0
- package/dist/hyperdrive-U54xZsWU.mjs +37 -0
- package/dist/iam-T-wWmOep.mjs +52 -0
- package/dist/images-ia5UG1GW.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BhswZLMI.mjs +76 -0
- package/dist/interactive-B6woOLo-.mjs +32 -0
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-Dad_EvhM.mjs +4 -0
- package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
- package/dist/keys-DjIPvqj4.mjs +4 -0
- package/dist/kv-DzXVnK94.mjs +21 -0
- package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-3wGHPsYz.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CEQbOgBM.mjs +5 -0
- package/dist/login-DEWvGuaU.mjs +2 -0
- package/dist/logo-matches-YGRPstPi.mjs +6 -0
- package/dist/logos-BirufUgo.mjs +7 -0
- package/dist/logpush-BlNbUHyV.mjs +46 -0
- package/dist/logs-DmFlVF9q.mjs +48 -0
- package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
- package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
- package/dist/magic-transit-CBVOK2aa.mjs +387 -0
- package/dist/managed-defense-BdW6s483.mjs +18 -0
- package/dist/managed-transforms-BIeiofIS.mjs +9 -0
- package/dist/matches-CAnwci0P.mjs +6 -0
- package/dist/mcp-BfhOMGFE.mjs +32 -0
- package/dist/mesh-CxUL2Wf-.mjs +26 -0
- package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
- package/dist/network-C68psMbz.mjs +50 -0
- package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
- package/dist/oauth-D4bkeMAw.mjs +14 -0
- package/dist/oauth-DouM-qz0.mjs +2 -0
- package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
- package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
- package/dist/observability-DpYxkFeZ.mjs +80 -0
- package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-Dg55Xfz7.mjs +75 -0
- package/dist/organizations-QnyzGjB2.mjs +4 -0
- package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
- package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
- package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules--D3eXrCf.mjs +39 -0
- package/dist/pages-Ce8DDgNr.mjs +60 -0
- package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
- package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
- package/dist/pipelines-CAqCgBLh.mjs +44 -0
- package/dist/precursor-DBnn4Q35.mjs +4 -0
- package/dist/previews-y_nSqWK5.mjs +4 -0
- package/dist/progress-Bi02B6v4.mjs +2 -0
- package/dist/project-settings-DSXevRvj.mjs +3 -0
- package/dist/prompt-Bx2PB-tt.mjs +3 -0
- package/dist/queries-dg-CVXjf.mjs +9 -0
- package/dist/queues-C_ilLbRI.mjs +63 -0
- package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
- package/dist/r2-hZAkra-l.mjs +127 -0
- package/dist/radar-BO9b0aZy.mjs +300 -0
- package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
- package/dist/realtime-eSavuSeE.mjs +172 -0
- package/dist/registrar-Ct30kOXZ.mjs +43 -0
- package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
- package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-B-F5aWUJ.mjs +14 -0
- package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
- package/dist/request-tracers-CaubpUFV.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-6Snv-b69.mjs +40 -0
- package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
- package/dist/rules-C26eyeA5.mjs +18 -0
- package/dist/rulesets-BKzIwVtJ.mjs +37 -0
- package/dist/rum-Xdw5hyWY.mjs +30 -0
- package/dist/run-BBBMrSrs.mjs +2 -0
- package/dist/run-BRucX7Rz.mjs +2 -0
- package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
- package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
- package/dist/scim-odJTXiIe.mjs +18 -0
- package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-RYpWWzaw.mjs +24 -0
- package/dist/security-center-B3D95vCa.mjs +30 -0
- package/dist/security-txt-BSytVv-9.mjs +9 -0
- package/dist/shared-D67owd9x.mjs +2 -0
- package/dist/smart-shield-C83Sfnf4.mjs +24 -0
- package/dist/snippets-B6oE9WIa.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-CKqJ9J4_.mjs +523 -0
- package/dist/spectrum-CfxY--X_.mjs +83 -0
- package/dist/speed-DzK-kiWt.mjs +24 -0
- package/dist/src-B3h6tKMt.mjs +108 -0
- package/dist/ssl-dnjzPcSB.mjs +45 -0
- package/dist/startup-profile-CYEokTVe.mjs +2 -0
- package/dist/startup-profile-CgWHy4rE.mjs +17 -0
- package/dist/state-BxCejn42.mjs +2 -0
- package/dist/state-DSzkxXML.mjs +2 -0
- package/dist/stream-oFyhS4Wi.mjs +102 -0
- package/dist/submit-4f-ravmC.mjs +4 -0
- package/dist/tags-DrIP6Uiq.mjs +4 -0
- package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-Ds4epd3D.mjs +2 -0
- package/dist/telemetry-mKEb8lYB.mjs +2 -0
- package/dist/tenant-C-gc3NWv.mjs +12 -0
- package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
- package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D0QYsskp.mjs +29 -0
- package/dist/turnstile-C6Q3spRB.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-BBS1K1jt.mjs +2 -0
- package/dist/update-check-CTLoakFV.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-Cs0V89qq.mjs +4 -0
- package/dist/url-normalization-DaEQYy5h.mjs +9 -0
- package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
- package/dist/user-BV1VY3Kl.mjs +112 -0
- package/dist/values-qDS63E43.mjs +4 -0
- package/dist/vectorize-NFzD3mP5.mjs +32 -0
- package/dist/version-W6_TN_kN.mjs +2 -0
- package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
- package/dist/web-assets-Gd6z8dbt.mjs +64 -0
- package/dist/web3-DCJx4NRp.mjs +28 -0
- package/dist/workers-B-j-1ygi.mjs +36 -0
- package/dist/workers-builds-DPrNKjZW.mjs +14 -0
- package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
- package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
- package/dist/workflows-C2KKIJjl.mjs +43 -0
- package/dist/zaraz-CVLCs1IX.mjs +22 -0
- package/dist/zero-trust-BtJi4OXF.mjs +795 -0
- package/dist/zone-hKgt0WzO.mjs +4 -0
- package/dist/zones-CCNyaD3J.mjs +124 -0
- package/package.json +15 -12
- package/dist/_meta/agent-context.json +0 -193
- package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
- package/dist/access-D6Xz892p.mjs +0 -11
- package/dist/account-DvxcqeaK.mjs +0 -2
- package/dist/account-tags-CeqfEWpz.mjs +0 -9
- package/dist/accounts-Bx-8BMH9.mjs +0 -30
- package/dist/acm--0opdSGE.mjs +0 -3
- package/dist/addressing-BS1ynzLA.mjs +0 -13
- package/dist/agent-context-BPhyrSns.mjs +0 -8
- package/dist/agent-memory-DczzpEw5.mjs +0 -6
- package/dist/ai-CDdCTcQl.mjs +0 -5
- package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
- package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
- package/dist/ai-search-DRQj1aMu.mjs +0 -7
- package/dist/ai-security-C_Rb0lGT.mjs +0 -4
- package/dist/alerting-BAR9eFs2.mjs +0 -6
- package/dist/analytics-BaUZwNc5.mjs +0 -4
- package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
- package/dist/api-security-jA0lOk6a.mjs +0 -50
- package/dist/argo-Cz4pDagx.mjs +0 -2
- package/dist/artifacts-BcLTGfAv.mjs +0 -5
- package/dist/audit-logs-DbIv4n6u.mjs +0 -2
- package/dist/auth-rW5d3jtr.mjs +0 -5
- package/dist/auth-tvDdC1J-.mjs +0 -8
- package/dist/billing-Md87QjqW.mjs +0 -3
- package/dist/bot-management-VHMo4hpU.mjs +0 -5
- package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
- package/dist/brand-protection-HUeR6Pof.mjs +0 -3
- package/dist/browser-extension-199oZg3X.mjs +0 -3
- package/dist/browser-run-DDasyux-.mjs +0 -4
- package/dist/build-0QlYUfFS.mjs +0 -2
- package/dist/builds-B-lXn6JR.mjs +0 -9
- package/dist/cache-CevKpiTM.mjs +0 -9
- package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
- package/dist/cf-C11NGkjx.mjs +0 -18
- package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
- package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-Bay7oPLE.mjs +0 -3
- package/dist/client-side-security-CbU9xn0k.mjs +0 -37
- package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
- package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
- package/dist/command-CMzMsll4.mjs +0 -2
- package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
- package/dist/connectors-CEAy30E-.mjs +0 -3
- package/dist/containers-BsbDqbSn.mjs +0 -58
- package/dist/content-scan-BdK936iO.mjs +0 -4
- package/dist/cps-oP97-qkm.mjs +0 -2
- package/dist/csamScanner-DUNN4INg.mjs +0 -6
- package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
- package/dist/custom-certificates-DYspvjo4.mjs +0 -5
- package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
- package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
- package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
- package/dist/custom-pages-DzKnSgL3.mjs +0 -3
- package/dist/d1-JBEqjJoj.mjs +0 -20
- package/dist/data-security-CIktWnXt.mjs +0 -7
- package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
- package/dist/dev-CAubuxCc.mjs +0 -4
- package/dist/diagnostics-B0DRh714.mjs +0 -3
- package/dist/dist-12KzRsBM.mjs +0 -387
- package/dist/dist-BCVqQpg2.mjs +0 -2
- package/dist/dist-Cp3uJN1x.mjs +0 -48
- package/dist/dist-S9K_8gq9.mjs +0 -9
- package/dist/dls-CFzTHcZM.mjs +0 -3
- package/dist/dns-Dw6u-NV1.mjs +0 -29
- package/dist/dns-firewall-CIPptslp.mjs +0 -57
- package/dist/dry-run-DiVy1lVo.mjs +0 -2
- package/dist/durable-objects-CCkeqqBq.mjs +0 -2
- package/dist/email-auth-kdxO51Oz.mjs +0 -2
- package/dist/email-routing-BLggZdQq.mjs +0 -6
- package/dist/email-security-DjADlgdM.mjs +0 -18
- package/dist/email-sending-Cz7E7GoP.mjs +0 -7
- package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
- package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
- package/dist/firewall-5t6OBIOl.mjs +0 -8
- package/dist/flagship-CzG_VoNR.mjs +0 -4
- package/dist/fraud-UOg_69Ob.mjs +0 -20
- package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
- package/dist/healthchecks-BkHZGTp1.mjs +0 -4
- package/dist/hostnames-EUYOZm21.mjs +0 -3
- package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
- package/dist/iam-BQ2xSgYN.mjs +0 -6
- package/dist/images-CkEq6ScP.mjs +0 -8
- package/dist/intel-DDWEdGyl.mjs +0 -8
- package/dist/interactive-B2E03Fs-.mjs +0 -11
- package/dist/interactive-_B-EqD0Y.mjs +0 -23
- package/dist/ips-54Qmy-Uw.mjs +0 -2
- package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
- package/dist/keys-rvI4TC3Z.mjs +0 -2
- package/dist/kv-CAeN1zBy.mjs +0 -5
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
- package/dist/load-balancers-BFwdwAIU.mjs +0 -6
- package/dist/local-C6XsFD_W.mjs +0 -2
- package/dist/logexplorer-D8rOPB5I.mjs +0 -17
- package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
- package/dist/logos-BN8SvJhS.mjs +0 -3
- package/dist/logpush-BnLA4WVm.mjs +0 -4
- package/dist/logs-CDo7Y5sA.mjs +0 -3
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
- package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
- package/dist/magic-transit-6tvVOECW.mjs +0 -111
- package/dist/managed-defense-AYwBOYIH.mjs +0 -2
- package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
- package/dist/matches-Dp91L3dL.mjs +0 -2
- package/dist/mcp-P7pcieiT.mjs +0 -4
- package/dist/mesh-DjFrk6PL.mjs +0 -4
- package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
- package/dist/network-7cd1U6-I.mjs +0 -6
- package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
- package/dist/oauth-DH3kMXSs.mjs +0 -14
- package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
- package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
- package/dist/observability-M1DnLhMR.mjs +0 -10
- package/dist/organization-cUE7GDCt.mjs +0 -45
- package/dist/organizations-C-Hcpd0w.mjs +0 -2
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
- package/dist/page-rules-B-zq1EUb.mjs +0 -27
- package/dist/pages-B6YpkPos.mjs +0 -14
- package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
- package/dist/pipelines-BJc_RylD.mjs +0 -6
- package/dist/precursor-CLQu7suY.mjs +0 -4
- package/dist/progress-V6SZV3Ux.mjs +0 -2
- package/dist/prompt-DjRTpML4.mjs +0 -3
- package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
- package/dist/queries-DSrrket-.mjs +0 -3
- package/dist/queues-Tf7kPBpn.mjs +0 -7
- package/dist/r2-DmKNnxtC.mjs +0 -25
- package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
- package/dist/radar-Csk7Ab-b.mjs +0 -2
- package/dist/realtime-CDehZVhV.mjs +0 -20
- package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
- package/dist/registrar-vflzeNQ9.mjs +0 -43
- package/dist/reporting-BaPZ1PHN.mjs +0 -2
- package/dist/request-headers-CC4eHmI2.mjs +0 -3
- package/dist/request-tracers-C_UVBexV.mjs +0 -2
- package/dist/resolve-B8CyM1mi.mjs +0 -2
- package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
- package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
- package/dist/rules-4O8076_s.mjs +0 -4
- package/dist/rulesets-C84MxTYo.mjs +0 -5
- package/dist/rum-Bvwkrntx.mjs +0 -4
- package/dist/run-CRfinkSe.mjs +0 -2
- package/dist/schemas-O_ZNaF8R.mjs +0 -65
- package/dist/scim-BvxQmde6.mjs +0 -4
- package/dist/secrets-store-DOKWiC-j.mjs +0 -7
- package/dist/security-center-Bhy_aC-w.mjs +0 -2
- package/dist/security-txt-L7HJ9tq5.mjs +0 -3
- package/dist/smart-shield-COMXuQ1S.mjs +0 -4
- package/dist/snippets-DffQhlKt.mjs +0 -4
- package/dist/spawn-C1AISA2V.mjs +0 -526
- package/dist/spectrum-Cmf7SqQE.mjs +0 -63
- package/dist/speed-m8cdhLFS.mjs +0 -4
- package/dist/src-C8phrg-8.mjs +0 -109
- package/dist/ssl-D4ffsdSw.mjs +0 -15
- package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
- package/dist/state-CHif8Y5I.mjs +0 -2
- package/dist/stream-DPF5fojV.mjs +0 -16
- package/dist/submit-Br8hfP0_.mjs +0 -2
- package/dist/tags-Bnt4JuxQ.mjs +0 -2
- package/dist/telemetry-Ch1vCICm.mjs +0 -2
- package/dist/tenant-D8u0CxoC.mjs +0 -2
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
- package/dist/tunnels-BkNPpTHa.mjs +0 -5
- package/dist/turnstile-MgwRECJv.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-Ddp7MgcI.mjs +0 -2
- package/dist/url-normalization-3ptK9ntV.mjs +0 -3
- package/dist/url-scanner-Psb9ollR.mjs +0 -2
- package/dist/user-DWdshcIu.mjs +0 -12
- package/dist/values-CDKQL1z2.mjs +0 -2
- package/dist/vectorize-CTYYUyQj.mjs +0 -4
- package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
- package/dist/web-assets-CpDwDEx8.mjs +0 -8
- package/dist/web3-YsjDyAzH.mjs +0 -4
- package/dist/workers-BKKxaZcz.mjs +0 -6
- package/dist/workers-builds-BWo5vUA9.mjs +0 -2
- package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
- package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
- package/dist/workflows-KrIFI9ns.mjs +0 -5
- package/dist/zaraz-DglXbVzZ.mjs +0 -2
- package/dist/zero-trust-RilTdSjX.mjs +0 -91
- package/dist/zone-DsBtVkvT.mjs +0 -2
- package/dist/zones-BFxvWFQW.mjs +0 -44
- /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,r as u,t as d}from"./body-parser-CUWbw_Tq.mjs";import{n as f}from"./input-validation-Ch4Vllrm.mjs";import{a as p,n as m}from"./prompt-Bx2PB-tt.mjs";import{t as h}from"./cli-types-tt_LZMbn.mjs";function g(e){return e.usage(`$0 load-balancers account create
|
|
3
|
+
|
|
4
|
+
Create a new account or zone-scoped load balancer.`).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`,default:!0}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).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 _={command:`create`,describe:`Create account or zone Load Balancer`,builder:g,handler:async m=>c({command:`load-balancers account create`,classification:{safeFlags:[`adaptive-routing-failover-across-pools`,`enabled`,`location-strategy-mode`,`location-strategy-prefer-ecs`,`proxied`,`session-affinity`,`session-affinity-attributes-require-all-headers`,`session-affinity-attributes-samesite`,`session-affinity-attributes-secure`,`session-affinity-attributes-zero-downtime-failover`,`steering-policy`,`dry-run`]}},m,async()=>{if(m.dryRun){let e=m.zone===void 0?await r():void 0,t=m.zone===void 0?`accounts`:`zones`,n=m.zone??e??`<account-id>`;o({command:`cf load-balancers account create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:m.body===void 0?d({adaptive_routing:{failover_across_pools:m[`adaptive-routing-failover-across-pools`]},default_pools:m[`default-pools`],description:f(m.description,`description`,`text`),enabled:m.enabled,fallback_pool:f(m[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(m[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(m[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(m.name,`name`,`text`),networks:m.networks,proxied:m.proxied,random_steering:{default_weight:m[`random-steering-default-weight`]},rules:u(m.rules,`rules`),session_affinity:f(m[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:m[`session-affinity-attributes-drain-duration`],headers:m[`session-affinity-attributes-headers`],require_all_headers:m[`session-affinity-attributes-require-all-headers`],samesite:f(m[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(m[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(m[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:m[`session-affinity-ttl`],steering_policy:f(m[`steering-policy`],`steering-policy`,`text`),ttl:m.ttl}):l(m.body)});return}let c=await i(m),h=m.zone===void 0?`accounts`:`zones`,g=h===`zones`?await t({zone:m.zone},c,{quiet:m.quiet}):m.local?e:await n();if(h===`zones`?m.zoneId=g:m.accountId=g,m.body){let e=l(m.body);a(await s(`Creating`,async()=>c.loadBalancers.account.create({...e,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`});return}if(m[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);m[`fallback-pool`]===void 0&&(m[`fallback-pool`]=await p(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),m.name===void 0&&(m.name=await p(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let _=d({adaptive_routing:{failover_across_pools:m[`adaptive-routing-failover-across-pools`]},default_pools:m[`default-pools`],description:f(m.description,`description`,`text`),enabled:m.enabled,fallback_pool:f(m[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(m[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(m[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(m.name,`name`,`text`),networks:m.networks,proxied:m.proxied,random_steering:{default_weight:m[`random-steering-default-weight`]},rules:u(m.rules,`rules`),session_affinity:f(m[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:m[`session-affinity-attributes-drain-duration`],headers:m[`session-affinity-attributes-headers`],require_all_headers:m[`session-affinity-attributes-require-all-headers`],samesite:f(m[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(m[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(m[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:m[`session-affinity-ttl`],steering_policy:f(m[`steering-policy`],`steering-policy`,`text`),ttl:m.ttl});a(await s(`Creating`,async()=>c.loadBalancers.account.create({..._,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`})})};function ee(e){return e.usage(`$0 load-balancers account delete <load-balancer-id>
|
|
5
|
+
|
|
6
|
+
Delete a configured account or zone-scoped load balancer.`).positional(`load-balancer-id`,{type:`string`,description:`Load balancer 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 te={command:`delete <load-balancer-id>`,describe:`Delete account or zone Load Balancer`,builder:ee,handler:async l=>c({command:`load-balancers account delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf load-balancers account delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers/${l[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(l[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n),"load-balancer-id":String(l[`load-balancer-id`]??``)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();if(u===`zones`?l.zoneId=d:l.accountId=d,!await m({force:!!l.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.account.delete({account_or_zone:u,account_or_zone_id:d,load_balancer_id:l[`load-balancer-id`]})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 load-balancers account edit <load-balancer-id>
|
|
8
|
+
|
|
9
|
+
Apply changes to an existing account or zone-scoped load balancer, overwriting the supplied properties.`).positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The editable properties shared by load balancer create, update, and patch requests. Operations layer their own `required` constraints on top via `allOf`."})}const y={command:`edit <load-balancer-id>`,describe:`Patch account or zone Load Balancer`,builder:v,handler:async p=>c({command:`load-balancers account edit`,classification:{safeFlags:[`adaptive-routing-failover-across-pools`,`enabled`,`location-strategy-mode`,`location-strategy-prefer-ecs`,`proxied`,`session-affinity`,`session-affinity-attributes-require-all-headers`,`session-affinity-attributes-samesite`,`session-affinity-attributes-secure`,`session-affinity-attributes-zero-downtime-failover`,`steering-policy`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf load-balancers account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers/${p[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(p[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n),"load-balancer-id":String(p[`load-balancer-id`]??``)},bodyKind:`json`,body:p.body===void 0?d({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:f(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:f(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:u(p.rules,`rules`),session_affinity:f(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:f(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:f(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Updating`,async()=>c.loadBalancers.account.edit({body:e,account_or_zone:m,account_or_zone_id:h,load_balancer_id:p[`load-balancer-id`]})),{successLabel:`Updated`});return}let g=d({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:f(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:f(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:u(p.rules,`rules`),session_affinity:f(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:f(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:f(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl});a(await s(`Updating`,async()=>c.loadBalancers.account.edit({body:g,account_or_zone:m,account_or_zone_id:h,load_balancer_id:p[`load-balancer-id`]})),{successLabel:`Updated`})})};function b(e){return e.usage(`$0 load-balancers account get <load-balancer-id>
|
|
10
|
+
|
|
11
|
+
Fetch a single configured account or zone-scoped load balancer.`).positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <load-balancer-id>`,describe:`account or zone Load Balancer Details`,builder:b,handler:async l=>c({command:`load-balancers account get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf load-balancers account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers/${l[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(l[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n),"load-balancer-id":String(l[`load-balancer-id`]??``)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.loadBalancers.account.get({account_or_zone:u,account_or_zone_id:d,load_balancer_id:l[`load-balancer-id`]})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 load-balancers account list
|
|
12
|
+
|
|
13
|
+
List configured account or zone-scoped load balancers.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List account or zone Load Balancers`,builder:S,handler:async l=>c({command:`load-balancers account list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf load-balancers account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.loadBalancers.account.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 load-balancers account update <load-balancer-id>
|
|
14
|
+
|
|
15
|
+
Update a configured account or zone-scoped load balancer.`).positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).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:`update <load-balancer-id>`,describe:`Update account or zone Load Balancer`,builder:w,handler:async m=>c({command:`load-balancers account update`,classification:{safeFlags:[`adaptive-routing-failover-across-pools`,`enabled`,`location-strategy-mode`,`location-strategy-prefer-ecs`,`proxied`,`session-affinity`,`session-affinity-attributes-require-all-headers`,`session-affinity-attributes-samesite`,`session-affinity-attributes-secure`,`session-affinity-attributes-zero-downtime-failover`,`steering-policy`,`dry-run`]}},m,async()=>{if(m.dryRun){let e=m.zone===void 0?await r():void 0,t=m.zone===void 0?`accounts`:`zones`,n=m.zone??e??`<account-id>`;o({command:`cf load-balancers account update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/load_balancers/${m[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(m[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n),"load-balancer-id":String(m[`load-balancer-id`]??``)},bodyKind:`json`,body:m.body===void 0?d({adaptive_routing:{failover_across_pools:m[`adaptive-routing-failover-across-pools`]},default_pools:m[`default-pools`],description:f(m.description,`description`,`text`),enabled:m.enabled,fallback_pool:f(m[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(m[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(m[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(m.name,`name`,`text`),networks:m.networks,proxied:m.proxied,random_steering:{default_weight:m[`random-steering-default-weight`]},rules:u(m.rules,`rules`),session_affinity:f(m[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:m[`session-affinity-attributes-drain-duration`],headers:m[`session-affinity-attributes-headers`],require_all_headers:m[`session-affinity-attributes-require-all-headers`],samesite:f(m[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(m[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(m[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:m[`session-affinity-ttl`],steering_policy:f(m[`steering-policy`],`steering-policy`,`text`),ttl:m.ttl}):l(m.body)});return}let c=await i(m),h=m.zone===void 0?`accounts`:`zones`,g=h===`zones`?await t({zone:m.zone},c,{quiet:m.quiet}):m.local?e:await n();if(h===`zones`?m.zoneId=g:m.accountId=g,m.body){let e=l(m.body);a(await s(`Updating`,async()=>c.loadBalancers.account.update({...e,account_or_zone:h,account_or_zone_id:g,load_balancer_id:m[`load-balancer-id`]})),{successLabel:`Updated`});return}if(m[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);m[`fallback-pool`]===void 0&&(m[`fallback-pool`]=await p(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),m.name===void 0&&(m.name=await p(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let _=d({adaptive_routing:{failover_across_pools:m[`adaptive-routing-failover-across-pools`]},default_pools:m[`default-pools`],description:f(m.description,`description`,`text`),enabled:m.enabled,fallback_pool:f(m[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:f(m[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:f(m[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:f(m.name,`name`,`text`),networks:m.networks,proxied:m.proxied,random_steering:{default_weight:m[`random-steering-default-weight`]},rules:u(m.rules,`rules`),session_affinity:f(m[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:m[`session-affinity-attributes-drain-duration`],headers:m[`session-affinity-attributes-headers`],require_all_headers:m[`session-affinity-attributes-require-all-headers`],samesite:f(m[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:f(m[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:f(m[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:m[`session-affinity-ttl`],steering_policy:f(m[`steering-policy`],`steering-policy`,`text`),ttl:m.ttl});a(await s(`Updating`,async()=>c.loadBalancers.account.update({..._,account_or_zone:h,account_or_zone_id:g,load_balancer_id:m[`load-balancer-id`]})),{successLabel:`Updated`})})};function E(e){return e.usage(`$0 load-balancers account usage list
|
|
16
|
+
|
|
17
|
+
Get current load balancer resource usage counts for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List Load Balancer Usage`,builder:E,handler:async t=>c({command:`load-balancers account usage list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers account usage list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/usage`,pathParams:{},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.account.usage.list({account_id:l})),{successLabel:`Loaded`})})},O={command:`usage`,describe:`Operations for account.usage`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},k={command:`account`,describe:`Operations for account`,builder:e=>e.command(_).command(te).command(y).command(x).command(C).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.usage(`$0 load-balancers monitor-groups create
|
|
18
|
+
|
|
19
|
+
Create a new monitor group.`).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Create Monitor Group`,builder:A,handler:async t=>c({command:`load-balancers monitor-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)}):l(t.body)});return}let c=await i(t),m=t.local?e:await n();if(t.accountId=m,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.loadBalancers.monitorGroups.create({body:e,account_id:m})),{successLabel:`Created`});return}if(t.description===void 0&&(t.description=await p(`description`,`A short description of the monitor group`)),t.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)});a(await s(`Creating`,async()=>c.loadBalancers.monitorGroups.create({body:h,account_id:m})),{successLabel:`Created`})})};function M(e){return e.usage(`$0 load-balancers monitor-groups delete <monitor-group-id>
|
|
20
|
+
|
|
21
|
+
Delete a configured monitor group.`).positional(`monitor-group-id`,{type:`string`,description:`Monitor group 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 N={command:`delete <monitor-group-id>`,describe:`Delete Monitor Group`,builder:M,handler:async t=>c({command:`load-balancers monitor-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups/${t[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(t[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(t[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await m({force:!!t.force})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.monitorGroups.delete({account_id:l,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Deleted`})})};function P(e){return e.usage(`$0 load-balancers monitor-groups edit <monitor-group-id>
|
|
23
|
+
|
|
24
|
+
Apply changes to an existing monitor group, overwriting the supplied properties.`).positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`edit <monitor-group-id>`,describe:`Patch Monitor Group`,builder:P,handler:async t=>c({command:`load-balancers monitor-groups edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups/${t[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(t[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(t[`monitor-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)}):l(t.body)});return}let c=await i(t),m=t.local?e:await n();if(t.accountId=m,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.monitorGroups.edit({body:e,account_id:m,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Updated`});return}if(t.description===void 0&&(t.description=await p(`description`,`A short description of the monitor group`)),t.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)});a(await s(`Updating`,async()=>c.loadBalancers.monitorGroups.edit({body:h,account_id:m,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Updated`})})};function I(e){return e.usage(`$0 load-balancers monitor-groups get <monitor-group-id>
|
|
25
|
+
|
|
26
|
+
Fetch a single configured monitor group.`).positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <monitor-group-id>`,describe:`Monitor Group Details`,builder:I,handler:async t=>c({command:`load-balancers monitor-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups/${t[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(t[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(t[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.get({account_id:l,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Loaded`})})};function R(e){return e.usage(`$0 load-balancers monitor-groups list
|
|
27
|
+
|
|
28
|
+
List configured monitor groups.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List Monitor Groups`,builder:R,handler:async t=>c({command:`load-balancers monitor-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.list({account_id:l})),{successLabel:`Loaded`})})};function B(e){return e.usage(`$0 load-balancers monitor-groups references list
|
|
29
|
+
|
|
30
|
+
Get the list of resources that reference the provided monitor group.`).option(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`List Monitor Group References`,builder:B,handler:async t=>c({command:`load-balancers monitor-groups references list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups/${t[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(t[`monitor-group-id`]))}/references`,pathParams:{"monitor-group-id":String(t[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.references.list({account_id:l,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Loaded`})})},H={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.usage(`$0 load-balancers monitor-groups update <monitor-group-id>
|
|
31
|
+
|
|
32
|
+
Modify a configured monitor group.`).positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update <monitor-group-id>`,describe:`Update Monitor Group`,builder:U,handler:async t=>c({command:`load-balancers monitor-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitor_groups/${t[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(t[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(t[`monitor-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)}):l(t.body)});return}let c=await i(t),m=t.local?e:await n();if(t.accountId=m,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.monitorGroups.update({body:e,account_id:m,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Updated`});return}if(t.description===void 0&&(t.description=await p(`description`,`A short description of the monitor group`)),t.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=d({description:f(t.description,`description`,`text`),members:u(t.members,`members`)});a(await s(`Updating`,async()=>c.loadBalancers.monitorGroups.update({body:h,account_id:m,monitor_group_id:t[`monitor-group-id`]})),{successLabel:`Updated`})})},G={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(W).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.usage(`$0 load-balancers monitors create
|
|
33
|
+
|
|
34
|
+
Create a configured monitor.`).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).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:`create`,describe:`Create Monitor`,builder:K,handler:async t=>c({command:`load-balancers monitors create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.loadBalancers.monitors.create({body:e,account_id:u})),{successLabel:`Created`});return}let p=d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)});a(await s(`Creating`,async()=>c.loadBalancers.monitors.create({body:p,account_id:u})),{successLabel:`Created`})})};function J(e){return e.usage(`$0 load-balancers monitors delete <monitor-id>
|
|
35
|
+
|
|
36
|
+
Delete a configured monitor.`).positional(`monitor-id`,{type:`string`,description:`Monitor 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 Y={command:`delete <monitor-id>`,describe:`Delete Monitor`,builder:J,handler:async t=>c({command:`load-balancers monitors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await m({force:!!t.force})){process.stderr.write(`Aborted.
|
|
37
|
+
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.monitors.delete({account_id:l,monitor_id:t[`monitor-id`]})),{successLabel:`Deleted`})})};function X(e){return e.usage(`$0 load-balancers monitors edit <monitor-id>
|
|
38
|
+
|
|
39
|
+
Apply changes to an existing monitor, overwriting the supplied properties.`).positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`]}).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:`edit <monitor-id>`,describe:`Patch Monitor`,builder:X,handler:async t=>c({command:`load-balancers monitors edit`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.monitors.edit({body:e,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Updated`});return}let p=d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)});a(await s(`Updating`,async()=>c.loadBalancers.monitors.edit({body:p,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Updated`})})};function Q(e){return e.usage(`$0 load-balancers monitors get <monitor-id>
|
|
40
|
+
|
|
41
|
+
List a single configured monitor for an account.`).positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <monitor-id>`,describe:`Monitor Details`,builder:Q,handler:async t=>c({command:`load-balancers monitors get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.get({account_id:l,monitor_id:t[`monitor-id`]})),{successLabel:`Loaded`})})};function re(e){return e.usage(`$0 load-balancers monitors list
|
|
42
|
+
|
|
43
|
+
List configured monitors for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`List Monitors`,builder:re,handler:async t=>c({command:`load-balancers monitors list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.list({account_id:l})),{successLabel:`Loaded`})})};function ae(e){return e.usage(`$0 load-balancers monitors previews create <monitor-id>
|
|
44
|
+
|
|
45
|
+
Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.`).positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`create <monitor-id>`,describe:`Preview Monitor`,builder:ae,handler:async t=>c({command:`load-balancers monitors previews create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}/preview`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.loadBalancers.monitors.previews.create({body:e,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Created`});return}let p=d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)});a(await s(`Creating`,async()=>c.loadBalancers.monitors.previews.create({body:p,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Created`})})},se={command:`previews`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.usage(`$0 load-balancers monitors references get <monitor-id>
|
|
46
|
+
|
|
47
|
+
Get the list of resources that reference the provided monitor.`).positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get <monitor-id>`,describe:`List Monitor References`,builder:ce,handler:async t=>c({command:`load-balancers monitors references get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}/references`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.references.get({account_id:l,monitor_id:t[`monitor-id`]})),{successLabel:`Loaded`})})},ue={command:`references`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.usage(`$0 load-balancers monitors update <monitor-id>
|
|
48
|
+
|
|
49
|
+
Modify a configured monitor.`).positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`]}).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 fe={command:`update <monitor-id>`,describe:`Update Monitor`,builder:de,handler:async t=>c({command:`load-balancers monitors update`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/monitors/${t[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(t[`monitor-id`]))}`,pathParams:{"monitor-id":String(t[`monitor-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.monitors.update({body:e,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Updated`});return}let p=d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)});a(await s(`Updating`,async()=>c.loadBalancers.monitors.update({body:p,account_id:u,monitor_id:t[`monitor-id`]})),{successLabel:`Updated`})})},pe={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(ie).command(fe).command(se).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.usage("$0 load-balancers pools bulk-edit\n\nApply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending `name`. Returns the list of affected pools. Supports the standard pagination query parameters, either `limit`/`offset` or `per_page`/`page`.").option(`notification-email`,{type:`string`,description:'The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only resetting this field with an empty string `""` is accepted.'}).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 he={command:`bulk-edit`,describe:`Patch Pools`,builder:me,handler:async t=>c({command:`load-balancers pools bulk-edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({notification_email:f(t[`notification-email`],`notification-email`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.pools.bulkEdit({body:e,account_id:u})),{successLabel:`Updated`});return}let p=d({notification_email:f(t[`notification-email`],`notification-email`,`text`)});a(await s(`Updating`,async()=>c.loadBalancers.pools.bulkEdit({body:p,account_id:u})),{successLabel:`Updated`})})};function ge(e){return e.usage(`$0 load-balancers pools create
|
|
50
|
+
|
|
51
|
+
Create a new pool.`).option(`description`,{type:`string`,description:`A human-readable description of the pool.`,default:``}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`,default:!0}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`]}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`,default:1}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`,default:``}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`]}).option(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`create`,describe:`Create Pool`,builder:ge,handler:async t=>c({command:`load-balancers pools create`,classification:{safeFlags:[`enabled`,`load-shedding-default-policy`,`load-shedding-session-policy`,`notification-filter-origin-disable`,`notification-filter-origin-healthy`,`notification-filter-pool-disable`,`notification-filter-pool-healthy`,`origin-steering-policy`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),enabled:t.enabled,latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)}):l(t.body)});return}let c=await i(t),m=t.local?e:await n();if(t.accountId=m,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.loadBalancers.pools.create({...e,account_id:m})),{successLabel:`Created`});return}if(t.name===void 0&&(t.name=await p(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),t.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let h=d({description:f(t.description,`description`,`text`),enabled:t.enabled,latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)});a(await s(`Creating`,async()=>c.loadBalancers.pools.create({...h,account_id:m})),{successLabel:`Created`})})};function ve(e){return e.usage(`$0 load-balancers pools delete <pool-id>
|
|
52
|
+
|
|
53
|
+
Delete a configured pool.`).positional(`pool-id`,{type:`string`,description:`Pool 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 <pool-id>`,describe:`Delete Pool`,builder:ve,handler:async t=>c({command:`load-balancers pools delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await m({force:!!t.force})){process.stderr.write(`Aborted.
|
|
54
|
+
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.pools.delete({account_id:l,pool_id:t[`pool-id`]})),{successLabel:`Deleted`})})};function be(e){return e.usage(`$0 load-balancers pools edit <pool-id>
|
|
55
|
+
|
|
56
|
+
Apply changes to an existing pool, overwriting the supplied properties.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`}).option(`health-sources`,{type:`string`,array:!0,description:`A list of health sources, ordered from highest to lowest priority, used to evaluate individual origin health and overall pool health. The load balancer uses the first source that has data and falls back to the next. Currently accepted values are null or the exact array ["regional", "global"]; any other combination is rejected. Null (the default) behaves like ["local", "global"]. ["regional", "global"] makes each region steer on its own health, falling back to the global decision when a region has no fresh data. Setting regional requires at least one region in check_regions.`}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`]}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`]}).option(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`edit <pool-id>`,describe:`Patch Pool`,builder:be,handler:async t=>c({command:`load-balancers pools edit`,classification:{safeFlags:[`enabled`,`load-shedding-default-policy`,`load-shedding-session-policy`,`notification-filter-origin-disable`,`notification-filter-origin-healthy`,`notification-filter-pool-disable`,`notification-filter-pool-healthy`,`origin-steering-policy`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({check_regions:t[`check-regions`],description:f(t.description,`description`,`text`),enabled:t.enabled,health_sources:t[`health-sources`],latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)}):l(t.body)});return}let c=await i(t),p=t.local?e:await n();if(t.accountId=p,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.pools.edit({...e,account_id:p,pool_id:t[`pool-id`]})),{successLabel:`Updated`});return}let m=d({check_regions:t[`check-regions`],description:f(t.description,`description`,`text`),enabled:t.enabled,health_sources:t[`health-sources`],latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)});a(await s(`Updating`,async()=>c.loadBalancers.pools.edit({...m,account_id:p,pool_id:t[`pool-id`]})),{successLabel:`Updated`})})};function Se(e){return e.usage(`$0 load-balancers pools get <pool-id>
|
|
57
|
+
|
|
58
|
+
Fetch a single configured pool.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get <pool-id>`,describe:`Pool Details`,builder:Se,handler:async t=>c({command:`load-balancers pools get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.get({account_id:l,pool_id:t[`pool-id`]})),{successLabel:`Loaded`})})};function we(e){return e.usage(`$0 load-balancers pools health create <pool-id>
|
|
59
|
+
|
|
60
|
+
Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).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 <pool-id>`,describe:`Preview Pool`,builder:we,handler:async t=>c({command:`load-balancers pools health create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools health create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}/preview`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.loadBalancers.pools.health.create({body:e,account_id:u,pool_id:t[`pool-id`]})),{successLabel:`Created`});return}let p=d({allow_insecure:t[`allow-insecure`],consecutive_down:t[`consecutive-down`],consecutive_up:t[`consecutive-up`],description:f(t.description,`description`,`text`),expected_body:f(t[`expected-body`],`expected-body`,`text`),expected_codes:f(t[`expected-codes`],`expected-codes`,`text`),follow_redirects:t[`follow-redirects`],interval:t.interval,method:f(t.method,`method`,`text`),path:f(t.path,`path`,`text`),port:t.port,probe_zone:f(t[`probe-zone`],`probe-zone`,`text`),retries:t.retries,timeout:t.timeout,type:f(t.type,`type`,`text`)});a(await s(`Creating`,async()=>c.loadBalancers.pools.health.create({body:p,account_id:u,pool_id:t[`pool-id`]})),{successLabel:`Created`})})};function Ee(e){return e.usage(`$0 load-balancers pools health get <pool-id>
|
|
61
|
+
|
|
62
|
+
Fetch the latest pool health status for a single pool.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`get <pool-id>`,describe:`Pool Health Details`,builder:Ee,handler:async t=>c({command:`load-balancers pools health get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools health get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}/health`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.health.get({account_id:l,pool_id:t[`pool-id`]})),{successLabel:`Loaded`})})},Oe={command:`health`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(Te).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.usage(`$0 load-balancers pools list
|
|
63
|
+
|
|
64
|
+
List configured pools.`).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`list`,describe:`List Pools`,builder:ke,handler:async t=>c({command:`load-balancers pools list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={monitor:t.monitor};if(t.dryRun){o({command:`cf load-balancers pools list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.pools.list({account_id:u,...c})),{successLabel:`Loaded`})})};function je(e){return e.usage(`$0 load-balancers pools references get <pool-id>
|
|
65
|
+
|
|
66
|
+
Get the list of resources that reference the provided pool.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`get <pool-id>`,describe:`List Pool References`,builder:je,handler:async t=>c({command:`load-balancers pools references get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}/references`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.references.get({account_id:l,pool_id:t[`pool-id`]})),{successLabel:`Loaded`})})},Ne={command:`references`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.usage(`$0 load-balancers pools update <pool-id>
|
|
67
|
+
|
|
68
|
+
Modify a configured pool.`).positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`}).option(`health-sources`,{type:`string`,array:!0,description:`A list of health sources, ordered from highest to lowest priority, used to evaluate individual origin health and overall pool health. The load balancer uses the first source that has data and falls back to the next. Currently accepted values are null or the exact array ["regional", "global"]; any other combination is rejected. Null (the default) behaves like ["local", "global"]. ["regional", "global"] makes each region steer on its own health, falling back to the global decision when a region has no fresh data. Setting regional requires at least one region in check_regions.`}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`]}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`]}).option(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`update <pool-id>`,describe:`Update Pool`,builder:Pe,handler:async t=>c({command:`load-balancers pools update`,classification:{safeFlags:[`enabled`,`load-shedding-default-policy`,`load-shedding-session-policy`,`notification-filter-origin-disable`,`notification-filter-origin-healthy`,`notification-filter-pool-disable`,`notification-filter-pool-healthy`,`origin-steering-policy`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/pools/${t[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(t[`pool-id`]))}`,pathParams:{"pool-id":String(t[`pool-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({check_regions:t[`check-regions`],description:f(t.description,`description`,`text`),enabled:t.enabled,health_sources:t[`health-sources`],latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)}):l(t.body)});return}let c=await i(t),m=t.local?e:await n();if(t.accountId=m,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.loadBalancers.pools.update({...e,account_id:m,pool_id:t[`pool-id`]})),{successLabel:`Updated`});return}if(t.name===void 0&&(t.name=await p(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),t.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let h=d({check_regions:t[`check-regions`],description:f(t.description,`description`,`text`),enabled:t.enabled,health_sources:t[`health-sources`],latitude:t.latitude,load_shedding:{default_percent:t[`load-shedding-default-percent`],default_policy:f(t[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:t[`load-shedding-session-percent`],session_policy:f(t[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:t.longitude,minimum_origins:t[`minimum-origins`],monitor:f(t.monitor,`monitor`,`text`),monitor_group:f(t[`monitor-group`],`monitor-group`,`text`),name:f(t.name,`name`,`text`),notification_email:f(t[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:t[`notification-filter-origin-disable`],healthy:t[`notification-filter-origin-healthy`]},pool:{disable:t[`notification-filter-pool-disable`],healthy:t[`notification-filter-pool-healthy`]}},origin_steering:{policy:f(t[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:u(t.origins,`origins`)});a(await s(`Updating`,async()=>c.loadBalancers.pools.update({...h,account_id:m,pool_id:t[`pool-id`]})),{successLabel:`Updated`})})},Fe={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(he).command(_e).command(ye).command(xe).command(Ce).command(Ae).command($).command(Oe).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.usage(`$0 load-balancers previews get <preview-id>
|
|
69
|
+
|
|
70
|
+
Get the result of a previous preview operation using the provided preview_id.`).positional(`preview-id`,{type:`string`,description:`Preview ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <preview-id>`,describe:`Preview Result`,builder:Ie,handler:async t=>c({command:`load-balancers previews get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/preview/${t[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(t[`preview-id`]))}`,pathParams:{"preview-id":String(t[`preview-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.previews.get({account_id:l,preview_id:t[`preview-id`]})),{successLabel:`Loaded`})})},Re={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.usage(`$0 load-balancers regions get <region-id>
|
|
71
|
+
|
|
72
|
+
Get a single region mapping.`).positional(`region-id`,{type:`string`,description:`A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`get <region-id>`,describe:`Get Region`,builder:ze,handler:async t=>c({command:`load-balancers regions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf load-balancers regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/regions/${t[`region-id`]==null?`<region-id>`:encodeURIComponent(String(t[`region-id`]))}`,pathParams:{"region-id":String(t[`region-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.regions.get({account_id:l,region_id:t[`region-id`]})),{successLabel:`Loaded`})})};function Ve(e){return e.usage(`$0 load-balancers regions list
|
|
73
|
+
|
|
74
|
+
List all region mappings.`).option(`subdivision-code`,{type:`string`,description:`Two-letter subdivision code followed in ISO 3166-2.`}).option(`subdivision-code-a2`,{type:`string`,description:`Two-letter subdivision code followed in ISO 3166-2.`}).option(`country-code-a2`,{type:`string`,description:`Two-letter alpha-2 country code followed in ISO 3166-1.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`list`,describe:`List Regions`,builder:Ve,handler:async t=>c({command:`load-balancers regions list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={subdivision_code:t[`subdivision-code`],subdivision_code_a2:t[`subdivision-code-a2`],country_code_a2:t[`country-code-a2`]};if(t.dryRun){o({command:`cf load-balancers regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/regions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.regions.list({account_id:u,...c})),{successLabel:`Loaded`})})},Ue={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.usage(`$0 load-balancers searches list
|
|
75
|
+
|
|
76
|
+
Search for Load Balancing resources.`).option(`query`,{type:`string`,description:`Search query term.`}).option(`references`,{type:`string`,description:`The type of references to include. "*" to include both referral and referrer references. "" to not include any reference information.`,choices:[``,`*`,`referral`,`referrer`]}).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 Ge={command:`list`,describe:`Search Resources`,builder:h(We),handler:async t=>c({command:`load-balancers searches list`,classification:{safeFlags:[`references`,`dry-run`]}},t,async()=>{let c={query:t.query,references:t.references,page:t.page,per_page:t[`per-page`]};if(t.dryRun){o({command:`cf load-balancers searches list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/load_balancers/search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.searches.list({account_id:u,...c})),{successLabel:`Loaded`})})},Ke={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qe={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(k).command(G).command(pe).command(Fe).command(Re).command(Ue).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{qe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const e=`This command has no local equivalent. Re-run without --local to use the Cloudflare API.`;let t;async function n(){let e=t;t=void 0,await e?.()}function r(e={}){return async function(n,r){let{dispatchLocal:i,disposeLocalSession:a}=await import(`./local-runtime-DD8DAIlm.mjs`);return t=a,i(new Request(n,r),e.persistTo,e.apiBaseUrl)}}const i=`local`;export{n as i,e as n,r,i as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./local-
|
|
2
|
+
import{n as e}from"./local-B6b2OIBW.mjs";import{i as t}from"./cf-oadujOtC.mjs";import{n}from"./registry-vreNkX6u.mjs";import{mkdtempSync as r,rmSync as i,statSync as a}from"node:fs";import{join as o,resolve as s}from"node:path";import{tmpdir as c}from"node:os";import{randomUUID as l}from"node:crypto";import{Miniflare as u}from"miniflare";const d=/^\/accounts\/[^/]+/;function f(e){let n=e!==void 0&&e!==``?o(s(process.cwd(),e),`v3`):o(t(),`state`,`v3`);try{if(!a(n).isDirectory())throw Error(`Local persistence path must be a directory: ${n}`)}catch(e){let t=e.code;if(t===`ENOENT`)return n;throw t===`ENOTDIR`?Error(`Local persistence path must be a directory: ${n}`):e}return n}let p;function m(e){let t=n(),a=r(o(c(),`cf-local-isolated-${process.pid}-`));try{return{mf:new u({unsafeLocalExplorer:!0,cf:!1,resourcePersistencePath:e,unsafeEnableSharedStorage:!0,isolatedResourcePersistencePath:a,unsafeDevRegistryPath:t,workers:[{config:{name:`cf-local-${l()}`,compatibilityDate:`2026-08-15`,manifest:{mainModule:`cf-local.mjs`,modules:{"cf-local.mjs":{type:`esm`,contents:`export default { fetch() { return new Response(null, { status: 404 }); } };`}}}}}]}),isolatedPersistRoot:a}}catch(e){throw i(a,{recursive:!0,force:!0}),e}}async function h(t,n,r){let i=new URL(t.url),a=new URL(r??`https://api.cloudflare.com/client/v4`).pathname.replace(/\/+$/,``),o=`http://localhost/cdn-cgi/local/explorer/api${i.pathname.slice(a.length).replace(d,``)||`/`}${i.search}`,s=new Headers(t.headers);s.delete(`Authorization`),s.set(`Host`,`localhost`);let c;try{c=p??=m(f(n))}catch(e){return g(500,`Could not start the local runtime: ${_(e)}`)}let l;try{let e={method:t.method,headers:[...s],redirect:`manual`,signal:t.signal};t.body!==null&&(e.body=t.body,e.duplex=`half`),l=await c.mf.dispatchFetch(o,e)}catch(e){return g(500,`The local runtime failed to answer: ${_(e)}`)}if(l.status===404&&l.headers.get(`content-type`)?.includes(`json`)!==!0){await l.body?.cancel();let n=new URL(o).pathname.replace(/^.*\/explorer\/api/,``);return g(404,`${e} The local explorer API does not implement ${t.method} ${n}.`)}return l}function g(e,t){return new Response(JSON.stringify({success:!1,errors:[{message:t}],messages:[],result:null}),{status:e,headers:{"content-type":`application/json`}})}function _(e){return e instanceof Error?e.message:String(e)}async function v(){let e=p;if(p=void 0,e!==void 0)try{let{mf:t,isolatedPersistRoot:n}=e;await t.dispose().finally(()=>i(n,{recursive:!0,force:!0}))}catch{}}export{h as dispatchLocal,v as disposeLocalSession};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{m as e,o as t}from"./chunk-XLADBZ7F-BXKOjWbx.mjs";import{a as n}from"./theme-BiIYWOed.mjs";import{a as r,i,r as a}from"./ui-DH95w1Qk.mjs";import{c as o,d as s,i as c,l,o as u,p as d,r as f,s as p,u as m}from"./oauth-D4bkeMAw.mjs";import"./auth-Cp7gT-AF.mjs";import{t as h}from"./output-Bia1u2k5.mjs";import g from"node:path";function _(e,t,n){if(!e.profile)return;let r=n?` ${n}`:``;throw Error(`The --profile flag cannot be used with \`cf auth ${t}\`.${r}`)}function v(){if(t({allowGlobalAuthKey:!1})!==void 0)throw Error(`Cannot manage auth profiles while CLOUDFLARE_API_TOKEN is set. Unset CLOUDFLARE_API_TOKEN and try again.`)}const y={command:`create <name>`,describe:`Create or re-authenticate a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name for the auth profile`,demandOption:!0}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async t=>{_(t,`create`,"Pass the profile name as the command argument: `cf auth create <name>`."),v(),e(t.name);let r=u().configs.exists(t.name);await l({browser:t.browser,device:t.device,scopes:t.scopes,profile:t.name}),console.log(i(r?`Profile "${t.name}" re-authenticated.`:`Profile "${t.name}" created.`)),console.log(a(`Run ${n.code(`cf auth activate ${t.name}`)} to use this profile in a directory.`))}},b={command:`delete <name>`,describe:`Delete a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to delete`,demandOption:!0}),handler:async t=>{_(t,`delete`),v(),e(t.name);let r=u();if(!r.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist.`);let o=r.bindings.removeAllBindingsForProfile(t.name);if(o.length>0){console.log(i(`Removed directory bindings:`));for(let e of o)console.log(` ${e}`)}await m(t.name),r.configs.delete(t.name),console.log(i(`Profile "${t.name}" deleted.`));let s=r.bindings.getProfileForDirectory(process.cwd());s?console.log(i(`Active profile for this directory: ${s}.`)):r.configs.exists(`default`)?console.log(i(`This directory now uses the default profile.`)):console.log(a(`No active profile for this directory. Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`))}},x={command:`activate <name> [dir]`,describe:`Bind a named auth profile to a directory`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to activate`,demandOption:!0}).positional(`dir`,{type:`string`,description:`Directory to bind the profile to (defaults to current directory)`}),handler:t=>{_(t,`activate`,"Pass the profile name as the command argument: `cf auth activate <name>`."),v(),e(t.name);let n=u();if(!n.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist. Run \`cf auth create ${t.name}\` first.`);let r=t.dir??process.cwd();n.bindings.activate(t.name,r),console.log(i(`Profile "${t.name}" activated for "${g.resolve(r)}".`))}},S={command:`deactivate [dir]`,describe:`Remove the auth profile binding from a directory`,builder:e=>e.positional(`dir`,{type:`string`,description:`Directory to unbind (defaults to current directory). Must be the exact directory the profile was bound to.`}),handler:e=>{_(e,`deactivate`),v();let t=u(),r=e.dir??process.cwd(),{removedProfile:o,newResolution:s}=t.bindings.deactivate(r);console.log(i(`Profile "${o}" deactivated from "${g.resolve(r)}".`)),s.profile===void 0?console.log(a(`Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`)):s.profile===`default`?console.log(i(`This directory now uses the default profile.`)):console.log(i(`Now using: ${s.profile} (${s.source}).`))}},C={command:`list`,describe:`List all auth profiles`,handler:e=>{_(e,`list`);let t=u(),n=t.bindings.read(),r={};for(let[e,t]of Object.entries(n))(r[t]??=[]).push(e);h(t.configs.list().map(e=>({name:e,boundDirectories:r[e]??[]})))}},w={safeFlags:[`force`,`browser`,`device`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}},T={command:`login`,describe:`Authenticate with Cloudflare`,builder:e=>e.option(`force`,{type:`boolean`,alias:`f`,description:`Force re-authentication even if already logged in`,default:!1}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async e=>{_(e,`login`,"Run `cf auth create <name>` to authenticate a named profile.");let t=f();if(t!==`default`&&console.log(r(`This directory has profile "${t}" active. \`cf auth login\` updates the default profile, not "${t}".\nTo re-authenticate "${t}", run \`cf auth create ${t}\`.`)),d(`default`),!e.force&&o()){if(await p()){let e=s();console.log(i(`You are already logged in.`)),console.log(`${n.info(`Config file:`)} ${n.muted(c())}`),e?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(e.expiration_time).toLocaleString()}`),console.log(a(`Run ${n.code(`cf auth login --force`)} to re-authenticate, or ${n.code(`cf auth logout`)} to log out.`));return}console.log(r(`Existing tokens are invalid or expired. Starting fresh login...
|
|
3
|
+
`))}else e.force&&o()&&console.log(i(`Re-authenticating...
|
|
4
|
+
`));if(console.log(i(`Starting OAuth login flow...
|
|
5
|
+
`)),!await l({browser:e.browser,device:e.device,scopes:e.scopes,profile:`default`})){console.log(r(`CLOUDFLARE_API_TOKEN is set and takes precedence. Unset it to log in via OAuth.`));return}let u=s();console.log(`${n.info(`Config file:`)} ${n.muted(c())}`),u?.scopes&&console.log(`${n.info(`Scopes:`)} ${u.scopes.join(`, `)}`),u?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(u.expiration_time).toLocaleString()}`)}};export{y as a,C as c,_ as i,w as n,S as o,x as r,b as s,T as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as e}from"./theme-BiIYWOed.mjs";import{i as t}from"./ui-DH95w1Qk.mjs";import{n}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as r,t as i}from"./login-CEQbOgBM.mjs";var a=n({...i,describe:!1,handler:async n=>{n.quiet||console.error(t(`${e.code(`cf login`)} is an alias for ${e.code(`cf auth login`)}. Authentication commands are under ${e.code(`cf auth`)}.`)),await i.handler(n)}},{command:`login`,classification:r});export{a as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{r}from"./auth-Cp7gT-AF.mjs";import{t as i}from"./output-Bia1u2k5.mjs";import{t as a}from"./dry-run-CLX6Pbtq.mjs";import{t as o}from"./progress-Bi02B6v4.mjs";import{t as s}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";function c(e){return e.usage(`$0 logo-matches download get
|
|
3
|
+
|
|
4
|
+
Return matches as CSV for logo queries based on ID`).option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Download matches for logo queries by ID`,builder:c,handler:async c=>s({command:`logo-matches download get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={logo_id:c[`logo-id`],offset:c.offset,limit:c.limit};if(c.dryRun){a({command:`cf logo-matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches/download`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.download.get({account_id:u,...s})),{successLabel:`Loaded`})})},u={command:`download`,describe:`Operations for download`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function d(e){return e.usage(`$0 logo-matches get
|
|
5
|
+
|
|
6
|
+
Return matches for logo queries based on ID`).option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Read matches for logo queries by ID`,builder:d,handler:async c=>s({command:`logo-matches get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={logo_id:c[`logo-id`],offset:c.offset,limit:c.limit};if(c.dryRun){a({command:`cf logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.get({account_id:u,...s})),{successLabel:`Loaded`})})},p={command:`logo-matches`,describe:`logo-matches`,builder:e=>e.command(f).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{a as r,r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,t as u}from"./input-validation-Ch4Vllrm.mjs";import{n as d}from"./prompt-Bx2PB-tt.mjs";function f(e){return e.usage(`$0 logos create
|
|
3
|
+
|
|
4
|
+
Return new saved logo queries created from image files`).option(`tag`,{type:`string`,description:`Tag`}).option(`match-type`,{type:`string`,description:`Match type`}).option(`threshold`,{type:`number`,description:`Threshold`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={command:`create`,describe:`Create new saved logo queries from image files`,builder:f,handler:async d=>c({command:`logos create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{let c={tag:d.tag,match_type:d[`match-type`],threshold:d.threshold};if(d.dryRun){o({command:`cf logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos`,pathParams:{},query:c,bodyKind:`octet-stream`,body:d.body});return}let f=await i(d),p=d.local?e:await t();if(d.accountId=p,d.file){let e=u(d.file);a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(d.body){let e=l(d.body,`body`,`binary`),t=new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function m(e){return e.usage(`$0 logos delete <logo-id>
|
|
5
|
+
|
|
6
|
+
Return a success message after deleting saved logo queries by ID`).positional(`logo-id`,{type:`string`,description:`Logo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <logo-id>`,describe:`Delete saved logo queries by ID`,builder:m,handler:async r=>c({command:`logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos/${r[`logo-id`]==null?`<logo-id>`:encodeURIComponent(String(r[`logo-id`]))}`,pathParams:{"logo-id":String(r[`logo-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await d({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.logos.delete({account_id:l,logo_id:r[`logo-id`]})),{successLabel:`Deleted`})})},g={command:`logos`,describe:`logos`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|