cf 1.0.0-beta.26 → 1.0.0-beta.28
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 +7373 -4926
- package/dist/_meta/hand-written-commands.json +2 -2
- package/dist/_meta/schemas.json +11614 -4465
- package/dist/abuse-reports-D9edOyag.mjs +24 -0
- package/dist/{access-DCOOmDC5.mjs → access-CKCCSrrU.mjs} +1 -1
- package/dist/{accounts-HC6XuIwP.mjs → accounts-CNb9U9bK.mjs} +33 -27
- package/dist/{acm-DYgr6SAR.mjs → acm-CdKTAToZ.mjs} +3 -3
- package/dist/{addressing-BS66pJ_a.mjs → addressing-eZI_C-b0.mjs} +18 -18
- package/dist/{agent-memory-BbXdueL0.mjs → agent-memory-BBHCEE7h.mjs} +7 -7
- package/dist/{ai-BiIKznNv.mjs → ai-Csl_QNwv.mjs} +7 -7
- package/dist/ai-audit-DlqWsQi-.mjs +6 -0
- package/dist/{ai-gateway-rlYCbts5.mjs → ai-gateway-Lj4On37s.mjs} +13 -13
- package/dist/ai-search-BxyhS3X7.mjs +74 -0
- package/dist/{ai-security-BUwS6kVh.mjs → ai-security-DvU2iYkY.mjs} +3 -3
- package/dist/{alerting-BSzuvFk1.mjs → alerting-r0G2X9y9.mjs} +10 -10
- package/dist/analytics-C6bfqm-W.mjs +17 -0
- package/dist/analytics-engine-BlIecoOe.mjs +4 -0
- package/dist/api-Dnt6lRJG.mjs +3 -0
- package/dist/{api-security-BBxEJjGv.mjs → api-security-DZ7GWOqD.mjs} +26 -26
- package/dist/argo-Bh0_cj49.mjs +14 -0
- package/dist/{artifacts-B9g9aPrk.mjs → artifacts-VZJWVq_6.mjs} +16 -16
- package/dist/{audit-logs-BhJs-OS2.mjs → audit-logs-B8cGL4B9.mjs} +1 -1
- package/dist/auth-B-h0BHg7.mjs +2 -0
- package/dist/auth-B6tswVxH.mjs +2 -0
- package/dist/{auth-C50SqX9F.mjs → auth-clmqFEWU.mjs} +3 -3
- package/dist/{auth-token-DvNoIhRL.mjs → auth-token-DW4dJVdj.mjs} +1 -1
- package/dist/{autoconfig-ldsgXxa6.mjs → autoconfig-C0ynlGHf.mjs} +23 -23
- package/dist/{basin-catalog-CtKFiH-n.mjs → basin-catalog-TehR1sKZ.mjs} +11 -11
- package/dist/billing-B2KusU6g.mjs +22 -0
- package/dist/{blocks-DnNrvi8s.mjs → blocks-BFulF68V.mjs} +1 -1
- package/dist/body-parser-DoewLePl.mjs +2 -0
- package/dist/body-unions-DNs981Ia.mjs +2 -0
- package/dist/bot-management-CXHXgrQC.mjs +9 -0
- package/dist/{botnet-feed-lD9s2oLA.mjs → botnet-feed-UyK7Rfp6.mjs} +1 -1
- package/dist/brand-protection-kv1ba80i.mjs +14 -0
- package/dist/browser-run-D-vRoZmf.mjs +40 -0
- package/dist/build-BzJGqb2o.mjs +2 -0
- package/dist/build-FFxzigo4.mjs +2 -0
- package/dist/{builds-D3mAH87h.mjs → builds-BbxINHRP.mjs} +27 -27
- package/dist/cache-BacNNtLu.mjs +36 -0
- package/dist/{cf-CpC4giTf.mjs → cf-BQ_LRiut.mjs} +2 -2
- package/dist/{chunk-DSGVRFIS-vdfri8fR.mjs → chunk-DSGVRFIS-BaNZNW-M.mjs} +1 -1
- package/dist/chunk-SOBRPAPT-QTjnHSNs.mjs +363 -0
- package/dist/{cli-Cm4Twas4.mjs → cli-B7vslRfu.mjs} +1 -1
- package/dist/{client-side-security-BRn7KBpu.mjs → client-side-security-bzB9JosR.mjs} +6 -6
- package/dist/{cloud-connector-DqkOIRDr.mjs → cloud-connector-BHtf37R5.mjs} +2 -2
- package/dist/{cloudflared-DDp_8PTK.mjs → cloudflared-QDdHMUEY.mjs} +1 -1
- package/dist/{cloudforce-one-B9k8vhso.mjs → cloudforce-one-DWBPQDA3.mjs} +126 -124
- package/dist/{command--Y_QAiU2.mjs → command-AVwd7XjE.mjs} +1 -1
- package/dist/{command-DlI7Z_7j.mjs → command-B87T_f2f.mjs} +1 -1
- package/dist/{command-QHmV62Fv.mjs → command-CEHhi3t0.mjs} +1 -1
- package/dist/{command-B-_ba4rQ.mjs → command-CYmQE79n.mjs} +1 -1
- package/dist/{command-DsOv6z9q.mjs → command-CbxXc5IW.mjs} +1 -1
- package/dist/{command-BKNQsGqu.mjs → command-Ce8CVLth.mjs} +1 -1
- package/dist/{command-MxFFWqMg.mjs → command-CqDudQZs.mjs} +1 -1
- package/dist/{command-BV8-laJK.mjs → command-D4YcwpVp.mjs} +1 -1
- package/dist/{command-BVz2aES3.mjs → command-D895kdlh.mjs} +1 -1
- package/dist/{command-yOG9VUtq.mjs → command-D9Qyi1B0.mjs} +1 -1
- package/dist/{command-CfOqnqlN.mjs → command-DeutqL1n.mjs} +1 -1
- package/dist/{command-Dn39o5xQ.mjs → command-Dl9ICrRK.mjs} +1 -1
- package/dist/{command-CN8NFLs2.mjs → command-DtCSe8Hy.mjs} +1 -1
- package/dist/{command-BsCFkho-.mjs → command-DwzVtmb3.mjs} +1 -1
- package/dist/{command-CQMRxiDz.mjs → command-wtBubtZ4.mjs} +1 -1
- package/dist/{completions-BA52jTea.mjs → completions-BvdKtzsX.mjs} +1 -1
- package/dist/{connector-interrupts-zL7pxPn6.mjs → connector-interrupts-dUPW6Ya_.mjs} +2 -2
- package/dist/{connector-telemetry-events-PL4Fqqvu.mjs → connector-telemetry-events-DWVCqnhn.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DyBSuEFB.mjs → connector-telemetry-snapshots-CeMP3qeI.mjs} +1 -1
- package/dist/{connectors-D8H6rQz9.mjs → connectors-DZFGNw3i.mjs} +4 -4
- package/dist/{containers-D4sa-Eoy.mjs → containers-B06OGOEB.mjs} +212 -212
- package/dist/{containers-Db-eWudu.mjs → containers-DCzQCo79.mjs} +8 -8
- package/dist/{content-scan-DUVq09i8.mjs → content-scan-XhnNJqXf.mjs} +4 -4
- package/dist/{context-BvLXzoMs.mjs → context-BY1Eh_Qe.mjs} +1 -1
- package/dist/{cps-CqaRliZZ.mjs → cps-CohlxvuN.mjs} +2 -2
- package/dist/create-DmLDMvrj.mjs +2 -0
- package/dist/{csam-scanner-DsXvOOsZ.mjs → csam-scanner-BV4bHq8v.mjs} +2 -4
- package/dist/custom-csrs-BVdMQjYq.mjs +18 -0
- package/dist/{custom-hostnames-Cj_csfo_.mjs → custom-hostnames-r-CxhSa1.mjs} +5 -5
- package/dist/custom-nameservers-CapMDyly.mjs +12 -0
- package/dist/custom-pages-BVIniWfq.mjs +38 -0
- package/dist/d1-nJCOJZb8.mjs +50 -0
- package/dist/{delegate-CMfEjvHn.mjs → delegate-CcL6RoGw.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-DDbmxkiX.mjs → deploy-DJMnWFNk.mjs} +1 -1
- package/dist/{deploy-context-DsEVu7bf.mjs → deploy-context-YCW3eqP1.mjs} +15 -15
- package/dist/{deploy-input-BA_3Q2Xu.mjs → deploy-input-CQLBXFEB.mjs} +1 -1
- package/dist/{dev-BS156bim.mjs → dev-GsYHvMah.mjs} +1 -1
- package/dist/{diagnostics-BmkQnSEb.mjs → diagnostics-C3nqxsAO.mjs} +4 -4
- package/dist/{dist-DehXZozc.mjs → dist-D-ihn_mV.mjs} +42 -33
- package/dist/{dls-DciZC_gQ.mjs → dls-N1x8sAK3.mjs} +3 -3
- package/dist/{dns-C2YPspGN.mjs → dns-DATWP-PF.mjs} +36 -30
- package/dist/{dns-firewall-CRfde07f.mjs → dns-firewall-n3Y2ui6W.mjs} +8 -8
- package/dist/{docs-CYjyBA8q.mjs → docs-CRc_WOXh.mjs} +1 -1
- package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-kJbjn4kG.mjs} +1 -1
- package/dist/{durable-objects-DcI97y4p.mjs → durable-objects-DHK9w-vO.mjs} +2 -2
- package/dist/{email-auth-CMCQAu99.mjs → email-auth-ptdqNSTZ.mjs} +1 -1
- package/dist/email-domains-uL22-zRY.mjs +14 -0
- package/dist/{email-routing-7p9dr5Ue.mjs → email-routing-CV43rMJC.mjs} +15 -13
- package/dist/{email-security-Bu0fAYh-.mjs → email-security-DK_SJ0yi.mjs} +38 -38
- package/dist/{email-sending-OpMZNaHZ.mjs → email-sending-CTQafGec.mjs} +17 -17
- package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
- package/dist/error-sanitization-D069tpKk.mjs +2 -0
- package/dist/{errors-C5RGao2J.mjs → errors-VG1mgwJl.mjs} +1 -1
- package/dist/{field-extractors-BfsNjd0e.mjs → field-extractors-jcZ_bAGc.mjs} +2 -2
- package/dist/{firewall-CJ-VIOk1.mjs → firewall-CW-fAI9m.mjs} +30 -14
- package/dist/{flagship-C5PTR1ND.mjs → flagship-RiLnDwfJ.mjs} +8 -8
- package/dist/{fraud-B7hwBheX.mjs → fraud-DvfBBTe8.mjs} +2 -2
- package/dist/get-3XNn0upb.mjs +2 -0
- package/dist/global-options-DiKj2cQy.mjs +2 -0
- package/dist/{google-tag-gateway-D7iFDVEa.mjs → google-tag-gateway-C5WYsSXv.mjs} +2 -2
- package/dist/{healthchecks-B4jTcKV7.mjs → healthchecks-BA1fmzTm.mjs} +5 -5
- package/dist/{hyperdrive-1432DM-p.mjs → hyperdrive-Ch6klUp3.mjs} +4 -4
- package/dist/iam-LlGEzRCq.mjs +62 -0
- package/dist/{images-Ttea4khD.mjs → images-C5WqUXkK.mjs} +11 -11
- package/dist/index.mjs +1 -1
- package/dist/{init-BeYrAg7Q.mjs → init-EVsjBrOz.mjs} +2 -2
- package/dist/{intel-CJznBf5n.mjs → intel-vcWyslaX.mjs} +18 -19
- package/dist/{interactive-DsU8VDvK.mjs → interactive-BCDFSPtq.mjs} +1 -1
- package/dist/{internal-DOho_iA0.mjs → internal-BhV9WjLp.mjs} +1 -1
- package/dist/{ips-BgNoRwFN.mjs → ips-CqHjVsqd.mjs} +1 -1
- package/dist/{k2-Cj1ORHul.mjs → k2-CZT2Pd5J.mjs} +2 -2
- package/dist/kv-Ipa7dnvF.mjs +12 -0
- package/dist/{lazy-command-DeTzOWvU.mjs → lazy-command-DbKVgdGT.mjs} +1 -1
- package/dist/{leaked-credential-checks-21Wc7OqL.mjs → leaked-credential-checks-EzT4TTjO.mjs} +4 -4
- package/dist/{live-BfrWKfq8.mjs → live-C9L1bNuE.mjs} +1 -1
- package/dist/load-balancers-Cb3VkSfc.mjs +84 -0
- package/dist/local-D5Vq6ooZ.mjs +2 -0
- package/dist/{local-CvzO-cQH.mjs → local-DIJ7SIKC.mjs} +1 -1
- package/dist/{local-runtime-DOpR_Tnc.mjs → local-runtime-BZjgkacr.mjs} +1 -1
- package/dist/{login-CVWkMh1L.mjs → login-DG5ebyab.mjs} +1 -1
- package/dist/login-DRJugxya.mjs +2 -0
- package/dist/logpush-C5Gw7F_9.mjs +68 -0
- package/dist/logs-y3REfHbb.mjs +51 -0
- package/dist/magic-network-monitoring-BZBGZB6M.mjs +34 -0
- package/dist/{magic-transit-BhP424T-.mjs → magic-transit-BPV_POf5.mjs} +129 -129
- package/dist/{managed-defense-6l_B3hn_.mjs → managed-defense-BaUBSUcz.mjs} +3 -3
- package/dist/{managed-transforms-D7FMBsnq.mjs → managed-transforms-CjkjLzMC.mjs} +2 -2
- package/dist/{mcp-BUOfMkBP.mjs → mcp-RPtrISTy.mjs} +6 -6
- package/dist/{mesh-B1RrhAT1.mjs → mesh-DZ4QHBPE.mjs} +5 -5
- package/dist/{migrate-BTU8AvlP.mjs → migrate-CRIUqGi2.mjs} +1 -1
- package/dist/{monetization-Da3ooFLC.mjs → monetization-CVZqM8Xo.mjs} +9 -5
- package/dist/{network-CjhSzhMm.mjs → network-DLt2JUo1.mjs} +15 -15
- package/dist/{network-interconnects-DEQD6GM8.mjs → network-interconnects-9nS5jL__.mjs} +10 -10
- package/dist/o11y-ySxrnP1Z.mjs +88 -0
- package/dist/{oauth-Dnog5v-Q.mjs → oauth-CFVUl-Wv.mjs} +1 -1
- package/dist/{oauth-DdXkpU44.mjs → oauth-Cidoyxfp.mjs} +1 -1
- package/dist/observability-C-KNh__y.mjs +4 -0
- package/dist/ohttp-gateway-B5nCl4s3.mjs +8 -0
- package/dist/organizations-DbeeWUL4.mjs +71 -0
- package/dist/output-BZQEl3mK.mjs +2 -0
- package/dist/package-B7RgwuFR.mjs +2 -0
- package/dist/{page-rules-D2eFbKWb.mjs → page-rules-DRw763O1.mjs} +4 -4
- package/dist/{pages-DYZDvWK6.mjs → pages-DfQnxiTk.mjs} +12 -12
- package/dist/{pay-per-crawl-CgPFv5HT.mjs → pay-per-crawl-EHYtSKxX.mjs} +13 -13
- package/dist/{pay-per-use-BIQrsrTy.mjs → pay-per-use-wdEhl8k4.mjs} +14 -12
- package/dist/{pipelines-D6pkhlpm.mjs → pipelines-DbyrI6F4.mjs} +11 -11
- package/dist/precursor-Dx8lN4UJ.mjs +4 -0
- package/dist/previews-DEVNSip2.mjs +6 -0
- package/dist/{progress-B-CVX0kn.mjs → progress-yvPscjYg.mjs} +1 -1
- package/dist/{prompt-DJF_Rs5S.mjs → prompt-CEpZ-lQZ.mjs} +1 -1
- package/dist/{queues-DaqLO-UO.mjs → queues-DgMc7Z6A.mjs} +18 -18
- package/dist/{r2-DDIU9JN3.mjs → r2-BpTVicIq.mjs} +43 -43
- package/dist/{radar-D59qCgld.mjs → radar-DW-S1VUh.mjs} +11 -11
- package/dist/{raw-fetch-BrOxDN9k.mjs → raw-fetch-Cl5spWC3.mjs} +1 -1
- package/dist/{ready-DgE08svD.mjs → ready-d0li0X6r.mjs} +1 -1
- package/dist/realtime-DMKHLYF4.mjs +170 -0
- package/dist/registrar-D23gfKBi.mjs +43 -0
- package/dist/{registrar-sandbox-uzs3eOKk.mjs → registrar-sandbox-lVLB1-mC.mjs} +4 -4
- package/dist/{reporting-Dx2YTick.mjs → reporting-WX8P3Y0k.mjs} +2 -2
- package/dist/{request-headers-DHzBX7dQ.mjs → request-headers-C0FpeBhz.mjs} +1 -1
- package/dist/{request-tracers-B49cBKkj.mjs → request-tracers-qd7XOAka.mjs} +2 -2
- package/dist/resource-sharing-B2ZSt_cA.mjs +36 -0
- package/dist/{rules-CjgLSlUC.mjs → rules-CB0QQTB3.mjs} +5 -5
- package/dist/rulesets-DmqwixUC.mjs +42 -0
- package/dist/{rum-vPEpMS_h.mjs → rum-BZ_24qZU.mjs} +9 -9
- package/dist/{run-BZ6Fj3jQ.mjs → run-BOKI1uWa.mjs} +1 -1
- package/dist/run-DBqOjD1P.mjs +2 -0
- package/dist/{schema-DuLIZRhA.mjs → schema-Dj9STsWI.mjs} +1 -1
- package/dist/{schema-cache-C_rvto6Y.mjs → schema-cache-5NkOj7Y3.mjs} +1 -1
- package/dist/schema-flags-CXm9iIv6.mjs +4 -0
- package/dist/{scim-BA7XbsSu.mjs → scim-DchxaJfE.mjs} +8 -8
- package/dist/{secrets-store-MEUNt1Ph.mjs → secrets-store-oAft1cFE.mjs} +5 -5
- package/dist/security-insights-DMm0qg_m.mjs +62 -0
- package/dist/{security-txt-DikhnR2L.mjs → security-txt-CIt0494b.mjs} +2 -2
- package/dist/{session-BOnam-Wv.mjs → session-vzNfUhPl.mjs} +1 -1
- package/dist/{shared-DmmWSObC.mjs → shared-MK-_lkbn.mjs} +1 -1
- package/dist/{signed-url-C-24KbWB.mjs → signed-url-gNangfwc.mjs} +1 -1
- package/dist/{smart-shield-DPqLMz7M.mjs → smart-shield-Boy_qbqd.mjs} +6 -6
- package/dist/{snippets-Bi3Uq1DF.mjs → snippets-DdoDYXW-.mjs} +3 -3
- package/dist/{spawn-C3hzWVrJ.mjs → spawn-B5F4OIHG.mjs} +1 -1
- package/dist/{spectrum-BaWKMoAl.mjs → spectrum-DLYIHelC.mjs} +3 -3
- package/dist/{speed-DShjlpAs.mjs → speed-DugG9Tm9.mjs} +2 -2
- package/dist/{sql-DCoFf15T.mjs → sql-Bb56llsb.mjs} +2 -2
- package/dist/src-BoSDeQ9m.mjs +133 -0
- package/dist/{ssl-C4nt4pJK.mjs → ssl-Bg4X3WGk.mjs} +24 -24
- package/dist/startup-profile-DQVkZZpb.mjs +2 -0
- package/dist/{startup-profile-CFJ_Lu1c.mjs → startup-profile-DZL2DC44.mjs} +1 -1
- package/dist/state-DW3QZtfh.mjs +2 -0
- package/dist/{state-DmjHXZat.mjs → state-mr5ux1Nb.mjs} +1 -1
- package/dist/{stream-CpZbnSpH.mjs → stream-BuZYDbNR.mjs} +21 -21
- package/dist/{tags-BIjQ3Kjh.mjs → tags-SKz2odE_.mjs} +12 -6
- package/dist/{telemetry-BDhqOpUw.mjs → telemetry-B4zmCpT0.mjs} +1 -1
- package/dist/telemetry-DkDUr4KK.mjs +2 -0
- package/dist/tenant-custom-nameservers-BhkhBerL.mjs +8 -0
- package/dist/tenants-DD-GMq0K.mjs +13 -0
- package/dist/{tools-C-vmgYSv.mjs → tools-KW_4hvzY.mjs} +1 -1
- package/dist/{tunnels-CXAO2CeL.mjs → tunnels-D90ztENM.mjs} +6 -6
- package/dist/{turnstile-Ctm0rs0q.mjs → turnstile-DhSU_Xar.mjs} +4 -4
- package/dist/ui-xjCox-gU.mjs +2 -0
- package/dist/{update-check-D_Wtw0_D.mjs → update-check-CRttabfu.mjs} +1 -1
- package/dist/{update-check-Dc7cRFlx.mjs → update-check-HltjTMDE.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-DOfc2Q7a.mjs → url-normalization-K7gkmPvG.mjs} +2 -2
- package/dist/{url-scanner-J8M3X2tR.mjs → url-scanner-BRdWwka4.mjs} +3 -3
- package/dist/{user-BaF0qvvO.mjs → user-Cmb1_Wu5.mjs} +50 -52
- package/dist/{vectorize-D5qiggZU.mjs → vectorize-BTBerJME.mjs} +11 -11
- package/dist/verify-B9ILCohg.mjs +2 -0
- package/dist/verify-BCuWaO-L.mjs +2 -0
- package/dist/version-6Bpy6Bgt.mjs +2 -0
- package/dist/{waiting-rooms-BdmAq7ul.mjs → waiting-rooms-LymmKIGr.mjs} +16 -14
- package/dist/{web-assets-BySw_Tme.mjs → web-assets-LHPQsrnY.mjs} +21 -21
- package/dist/{web3-BKkKf1RF.mjs → web3-BsOio0Ae.mjs} +12 -12
- package/dist/workers-BnLiOjZf.mjs +39 -0
- package/dist/{workers-builds-CVJ4FqzB.mjs → workers-builds-sKpITeRk.mjs} +4 -4
- package/dist/{workers-for-platforms-mzdtmr6r.mjs → workers-for-platforms-BGp6yr6P.mjs} +9 -9
- package/dist/workers-vpc-D8lefWDo.mjs +12 -0
- package/dist/{workflows-Cr957c4U.mjs → workflows-B-ZIG3y7.mjs} +22 -22
- package/dist/{wrangler-migration-DZV7-4Fp.mjs → wrangler-migration-6E6wT_LZ.mjs} +67 -58
- package/dist/zaraz-BBKki5WS.mjs +22 -0
- package/dist/{zero-trust-BVCvQJ4e.mjs → zero-trust-BZDXM5r6.mjs} +487 -409
- package/dist/{zones-BzyjOT10.mjs → zones-B-UV_DGE.mjs} +24 -24
- package/package.json +16 -16
- package/dist/abuse-reports-zPrsxbRz.mjs +0 -24
- package/dist/ai-audit-DI4Rw2wl.mjs +0 -6
- package/dist/ai-search-QOenIzDL.mjs +0 -74
- package/dist/analytics-CQ-Yt1mm.mjs +0 -17
- package/dist/analytics-engine-CdrY5-95.mjs +0 -4
- package/dist/api-X3wKppsT.mjs +0 -3
- package/dist/argo-BiefH8wc.mjs +0 -14
- package/dist/auth-Czzy5Rs_.mjs +0 -2
- package/dist/auth-D5Yj9eYU.mjs +0 -2
- package/dist/billing-BrLJqlOf.mjs +0 -22
- package/dist/body-parser-BKcZS9iJ.mjs +0 -2
- package/dist/bot-management-BSBVuKc0.mjs +0 -9
- package/dist/brand-protection-Byoa1hvj.mjs +0 -26
- package/dist/browser-run-BSVANGzU.mjs +0 -40
- package/dist/build-CPKxZ3kL.mjs +0 -2
- package/dist/build-Dwd1_7o0.mjs +0 -2
- package/dist/cache-0xCdyNg9.mjs +0 -36
- package/dist/chunk-3PJ54H4K-CY8EY_n2.mjs +0 -363
- package/dist/create-BtmuVqVL.mjs +0 -2
- package/dist/custom-csrs-Dl_daAbX.mjs +0 -10
- package/dist/custom-nameservers-Bw2P7F_W.mjs +0 -8
- package/dist/custom-pages-CJ7ecSX6.mjs +0 -20
- package/dist/d1-BsWI546w.mjs +0 -89
- package/dist/email-domains-1Nx60ETD.mjs +0 -12
- package/dist/error-sanitization-B025CygB.mjs +0 -2
- package/dist/get-Be821dio.mjs +0 -2
- package/dist/iam-DuZenYtc.mjs +0 -48
- package/dist/kv-CTyuvcAz.mjs +0 -12
- package/dist/load-balancers-DMTsh-9q.mjs +0 -72
- package/dist/local-CWTti4ot.mjs +0 -2
- package/dist/login-Djz5mvHJ.mjs +0 -2
- package/dist/logpush-OMhp7VgE.mjs +0 -44
- package/dist/logs-BSyyNwso.mjs +0 -35
- package/dist/magic-cloud-networking-DD29yMnE.mjs +0 -68
- package/dist/magic-network-monitoring-DRRvSrDP.mjs +0 -34
- package/dist/o11y-DeNxXxcp.mjs +0 -86
- package/dist/oauth-clients-UnbMcHkx.mjs +0 -14
- package/dist/oauth-scopes-DbtnZVO4.mjs +0 -4
- package/dist/organization-IsxVyWol.mjs +0 -73
- package/dist/organizations-p8Mgo8A7.mjs +0 -4
- package/dist/origin-post-quantum-encryption-Bwysyttf.mjs +0 -6
- package/dist/output-BJEgbI0G.mjs +0 -2
- package/dist/package-BOE_De2L.mjs +0 -2
- package/dist/precursor-B35P8h6h.mjs +0 -4
- package/dist/previews-B1mqjXaJ.mjs +0 -6
- package/dist/realtime-DWjdrDzv.mjs +0 -168
- package/dist/registrar-uYOU1U27.mjs +0 -43
- package/dist/resource-sharing-CIsLVAcK.mjs +0 -36
- package/dist/rulesets-C7_aZA7m.mjs +0 -34
- package/dist/run-D4-K_cbQ.mjs +0 -2
- package/dist/schema-flags-Cr6kleor.mjs +0 -4
- package/dist/security-insights-ZKtey62s.mjs +0 -40
- package/dist/src-jyCTFHcS.mjs +0 -131
- package/dist/startup-profile-D_Qjgca1.mjs +0 -2
- package/dist/state-C7lNNN31.mjs +0 -2
- package/dist/telemetry-BZdRnr26.mjs +0 -2
- package/dist/tenant-CqYoylyU.mjs +0 -10
- package/dist/tenant-custom-nameservers-DDzzdyY3.mjs +0 -8
- package/dist/ui-BUCBQ3Sq.mjs +0 -2
- package/dist/version-DNcdABcr.mjs +0 -2
- package/dist/workers-TS0oQ-XH.mjs +0 -39
- package/dist/workers-vpc-xB1hHFPd.mjs +0 -12
- package/dist/zaraz-C8__FhOh.mjs +0 -22
package/dist/{leaked-credential-checks-21Wc7OqL.mjs → leaked-credential-checks-EzT4TTjO.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-B-h0BHg7.mjs";import{i as n}from"./context-BY1Eh_Qe.mjs";import{t as r}from"./output-BZQEl3mK.mjs";import{t as i}from"./dry-run-kJbjn4kG.mjs";import{t as a}from"./progress-yvPscjYg.mjs";import{t as o}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{n as s,t as c}from"./body-parser-DoewLePl.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{n as u}from"./prompt-CEpZ-lQZ.mjs";var d={method:`POST`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks/detections`,body:`json`};function f(e){return e.usage(`$0 leaked-credential-checks detections create
|
|
3
3
|
|
|
4
|
-
Create a detection location for credentials that the default scan locations do not cover, using Rules language expressions such as \`lookup_json_string(http.request.body.raw, "user")\`. Only the username expression is required, and Leaked Credential Checks must be enabled on the zone.`).option(`id`,{type:`string`,description:`Defines the unique ID for this custom detection.`}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const p={command:`create`,describe:`Create a custom detection location for a zone.`,builder:f,handler:async e=>o({command:`leaked-credential-checks detections create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}):s(e.body)});return}let o=await t(e),
|
|
4
|
+
Create a detection location for credentials that the default scan locations do not cover, using Rules language expressions such as \`lookup_json_string(http.request.body.raw, "user")\`. Only the username expression is required, and Leaked Credential Checks must be enabled on the zone.`).option(`id`,{type:`string`,description:`Defines the unique ID for this custom detection.`}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const p={command:`create`,describe:`Create a custom detection location for a zone.`,builder:f,handler:async e=>o({command:`leaked-credential-checks detections create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}):s(e.body)});return}let o=e.body===void 0?void 0:s(e.body),u=await t(e),f=await n({zone:e.zone},u,{quiet:e.quiet});if(e.zoneId=f,e.body!==void 0){let e=o,t=await a(`Creating`,async()=>u.send(d,{body:e,zone_id:f}));r(t,{successLabel:`Created`});return}let p=c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}),m=await a(`Creating`,async()=>u.send(d,{body:p,zone_id:f}));r(m,{successLabel:`Created`})})};var m={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks/detections/${t.detection_id}`};function h(e){return e.usage(`$0 leaked-credential-checks detections delete <detection-id>
|
|
5
5
|
|
|
6
6
|
Delete a user-defined detection location, identified by its detection ID. Incoming requests are then scanned using only the default scan locations and the detection locations that remain.`).positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <detection-id>`,describe:`Delete a custom detection location from a zone.`,builder:h,handler:async e=>o({command:`leaked-credential-checks detections delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections/${e[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(e[`detection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"detection-id":String(e[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await u({force:!!e.force,message:`This operation deletes a Leaked Credential Checks custom detection location.`}))return;let c=await a(`Deleting`,async()=>o.send(m,{zone_id:s,detection_id:e[`detection-id`]}));r(c,{successLabel:`Deleted`})})};var _={method:`GET`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks/detections/${t.detection_id}`};function v(e){return e.usage(`$0 leaked-credential-checks detections get <detection-id>
|
|
7
7
|
|
|
@@ -9,8 +9,8 @@ Get the username and password expressions of a single user-defined detection loc
|
|
|
9
9
|
|
|
10
10
|
List the user-defined detection locations configured for Leaked Credential Checks, each with its own identifier. A custom detection location tells the WAF where to find the username and password in requests to your application.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List the custom detection locations of a zone.`,builder:x,handler:async e=>o({command:`leaked-credential-checks detections list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(b,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var C={method:`PUT`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks/detections/${t.detection_id}`,body:`json`};function w(e){return e.usage(`$0 leaked-credential-checks detections update <detection-id>
|
|
11
11
|
|
|
12
|
-
Update the username and password expressions of an existing detection location, identified by its detection ID. Both expressions are overwritten, so omitting the password expression clears it.`).positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`id`,{type:`string`,description:`Defines the unique ID for this custom detection.`}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const T={command:`update <detection-id>`,describe:`Update a custom detection location of a zone.`,builder:w,handler:async e=>o({command:`leaked-credential-checks detections update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections/${e[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(e[`detection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"detection-id":String(e[`detection-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}):s(e.body)});return}let o=await t(e),
|
|
12
|
+
Update the username and password expressions of an existing detection location, identified by its detection ID. Both expressions are overwritten, so omitting the password expression clears it.`).positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`id`,{type:`string`,description:`Defines the unique ID for this custom detection.`}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const T={command:`update <detection-id>`,describe:`Update a custom detection location of a zone.`,builder:w,handler:async e=>o({command:`leaked-credential-checks detections update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks/detections/${e[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(e[`detection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"detection-id":String(e[`detection-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}):s(e.body)});return}let o=e.body===void 0?void 0:s(e.body),u=await t(e),d=await n({zone:e.zone},u,{quiet:e.quiet});if(e.zoneId=d,e.body!==void 0){let t=o,n=await a(`Updating`,async()=>u.send(C,{body:t,zone_id:d,detection_id:e[`detection-id`]}));r(n,{successLabel:`Updated`});return}let f=c({id:l(e.id,`id`,`text`),password:l(e.password,`password`,`text`),username:l(e.username,`username`,`text`)}),p=await a(`Updating`,async()=>u.send(C,{body:f,zone_id:d,detection_id:e[`detection-id`]}));r(p,{successLabel:`Updated`})})},E={command:`detections`,describe:`Custom detection locations that tell the WAF where to find usernames and passwords in requests`,builder:e=>e.command(p).command(g).command(y).command(S).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var D={method:`GET`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks`};function O(e){return e.usage(`$0 leaked-credential-checks get
|
|
13
13
|
|
|
14
14
|
Get the current Leaked Credential Checks status for the zone. While enabled, Cloudflare scans incoming requests for usernames and passwords that were exposed in known data breaches.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Get the Leaked Credential Checks status for a zone.`,builder:O,handler:async e=>o({command:`leaked-credential-checks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(D,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var A={method:`POST`,path:t=>e`/zones/${t.zone_id}/leaked-credential-checks`,body:`json`};function j(e){return e.usage(`$0 leaked-credential-checks update
|
|
15
15
|
|
|
16
|
-
Update the Leaked Credential Checks status for the zone, enabling or disabling the detection. While enabled, the detection populates the \`cf.waf.credential_check.*\` fields, which you can reference in custom rules and rate limiting rules to challenge or block requests carrying compromised credentials.`).option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const M={command:`update`,describe:`Update the Leaked Credential Checks status for a zone.`,builder:j,handler:async e=>o({command:`leaked-credential-checks update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let o=await t(e),
|
|
16
|
+
Update the Leaked Credential Checks status for the zone, enabling or disabling the detection. While enabled, the detection populates the \`cf.waf.credential_check.*\` fields, which you can reference in custom rules and rate limiting rules to challenge or block requests carrying compromised credentials.`).option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const M={command:`update`,describe:`Update the Leaked Credential Checks status for a zone.`,builder:j,handler:async e=>o({command:`leaked-credential-checks update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf leaked-credential-checks update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let o=e.body===void 0?void 0:s(e.body),l=await t(e),d=await n({zone:e.zone},l,{quiet:e.quiet});if(e.zoneId=d,!await u({force:!!e.force,message:`This operation toggles Leaked Credential Checks for a zone.`}))return;if(e.body!==void 0){let e=o,t=await a(`Processing`,async()=>l.send(A,{body:e,zone_id:d}));r(t,{successLabel:`Done`});return}let f=c({enabled:e.enabled}),p=await a(`Processing`,async()=>l.send(A,{body:f,zone_id:d}));r(p,{successLabel:`Done`})})},N={command:`leaked-credential-checks`,describe:`Detect compromised credentials in login requests by checking against known breach databases`,builder:e=>e.command(k).command(M).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-
|
|
2
|
+
import{n as e}from"./auth-B-h0BHg7.mjs";import{t}from"./output-BZQEl3mK.mjs";import{t as n}from"./dry-run-kJbjn4kG.mjs";import{t as r}from"./progress-yvPscjYg.mjs";import{t as i}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";var a={method:`GET`,path:()=>`/live`,response:!1,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function o(e){return e.usage(`$0 live get
|
|
3
3
|
|
|
4
4
|
Return a success message after running liveness checks.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`get`,describe:`Run liveness checks`,builder:o,handler:async o=>i({command:`live get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/live`,pathParams:{},bodyKind:`none`});return}let i=await e(o),s=await r(`Loading`,async()=>i.send(a));t(s,{successLabel:`Loaded`})})},c={command:`live`,describe:`live`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{c as default};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{n}from"./auth-B-h0BHg7.mjs";import{a as r,i,t as a}from"./context-BY1Eh_Qe.mjs";import{t as o}from"./output-BZQEl3mK.mjs";import{t as s}from"./dry-run-kJbjn4kG.mjs";import{t as c}from"./progress-yvPscjYg.mjs";import{t as l}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as u,n as d,r as f,t as p}from"./body-parser-DoewLePl.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,n as g}from"./prompt-CEpZ-lQZ.mjs";var _={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers`,body:`json`};function v(e){return e.usage(`$0 load-balancers account create
|
|
3
|
+
|
|
4
|
+
Create a new account or zone-scoped load balancer.
|
|
5
|
+
|
|
6
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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(`country-pools`,{type:`string`,description:`A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`location-strategy-mode`,e=>m(e,`location-strategy-mode`,`text`)).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`]}).coerce(`location-strategy-prefer-ecs`,e=>m(e,`location-strategy-prefer-ecs`,`text`)).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(`pool-sets`,{type:`string`,description:"An optional list of pool sets, evaluated in array order with first match wins. Pool sets are independent from the standard steering fields (`region_pools` / `country_pools` / `pop_pools` / `default_pools` / `steering_policy` / `random_steering` / `fallback_pool` / `rules`). On a PATCH, an empty array (`pool_sets: []`) clears all pool sets, while omitting the field leaves existing pool sets unchanged. Provide as a JSON array of objects or @path/to/file.json."}).option(`pop-pools`,{type:`string`,description:`Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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(`random-steering-pool-weights`,{type:`string`,description:`A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. Provide as a JSON object or @path/to/file.json.`}).option(`region-pools`,{type:`string`,description:`A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. Provide as a JSON object or @path/to/file.json.`}).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`}).coerce(`session-affinity`,e=>m(e,`session-affinity`,`text`)).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`]}).coerce(`session-affinity-attributes-samesite`,e=>m(e,`session-affinity-attributes-samesite`,`text`)).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`]}).coerce(`session-affinity-attributes-secure`,e=>m(e,`session-affinity-attributes-secure`,`text`)).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`]}).coerce(`session-affinity-attributes-zero-downtime-failover`,e=>m(e,`session-affinity-attributes-zero-downtime-failover`,`text`)).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:``}).coerce(`steering-policy`,e=>m(e,`steering-policy`,`text`)).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 y={command:`create`,describe:`Create account or zone Load Balancer`,builder:v,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]):d(e.body)});return}let l=e.body===void 0?void 0:d(e.body),g=await n(e),v=e.zone===void 0?`accounts`:`zones`,y=v===`zones`?await i({zone:e.zone},g,{quiet:e.quiet}):e.local?t:await a();if(v===`zones`?e.zoneId=y:e.accountId=y,e.body!==void 0){let e=l,t=await c(`Creating`,async()=>g.send(_,{body:e,account_or_zone:v,account_or_zone_id:y}));o(t,{successLabel:`Created`});return}if(e[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);e[`fallback-pool`]===void 0&&(e[`fallback-pool`]=await h(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),e.name===void 0&&(e.name=await h(`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 b=p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]),x=await c(`Creating`,async()=>g.send(_,{body:b,account_or_zone:v,account_or_zone_id:y}));o(x,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers/${t.load_balancer_id}`};function x(e){return e.usage(`$0 load-balancers account delete <load-balancer-id>
|
|
7
|
+
|
|
8
|
+
Delete a configured account or zone-scoped load balancer.
|
|
9
|
+
|
|
10
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 ee={command:`delete <load-balancer-id>`,describe:`Delete account or zone Load Balancer`,builder:x,handler:async e=>l({command:`load-balancers account delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`none`});return}let l=await n(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(u===`zones`?e.zoneId=d:e.accountId=d,!await g({force:!!e.force}))return;let f=await c(`Deleting`,async()=>l.send(b,{account_or_zone:u,account_or_zone_id:d,load_balancer_id:e[`load-balancer-id`]}));o(f,{successLabel:`Deleted`})})};var S={method:`PATCH`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers/${t.load_balancer_id}`,body:`json`};function C(e){return e.usage(`$0 load-balancers account edit <load-balancer-id>
|
|
11
|
+
|
|
12
|
+
Apply changes to an existing account or zone-scoped load balancer, overwriting the supplied properties.
|
|
13
|
+
|
|
14
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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(`country-pools`,{type:`string`,description:`A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`location-strategy-mode`,e=>m(e,`location-strategy-mode`,`text`)).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`]}).coerce(`location-strategy-prefer-ecs`,e=>m(e,`location-strategy-prefer-ecs`,`text`)).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(`pool-sets`,{type:`string`,description:"An optional list of pool sets, evaluated in array order with first match wins. Pool sets are independent from the standard steering fields (`region_pools` / `country_pools` / `pop_pools` / `default_pools` / `steering_policy` / `random_steering` / `fallback_pool` / `rules`). On a PATCH, an empty array (`pool_sets: []`) clears all pool sets, while omitting the field leaves existing pool sets unchanged. Provide as a JSON array of objects or @path/to/file.json."}).option(`pop-pools`,{type:`string`,description:`Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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(`random-steering-pool-weights`,{type:`string`,description:`A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. Provide as a JSON object or @path/to/file.json.`}).option(`region-pools`,{type:`string`,description:`A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`session-affinity`,e=>m(e,`session-affinity`,`text`)).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`]}).coerce(`session-affinity-attributes-samesite`,e=>m(e,`session-affinity-attributes-samesite`,`text`)).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`]}).coerce(`session-affinity-attributes-secure`,e=>m(e,`session-affinity-attributes-secure`,`text`)).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`]}).coerce(`session-affinity-attributes-zero-downtime-failover`,e=>m(e,`session-affinity-attributes-zero-downtime-failover`,`text`)).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`]}).coerce(`steering-policy`,e=>m(e,`steering-policy`,`text`)).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 w={command:`edit <load-balancer-id>`,describe:`Patch account or zone Load Balancer`,builder:C,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]):d(e.body)});return}let l=e.body===void 0?void 0:d(e.body),h=await n(e),g=e.zone===void 0?`accounts`:`zones`,_=g===`zones`?await i({zone:e.zone},h,{quiet:e.quiet}):e.local?t:await a();if(g===`zones`?e.zoneId=_:e.accountId=_,e.body!==void 0){let t=l,n=await c(`Updating`,async()=>h.send(S,{body:t,account_or_zone:g,account_or_zone_id:_,load_balancer_id:e[`load-balancer-id`]}));o(n,{successLabel:`Updated`});return}let v=p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]),y=await c(`Updating`,async()=>h.send(S,{body:v,account_or_zone:g,account_or_zone_id:_,load_balancer_id:e[`load-balancer-id`]}));o(y,{successLabel:`Updated`})})};var te={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers/${t.load_balancer_id}`};function ne(e){return e.usage(`$0 load-balancers account get <load-balancer-id>
|
|
15
|
+
|
|
16
|
+
Fetch a single configured account or zone-scoped load balancer.
|
|
17
|
+
|
|
18
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 re={command:`get <load-balancer-id>`,describe:`account or zone Load Balancer Details`,builder:ne,handler:async e=>l({command:`load-balancers account get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`none`});return}let l=await n(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();u===`zones`?e.zoneId=d:e.accountId=d;let f=await c(`Loading`,async()=>l.send(te,{account_or_zone:u,account_or_zone_id:d,load_balancer_id:e[`load-balancer-id`]}));o(f,{successLabel:`Loaded`})})};var ie={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers`};function ae(e){return e.usage(`$0 load-balancers account list
|
|
19
|
+
|
|
20
|
+
List configured account or zone-scoped load balancers.
|
|
21
|
+
|
|
22
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List account or zone Load Balancers`,builder:ae,handler:async e=>l({command:`load-balancers account list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();u===`zones`?e.zoneId=d:e.accountId=d;let f=await c(`Loading`,async()=>l.send(ie,{account_or_zone:u,account_or_zone_id:d}));o(f,{successLabel:`Loaded`})})};var T={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/load_balancers/${t.load_balancer_id}`,body:`json`};function se(e){return e.usage(`$0 load-balancers account update <load-balancer-id>
|
|
23
|
+
|
|
24
|
+
Update a configured account or zone-scoped load balancer.
|
|
25
|
+
|
|
26
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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(`country-pools`,{type:`string`,description:`A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`location-strategy-mode`,e=>m(e,`location-strategy-mode`,`text`)).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`]}).coerce(`location-strategy-prefer-ecs`,e=>m(e,`location-strategy-prefer-ecs`,`text`)).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(`pool-sets`,{type:`string`,description:"An optional list of pool sets, evaluated in array order with first match wins. Pool sets are independent from the standard steering fields (`region_pools` / `country_pools` / `pop_pools` / `default_pools` / `steering_policy` / `random_steering` / `fallback_pool` / `rules`). On a PATCH, an empty array (`pool_sets: []`) clears all pool sets, while omitting the field leaves existing pool sets unchanged. Provide as a JSON array of objects or @path/to/file.json."}).option(`pop-pools`,{type:`string`,description:`Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. Provide as a JSON object or @path/to/file.json.`}).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(`random-steering-pool-weights`,{type:`string`,description:`A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. Provide as a JSON object or @path/to/file.json.`}).option(`region-pools`,{type:`string`,description:`A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`session-affinity`,e=>m(e,`session-affinity`,`text`)).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`]}).coerce(`session-affinity-attributes-samesite`,e=>m(e,`session-affinity-attributes-samesite`,`text`)).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`]}).coerce(`session-affinity-attributes-secure`,e=>m(e,`session-affinity-attributes-secure`,`text`)).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`]}).coerce(`session-affinity-attributes-zero-downtime-failover`,e=>m(e,`session-affinity-attributes-zero-downtime-failover`,`text`)).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`]}).coerce(`steering-policy`,e=>m(e,`steering-policy`,`text`)).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 ce={command:`update <load-balancer-id>`,describe:`Update account or zone Load Balancer`,builder:se,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf load-balancers account update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]):d(e.body)});return}let l=e.body===void 0?void 0:d(e.body),g=await n(e),_=e.zone===void 0?`accounts`:`zones`,v=_===`zones`?await i({zone:e.zone},g,{quiet:e.quiet}):e.local?t:await a();if(_===`zones`?e.zoneId=v:e.accountId=v,e.body!==void 0){let t=l,n=await c(`Updating`,async()=>g.send(T,{body:t,account_or_zone:_,account_or_zone_id:v,load_balancer_id:e[`load-balancer-id`]}));o(n,{successLabel:`Updated`});return}if(e[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);e[`fallback-pool`]===void 0&&(e[`fallback-pool`]=await h(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),e.name===void 0&&(e.name=await h(`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 y=p({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},country_pools:f(e[`country-pools`],`country-pools`),default_pools:e[`default-pools`],description:m(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:m(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:e[`location-strategy-mode`],prefer_ecs:e[`location-strategy-prefer-ecs`]},name:m(e.name,`name`,`text`),networks:e.networks,pool_sets:u(e[`pool-sets`],`pool-sets`),pop_pools:f(e[`pop-pools`],`pop-pools`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`],pool_weights:f(e[`random-steering-pool-weights`],`random-steering-pool-weights`)},region_pools:f(e[`region-pools`],`region-pools`),rules:u(e.rules,`rules`),session_affinity:e[`session-affinity`],session_affinity_attributes:{drain_duration:e[`session-affinity-attributes-drain-duration`],headers:e[`session-affinity-attributes-headers`],require_all_headers:e[`session-affinity-attributes-require-all-headers`],samesite:e[`session-affinity-attributes-samesite`],secure:e[`session-affinity-attributes-secure`],zero_downtime_failover:e[`session-affinity-attributes-zero-downtime-failover`]},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:e[`steering-policy`],ttl:e.ttl},[[`country_pools`],[`pop_pools`],[`random_steering`,`pool_weights`],[`region_pools`]]),b=await c(`Updating`,async()=>g.send(T,{body:y,account_or_zone:_,account_or_zone_id:v,load_balancer_id:e[`load-balancer-id`]}));o(b,{successLabel:`Updated`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/usage`};function ue(e){return e.usage(`$0 load-balancers account usage list
|
|
27
|
+
|
|
28
|
+
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 de={command:`list`,describe:`List Load Balancer Usage`,builder:ue,handler:async e=>l({command:`load-balancers account usage list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf load-balancers account usage list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/usage`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(le,{account_id:l}));o(u,{successLabel:`Loaded`})})},E={command:`usage`,describe:`Current load balancer resource usage counts for an account`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`account`,describe:`Account-scoped load balancers that distribute traffic without requiring a DNS hostname`,builder:e=>e.command(y).command(ee).command(w).command(re).command(oe).command(ce).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`POST`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups`,body:`json`,errors:{412:`PreconditionFailedError`}};function k(e){return e.usage(`$0 load-balancers monitor-groups create
|
|
29
|
+
|
|
30
|
+
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 A={command:`create`,describe:`Create Monitor Group`,builder:k,handler:async e=>l({command:`load-balancers monitor-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(O,{body:e,account_id:f}));o(t,{successLabel:`Created`});return}if(e.description===void 0&&(e.description=await h(`description`,`A short description of the monitor group`)),e.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let g=p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}),_=await c(`Creating`,async()=>l.send(O,{body:g,account_id:f}));o(_,{successLabel:`Created`})})};var j={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups/${t.monitor_group_id}`,errors:{412:`PreconditionFailedError`}};function M(e){return e.usage(`$0 load-balancers monitor-groups delete <monitor-group-id>
|
|
31
|
+
|
|
32
|
+
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 e=>l({command:`load-balancers monitor-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(j,{account_id:l,monitor_group_id:e[`monitor-group-id`]}));o(u,{successLabel:`Deleted`})})};var P={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups/${t.monitor_group_id}`,body:`json`,errors:{412:`PreconditionFailedError`}};function F(e){return e.usage(`$0 load-balancers monitor-groups edit <monitor-group-id>
|
|
33
|
+
|
|
34
|
+
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 I={command:`edit <monitor-group-id>`,describe:`Patch Monitor Group`,builder:F,handler:async e=>l({command:`load-balancers monitor-groups edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(P,{body:t,account_id:f,monitor_group_id:e[`monitor-group-id`]}));o(n,{successLabel:`Updated`});return}if(e.description===void 0&&(e.description=await h(`description`,`A short description of the monitor group`)),e.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let g=p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}),_=await c(`Updating`,async()=>l.send(P,{body:g,account_id:f,monitor_group_id:e[`monitor-group-id`]}));o(_,{successLabel:`Updated`})})};var L={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups/${t.monitor_group_id}`};function R(e){return e.usage(`$0 load-balancers monitor-groups get <monitor-group-id>
|
|
35
|
+
|
|
36
|
+
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 z={command:`get <monitor-group-id>`,describe:`Monitor Group Details`,builder:R,handler:async e=>l({command:`load-balancers monitor-groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(L,{account_id:l,monitor_group_id:e[`monitor-group-id`]}));o(u,{successLabel:`Loaded`})})};var B={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups`};function V(e){return e.usage(`$0 load-balancers monitor-groups list
|
|
37
|
+
|
|
38
|
+
List configured monitor groups.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List Monitor Groups`,builder:V,handler:async e=>l({command:`load-balancers monitor-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf load-balancers monitor-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(B,{account_id:l}));o(u,{successLabel:`Loaded`})})};var fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups/${t.monitor_group_id}/references`};function pe(e){return e.usage(`$0 load-balancers monitor-groups references list
|
|
39
|
+
|
|
40
|
+
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 me={command:`list`,describe:`List Monitor Group References`,builder:pe,handler:async e=>l({command:`load-balancers monitor-groups references list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}/references`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(fe,{account_id:l,monitor_group_id:e[`monitor-group-id`]}));o(u,{successLabel:`Loaded`})})},he={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`PUT`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitor_groups/${t.monitor_group_id}`,body:`json`,errors:{412:`PreconditionFailedError`}};function ge(e){return e.usage(`$0 load-balancers monitor-groups update <monitor-group-id>
|
|
41
|
+
|
|
42
|
+
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 _e={command:`update <monitor-group-id>`,describe:`Update Monitor Group`,builder:ge,handler:async e=>l({command:`load-balancers monitor-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(U,{body:t,account_id:f,monitor_group_id:e[`monitor-group-id`]}));o(n,{successLabel:`Updated`});return}if(e.description===void 0&&(e.description=await h(`description`,`A short description of the monitor group`)),e.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let g=p({description:m(e.description,`description`,`text`),members:u(e.members,`members`)}),_=await c(`Updating`,async()=>l.send(U,{body:g,account_id:f,monitor_group_id:e[`monitor-group-id`]}));o(_,{successLabel:`Updated`})})},ve={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(A).command(N).command(I).command(z).command(H).command(_e).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors`,body:`json`};function ye(e){return e.usage(`$0 load-balancers monitors create
|
|
43
|
+
|
|
44
|
+
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(`header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. Provide as a JSON object or @path/to/file.json.`}).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`}).coerce(`type`,e=>m(e,`type`,`text`)).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 be={command:`create`,describe:`Create Monitor`,builder:ye,handler:async e=>l({command:`load-balancers monitors create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(W,{body:e,account_id:u}));o(t,{successLabel:`Created`});return}let h=p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]),g=await c(`Creating`,async()=>l.send(W,{body:h,account_id:u}));o(g,{successLabel:`Created`})})};var xe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}`};function Se(e){return e.usage(`$0 load-balancers monitors delete <monitor-id>
|
|
45
|
+
|
|
46
|
+
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 Ce={command:`delete <monitor-id>`,describe:`Delete Monitor`,builder:Se,handler:async e=>l({command:`load-balancers monitors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(xe,{account_id:l,monitor_id:e[`monitor-id`]}));o(u,{successLabel:`Deleted`})})};var G={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}`,body:`json`};function we(e){return e.usage(`$0 load-balancers monitors edit <monitor-id>
|
|
47
|
+
|
|
48
|
+
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(`header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`type`,e=>m(e,`type`,`text`)).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:`edit <monitor-id>`,describe:`Patch Monitor`,builder:we,handler:async e=>l({command:`load-balancers monitors edit`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(G,{body:t,account_id:u,monitor_id:e[`monitor-id`]}));o(n,{successLabel:`Updated`});return}let h=p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]),g=await c(`Updating`,async()=>l.send(G,{body:h,account_id:u,monitor_id:e[`monitor-id`]}));o(g,{successLabel:`Updated`})})};var Ee={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}`};function De(e){return e.usage(`$0 load-balancers monitors get <monitor-id>
|
|
49
|
+
|
|
50
|
+
Fetch 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 Oe={command:`get <monitor-id>`,describe:`Monitor Details`,builder:De,handler:async e=>l({command:`load-balancers monitors get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(Ee,{account_id:l,monitor_id:e[`monitor-id`]}));o(u,{successLabel:`Loaded`})})};var ke={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors`};function Ae(e){return e.usage(`$0 load-balancers monitors list
|
|
51
|
+
|
|
52
|
+
List configured monitors for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`List Monitors`,builder:Ae,handler:async e=>l({command:`load-balancers monitors list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf load-balancers monitors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(ke,{account_id:l}));o(u,{successLabel:`Loaded`})})};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}/preview`,body:`json`};function Me(e){return e.usage(`$0 load-balancers monitors previews create <monitor-id>
|
|
53
|
+
|
|
54
|
+
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(`header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. Provide as a JSON object or @path/to/file.json.`}).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`}).coerce(`type`,e=>m(e,`type`,`text`)).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 Ne={command:`create <monitor-id>`,describe:`Preview Monitor`,builder:Me,handler:async e=>l({command:`load-balancers monitors previews create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/preview`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Creating`,async()=>l.send(K,{body:t,account_id:u,monitor_id:e[`monitor-id`]}));o(n,{successLabel:`Created`});return}let h=p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]),g=await c(`Creating`,async()=>l.send(K,{body:h,account_id:u,monitor_id:e[`monitor-id`]}));o(g,{successLabel:`Created`})})},Pe={command:`previews`,describe:`Preview how a monitor configuration evaluates pool health before applying it`,builder:e=>e.command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}/references`};function Ie(e){return e.usage(`$0 load-balancers monitors references list
|
|
55
|
+
|
|
56
|
+
Get the list of resources that reference the provided monitor.`).option(`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:`list`,describe:`List Monitor References`,builder:Ie,handler:async e=>l({command:`load-balancers monitors references list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/references`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(Fe,{account_id:l,monitor_id:e[`monitor-id`]}));o(u,{successLabel:`Loaded`})})},Re={command:`references`,describe:`List load balancing resources that use a monitor`,builder:e=>e.command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/load_balancers/monitors/${t.monitor_id}`,body:`json`};function ze(e){return e.usage(`$0 load-balancers monitors update <monitor-id>
|
|
57
|
+
|
|
58
|
+
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(`header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. Provide as a JSON object or @path/to/file.json.`}).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`]}).coerce(`type`,e=>m(e,`type`,`text`)).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 Be={command:`update <monitor-id>`,describe:`Update Monitor`,builder:ze,handler:async e=>l({command:`load-balancers monitors update`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(q,{body:t,account_id:u,monitor_id:e[`monitor-id`]}));o(n,{successLabel:`Updated`});return}let h=p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]),g=await c(`Updating`,async()=>l.send(q,{body:h,account_id:u,monitor_id:e[`monitor-id`]}));o(g,{successLabel:`Updated`})})},Ve={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(be).command(Ce).command(Te).command(Oe).command(je).command(Be).command(Pe).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var J={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools`,body:`json`};function He(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 Ue={command:`bulk-edit`,describe:`Patch Pools`,builder:He,handler:async e=>l({command:`load-balancers pools bulk-edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({notification_email:m(e[`notification-email`],`notification-email`,`text`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Updating`,async()=>l.send(J,{body:e,account_id:u}));o(t,{successLabel:`Updated`});return}let f=p({notification_email:m(e[`notification-email`],`notification-email`,`text`)}),h=await c(`Updating`,async()=>l.send(J,{body:f,account_id:u}));o(h,{successLabel:`Updated`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools`,body:`json`};function We(e){return e.usage(`$0 load-balancers pools create
|
|
59
|
+
|
|
60
|
+
Create a new pool.`).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.`,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(`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`]}).coerce(`load-shedding-default-policy`,e=>m(e,`load-shedding-default-policy`,`text`)).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`]}).coerce(`load-shedding-session-policy`,e=>m(e,`load-shedding-session-policy`,`text`)).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(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).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`]}).coerce(`origin-steering-policy`,e=>m(e,`origin-steering-policy`,`text`)).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 Ge={command:`create`,describe:`Create Pool`,builder:We,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(Y,{body:e,account_id:f}));o(t,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await h(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),e.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let g=p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}),_=await c(`Creating`,async()=>l.send(Y,{body:g,account_id:f}));o(_,{successLabel:`Created`})})};var Ke={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}`};function qe(e){return e.usage(`$0 load-balancers pools delete <pool-id>
|
|
61
|
+
|
|
62
|
+
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 Je={command:`delete <pool-id>`,describe:`Delete Pool`,builder:qe,handler:async e=>l({command:`load-balancers pools delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(Ke,{account_id:l,pool_id:e[`pool-id`]}));o(u,{successLabel:`Deleted`})})};var X={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}`,body:`json`};function Ye(e){return e.usage(`$0 load-balancers pools edit <pool-id>
|
|
63
|
+
|
|
64
|
+
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`]}).coerce(`load-shedding-default-policy`,e=>m(e,`load-shedding-default-policy`,`text`)).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`]}).coerce(`load-shedding-session-policy`,e=>m(e,`load-shedding-session-policy`,`text`)).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(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).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`]}).coerce(`origin-steering-policy`,e=>m(e,`origin-steering-policy`,`text`)).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:Ye,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(X,{body:t,account_id:f,pool_id:e[`pool-id`]}));o(n,{successLabel:`Updated`});return}let h=p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}),g=await c(`Updating`,async()=>l.send(X,{body:h,account_id:f,pool_id:e[`pool-id`]}));o(g,{successLabel:`Updated`})})};var Ze={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}`};function Qe(e){return e.usage(`$0 load-balancers pools get <pool-id>
|
|
65
|
+
|
|
66
|
+
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 $e={command:`get <pool-id>`,describe:`Pool Details`,builder:Qe,handler:async e=>l({command:`load-balancers pools get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(Ze,{account_id:l,pool_id:e[`pool-id`]}));o(u,{successLabel:`Loaded`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}/preview`,body:`json`};function et(e){return e.usage(`$0 load-balancers pools health create <pool-id>
|
|
67
|
+
|
|
68
|
+
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(`header`,{type:`string`,description:`The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. Provide as a JSON object or @path/to/file.json.`}).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`}).coerce(`type`,e=>m(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const tt={command:`create <pool-id>`,describe:`Preview Pool`,builder:et,handler:async e=>l({command:`load-balancers pools health create`,classification:{safeFlags:[`allow-insecure`,`follow-redirects`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools health create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/preview`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Creating`,async()=>l.send(Z,{body:t,account_id:u,pool_id:e[`pool-id`]}));o(n,{successLabel:`Created`});return}let h=p({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:m(e.description,`description`,`text`),expected_body:m(e[`expected-body`],`expected-body`,`text`),expected_codes:m(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],header:f(e.header,`header`),interval:e.interval,method:m(e.method,`method`,`text`),path:m(e.path,`path`,`text`),port:e.port,probe_zone:m(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:e.type},[[`header`]]),g=await c(`Creating`,async()=>l.send(Z,{body:h,account_id:u,pool_id:e[`pool-id`]}));o(g,{successLabel:`Created`})})};var nt={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}/health`};function rt(e){return e.usage(`$0 load-balancers pools health get <pool-id>
|
|
69
|
+
|
|
70
|
+
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 it={command:`get <pool-id>`,describe:`Pool Health Details`,builder:rt,handler:async e=>l({command:`load-balancers pools health get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools health get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/health`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(nt,{account_id:l,pool_id:e[`pool-id`]}));o(u,{successLabel:`Loaded`})})},at={command:`health`,describe:`View current pool health or preview pool health with a monitor configuration`,builder:e=>e.command(tt).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ot={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools`,query:[`monitor`]};function st(e){return e.usage(`$0 load-balancers pools list
|
|
71
|
+
|
|
72
|
+
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 ct={command:`list`,describe:`List Pools`,builder:st,handler:async e=>l({command:`load-balancers pools list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={monitor:e.monitor};if(e.dryRun){let e=await r();s({command:`cf load-balancers pools list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/pools`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ot,{account_id:u,...i}));o(d,{successLabel:`Loaded`})})};var lt={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}/references`};function ut(e){return e.usage(`$0 load-balancers pools references list
|
|
73
|
+
|
|
74
|
+
Get the list of resources that reference the provided pool.`).option(`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 dt={command:`list`,describe:`List Pool References`,builder:ut,handler:async e=>l({command:`load-balancers pools references list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/references`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(lt,{account_id:l,pool_id:e[`pool-id`]}));o(u,{successLabel:`Loaded`})})},ft={command:`references`,describe:`List load balancing resources that use an origin pool`,builder:e=>e.command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/load_balancers/pools/${t.pool_id}`,body:`json`};function pt(e){return e.usage(`$0 load-balancers pools update <pool-id>
|
|
75
|
+
|
|
76
|
+
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`]}).coerce(`load-shedding-default-policy`,e=>m(e,`load-shedding-default-policy`,`text`)).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`]}).coerce(`load-shedding-session-policy`,e=>m(e,`load-shedding-session-policy`,`text`)).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(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).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`]}).coerce(`origin-steering-policy`,e=>m(e,`origin-steering-policy`,`text`)).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 mt={command:`update <pool-id>`,describe:`Update Pool`,builder:pt,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}):d(e.body)});return}let i=e.body===void 0?void 0:d(e.body),l=await n(e),f=e.local?t:await a();if(e.accountId=f,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(Q,{body:t,account_id:f,pool_id:e[`pool-id`]}));o(n,{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await h(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),e.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let g=p({check_regions:e[`check-regions`],description:m(e.description,`description`,`text`),enabled:e.enabled,health_sources:e[`health-sources`],latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:e[`load-shedding-default-policy`],session_percent:e[`load-shedding-session-percent`],session_policy:e[`load-shedding-session-policy`]},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:m(e.monitor,`monitor`,`text`),monitor_group:m(e[`monitor-group`],`monitor-group`,`text`),name:m(e.name,`name`,`text`),networks:e.networks,notification_email:m(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:e[`origin-steering-policy`]},origins:u(e.origins,`origins`)}),_=await c(`Updating`,async()=>l.send(Q,{body:g,account_id:f,pool_id:e[`pool-id`]}));o(_,{successLabel:`Updated`})})},ht={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(Ue).command(Ge).command(Je).command(Xe).command($e).command(ct).command(mt).command(at).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/preview/${t.preview_id}`};function _t(e){return e.usage(`$0 load-balancers previews get <preview-id>
|
|
77
|
+
|
|
78
|
+
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 vt={command:`get <preview-id>`,describe:`Preview Result`,builder:_t,handler:async e=>l({command:`load-balancers previews get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/preview/${e[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(e[`preview-id`]))}`,pathParams:{"preview-id":String(e[`preview-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(gt,{account_id:l,preview_id:e[`preview-id`]}));o(u,{successLabel:`Loaded`})})},yt={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var bt={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/regions/${t.region_id}`};function xt(e){return e.usage(`$0 load-balancers regions get <region-id>
|
|
79
|
+
|
|
80
|
+
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 St={command:`get <region-id>`,describe:`Get Region`,builder:xt,handler:async e=>l({command:`load-balancers regions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf load-balancers regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/regions/${e[`region-id`]==null?`<region-id>`:encodeURIComponent(String(e[`region-id`]))}`,pathParams:{"region-id":String(e[`region-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(bt,{account_id:l,region_id:e[`region-id`]}));o(u,{successLabel:`Loaded`})})};var Ct={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/regions`,query:[`subdivision_code`,`subdivision_code_a2`,`country_code_a2`]};function wt(e){return e.usage(`$0 load-balancers regions list
|
|
81
|
+
|
|
82
|
+
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 Tt={command:`list`,describe:`List Regions`,builder:wt,handler:async e=>l({command:`load-balancers regions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={subdivision_code:e[`subdivision-code`],subdivision_code_a2:e[`subdivision-code-a2`],country_code_a2:e[`country-code-a2`]};if(e.dryRun){let e=await r();s({command:`cf load-balancers regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/regions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Ct,{account_id:u,...i}));o(d,{successLabel:`Loaded`})})},$={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command(St).command(Tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Et={method:`GET`,path:t=>e`/accounts/${t.account_id}/load_balancers/search`,query:[`query`,`references`,`page`,`per_page`]};function Dt(e){return e.usage(`$0 load-balancers searches list
|
|
83
|
+
|
|
84
|
+
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 Ot={command:`list`,describe:`Search Resources`,builder:Dt,handler:async e=>l({command:`load-balancers searches list`,classification:{safeFlags:[`references`,`dry-run`]}},e,async()=>{let i={query:e.query,references:e.references,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();s({command:`cf load-balancers searches list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/load_balancers/search`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Et,{account_id:u,...i}));o(d,{successLabel:`Loaded`})})},kt={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},At={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(D).command(ve).command(Ve).command(ht).command(yt).command($).command(kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{At as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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-
|
|
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-BZjgkacr.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-DIJ7SIKC.mjs";import{a as t}from"./cf-BQ_LRiut.mjs";import{mkdtempSync as n,rmSync as r,statSync as i}from"node:fs";import{join as a,resolve as o}from"node:path";import{tmpdir as s}from"node:os";import{randomUUID as c}from"node:crypto";import{Miniflare as l}from"miniflare";const u=/^\/accounts\/[^/]+/;function d(e){let n=e!==void 0&&e!==``?a(o(process.cwd(),e),`v3`):a(t(),`state`,`v3`);try{if(!i(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 f;function p(e){let t=n(a(s(),`cf-local-isolated-${process.pid}-`));try{return{mf:new l({unsafeLocalExplorer:!0,cf:!1,resourcePersistencePath:e,unsafeEnableSharedStorage:!0,isolatedResourcePersistencePath:t,workers:[{config:{name:`cf-local-${c()}`,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:t}}catch(e){throw r(t,{recursive:!0,force:!0}),e}}async function m(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(u,``)||`/`}${i.search}`,s=new Headers(t.headers);s.delete(`Authorization`),s.set(`Host`,`localhost`);let c;try{c=f??=p(d(n))}catch(e){return h(500,`Could not start the local runtime: ${g(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 h(500,`The local runtime failed to answer: ${g(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 h(404,`${e} The local explorer API does not implement ${t.method} ${n}.`)}return l}function h(e,t){return new Response(JSON.stringify({success:!1,errors:[{message:t}],messages:[],result:null}),{status:e,headers:{"content-type":`application/json`}})}function g(e){return e instanceof Error?e.message:String(e)}async function _(){let e=f;if(f=void 0,e!==void 0)try{let{mf:t,isolatedPersistRoot:n}=e;await t.dispose().finally(()=>r(n,{recursive:!0,force:!0}))}catch{}}export{m as dispatchLocal,_ as disposeLocalSession};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{c as t,g as n}from"./chunk-
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{c as t,g as n}from"./chunk-SOBRPAPT-QTjnHSNs.mjs";import"./ui-xjCox-gU.mjs";import{t as r}from"./log-BWdaOGOW.mjs";import{c as i,d as a,f as o,g as s,h as c,i as l,o as u,r as d,s as f,u as p}from"./oauth-CFVUl-Wv.mjs";import{n as m,t as h}from"./output-BZQEl3mK.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 e=>{_(e,`create`,"Pass the profile name as the command argument: `cf auth create <name>`."),v(),n(e.name);let t=u().configs.exists(e.name);await p({browser:e.browser,device:e.device,scopes:e.scopes,profile:e.name}),m(t?`Profile "${e.name}" re-authenticated.`:`Profile "${e.name}" created.`),r.info(`To use this profile in a directory, run:`,`cf auth activate ${e.name}`)}},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(),n(t.name);let i=u();if(!i.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist.`);let o=i.bindings.removeAllBindingsForProfile(t.name);o.length>0&&r.info([`Removed directory bindings:`,...o.map(e=>` ${e}`)].join(`
|
|
3
3
|
`)),await a(t.name),i.configs.delete(t.name),m(`Profile "${t.name}" deleted.`);let s=i.bindings.getProfileForDirectory(process.cwd());s?r.info(`Active profile for this directory: ${s}.`):i.configs.exists(`default`)?r.info(`This directory now uses the default profile.`):r.info(`No active profile for this directory. Run ${e.code(`cf auth login`)} to set up the default profile, or ${e.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:e=>{_(e,`activate`,"Pass the profile name as the command argument: `cf auth activate <name>`."),v(),n(e.name);let t=u();if(!t.configs.exists(e.name))throw Error(`Profile "${e.name}" does not exist. Run \`cf auth create ${e.name}\` first.`);let r=e.dir??process.cwd();t.bindings.activate(e.name,r),m(`Profile "${e.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:t=>{_(t,`deactivate`),v();let n=u(),i=t.dir??process.cwd(),{removedProfile:a,newResolution:o}=n.bindings.deactivate(i);m(`Profile "${a}" deactivated from "${g.resolve(i)}".`),o.profile===void 0?r.info(`Run ${e.code(`cf auth login`)} to set up the default profile, or ${e.code(`cf auth create <name>`)} to create a named profile.`):o.profile==="default"?r.info(`This directory now uses the default profile.`):r.info(`Now using: ${o.profile} (${o.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`,`use-keyring`,`useKeyring`],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`}).option(`use-keyring`,{type:`boolean`,description:`Encrypt OAuth credentials using the OS keychain (persisted across invocations; use --no-use-keyring to disable)`}),handler:async n=>{_(n,`login`,"Run `cf auth create <name>` to authenticate a named profile.");let a=d();if(a!=="default"&&r.warn(`This directory has profile "${a}" active. ${e.code(`cf auth login`)} updates the default profile, not "${a}". To re-authenticate "${a}", run:`,`cf auth create ${a}`),s(`default`),n.useKeyring!==void 0&&c(n.useKeyring),t({allowGlobalAuthKey:!1})!==void 0){r.warn(`${e.code(`CLOUDFLARE_API_TOKEN`)} is set and takes precedence. Unset it to log in via OAuth.`);return}if(!n.force&&i()){if(await f()){let t=o(),n=[`You are already logged in.`,`${e.info(`Config file:`)} ${e.muted(l())}`];t?.expiration_time&&n.push(`${e.info(`Token expires:`)} ${new Date(t.expiration_time).toLocaleString()}`),n.push(`Run ${e.code(`cf auth login --force`)} to re-authenticate, or ${e.code(`cf auth logout`)} to log out.`),r.info(n.join(`
|
|
4
4
|
`));return}r.warn(`Existing tokens are invalid or expired. Starting fresh login...`)}else n.force&&i()&&r.info(`Re-authenticating...`);if(r.info(`Starting OAuth login flow...`),!await p({browser:n.browser,device:n.device,scopes:n.scopes,profile:`default`}))return;let u=o(),m=[`${e.info(`Config file:`)} ${e.muted(l())}`];u?.scopes&&m.push(u.scopes.length>5?`${e.info(`Scopes:`)} ${u.scopes.length} granted. Run ${e.code(`cf auth whoami`)} to see the full list or ${e.code(`cf auth scopes`)} to view them by product.`:`${e.info(`Scopes:`)} ${u.scopes.join(`, `)}`),u?.expiration_time&&m.push(`${e.info(`Token expires:`)} ${new Date(u.expiration_time).toLocaleString()}`),r.info(m.join(`
|
|
5
5
|
`))}};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{r as e}from"./theme-BGHWSKCw.mjs";import"./ui-xjCox-gU.mjs";import{t}from"./log-BWdaOGOW.mjs";import{n}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{n as r,t as i}from"./login-DG5ebyab.mjs";const a={...i,describe:!1,handler:async n=>{n.quiet||t.info(`${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)}};var o=n(a,{command:`login`,classification:r});export{o as default};
|