cf 0.9.0 → 0.9.1
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/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CzDAjFpo.mjs} +1 -1
- package/dist/{access-RbqBFrSC.mjs → access-CxyW_sIW.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-Dd4-tDYJ.mjs} +1 -1
- package/dist/{account-tags-CKRh1jra.mjs → account-tags-65fAlHrf.mjs} +1 -1
- package/dist/{accounts-2pGhN4s8.mjs → accounts-Bp5KGc6r.mjs} +1 -1
- package/dist/{acm-Szq4CoQN.mjs → acm-CHacxa3s.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BnqNmmYN.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-D--BQS0W.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-BnVlQDiI.mjs} +1 -1
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-CfpDKXkD.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-oG4j_oYN.mjs} +1 -1
- package/dist/{ai-search-2xP8FP_W.mjs → ai-search-B2l3B_jn.mjs} +1 -1
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-byjIIrfl.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-qa8SkXlD.mjs} +1 -1
- package/dist/{analytics-UQrIx99t.mjs → analytics-DeIKjC9n.mjs} +1 -1
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-BnECMIWJ.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-MfHbfZyf.mjs} +1 -1
- package/dist/{argo-Br60zF3y.mjs → argo-DFerMyXF.mjs} +1 -1
- package/dist/{artifacts-D8HMRQmb.mjs → artifacts-CtyEYYDa.mjs} +1 -1
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-retFtvow.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-DuLchM18.mjs} +2 -2
- package/dist/{auth-MeSu8lFz.mjs → auth-aazs91XL.mjs} +1 -1
- package/dist/{billing-0RNCYBJM.mjs → billing-CxQVqpGZ.mjs} +1 -1
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Rli7v7tg.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-Cw6XSEf8.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CTvnHGfV.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-q79xHrVW.mjs} +1 -1
- package/dist/{browser-run-C5pYOwtf.mjs → browser-run-FwtwnBzA.mjs} +1 -1
- package/dist/{build-Nivzj54_.mjs → build-Dji9BYmV.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-Cl7vKJwH.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-DtK_ANxq.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-DZP1RzAs.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-oSz9pud_.mjs} +1 -1
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-BtPU9GsQ.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-DAn-3jwp.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-BpVcvhjZ.mjs} +1 -1
- package/dist/{cloudforce-one-Cp4bQmrG.mjs → cloudforce-one-2PecncfX.mjs} +1 -1
- package/dist/{connector-interrupts-BR47snkh.mjs → connector-interrupts-ollUcksZ.mjs} +1 -1
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CJ9gLRFR.mjs} +1 -1
- package/dist/{connectors-BRCQSsos.mjs → connectors-Bo6ZT8PT.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-Bog7j0Hw.mjs} +1 -1
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-D03UfK2X.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DgS-7ADh.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-8AKtNnUg.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-4y35UC1X.mjs} +1 -1
- package/dist/{custom-csrs-D0zBkQT5.mjs → custom-csrs-DwBrLh-H.mjs} +1 -1
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-CDIAnsRa.mjs} +1 -1
- package/dist/{custom-nameservers-G2MWpRwY.mjs → custom-nameservers-stk7ymnP.mjs} +1 -1
- package/dist/{custom-pages-BINNZTds.mjs → custom-pages-vfDxrXbt.mjs} +1 -1
- package/dist/{d1-FmAh7T7l.mjs → d1-Cllm-iTT.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-rnoSCEdL.mjs} +1 -1
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-DCRCOL6l.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-DGlmjPTS.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-DhCo1I0I.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-BbLV0Ti-.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-D5Yo2xqx.mjs} +1 -1
- package/dist/{directory-CGNWfVQc.mjs → directory-CCndFkbQ.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-C48JQ9EA.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BBq99pjI.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-DdQYtenF.mjs} +1 -1
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-DdwVtm12.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-BvxXBht_.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DFvXKSkg.mjs} +1 -1
- package/dist/{email-routing-CRvIUSFm.mjs → email-routing-QBRPBlyl.mjs} +1 -1
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BFagcRPP.mjs} +1 -1
- package/dist/{email-sending-BwRN8PMW.mjs → email-sending-Ddhe7xjN.mjs} +1 -1
- package/dist/{filters-DczM8qpH.mjs → filters-CGisPGD1.mjs} +1 -1
- package/dist/{firewall-BMiETRmM.mjs → firewall-DD8U-Brd.mjs} +1 -1
- package/dist/{flagship-CPkQMist.mjs → flagship-FJHc4mFi.mjs} +1 -1
- package/dist/{fraud-BhX0QNUl.mjs → fraud-AH47n-wL.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-149kbuG_.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-DfEUG007.mjs} +1 -1
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-DQUiD3Vr.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-RyQboMWI.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-BhHYhMXO.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CDViyKtZ.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-YHZbPlS3.mjs} +1 -1
- package/dist/{interactive-CM2G03lr.mjs → interactive-mV8PABm6.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-BpCdldFx.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-oNu5jWKF.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-yYtv7Ztr.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-Bi9B4E0A.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs} +1 -1
- package/dist/{load-balancers-Ct5cyyF9.mjs → load-balancers-jRCN75mX.mjs} +1 -1
- package/dist/{local-eEF0NF51.mjs → local-DTyuGwTw.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-IAXhEugU.mjs} +1 -1
- package/dist/{logexplorer-BhsAWxCr.mjs → logexplorer-kO8CULiK.mjs} +1 -1
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-LyDAYPbI.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-O9f5bGSB.mjs} +1 -1
- package/dist/{logpush-CFQBi88z.mjs → logpush-dtXLu3Ck.mjs} +1 -1
- package/dist/{logs-C07M9zn-.mjs → logs-DmWWL5f9.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-XbTa6P52.mjs} +1 -1
- package/dist/{magic-network-monitoring-CY3CHSpX.mjs → magic-network-monitoring-CpfkgZMp.mjs} +1 -1
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-DwgZeIj-.mjs} +1 -1
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-DCmogkxv.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-BAeN8VM1.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-DKZ2D050.mjs} +1 -1
- package/dist/{mesh-DLNLi3UT.mjs → mesh-CzIPtuaM.mjs} +1 -1
- package/dist/{moq-BBQVNGo1.mjs → moq-CJpE-eNj.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-Bbm_1lQI.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D2WRXCDe.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-Clq4X1U8.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-BPizUUqP.mjs} +1 -1
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-hilWfAlm.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-CmbgsPYd.mjs} +1 -1
- package/dist/{observability-B5p3iwrq.mjs → observability-DXYgDdU5.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-D41rIvJa.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-eNzfOwlP.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-DaiAmw45.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-7YztBged.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DRwURM8s.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-B2Csdc4h.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-BAL6Q7OY.mjs} +1 -1
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-C-1-ZAtn.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-cyQOuFLb.mjs} +1 -1
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BrweY39h.mjs} +1 -1
- package/dist/{progress-C-oFUtvC.mjs → progress-B84wYh91.mjs} +1 -1
- package/dist/{prompt-DM4z101s.mjs → prompt-CDtLWxNv.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-oM8uGZy5.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-CTx04ZNw.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CnlIUn7R.mjs} +1 -1
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-DLtf9d6o.mjs} +1 -1
- package/dist/{radar-Cu9rsTw_.mjs → radar-CGNgGh8v.mjs} +1 -1
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-B1YjnGue.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-Dz-QBoP_.mjs} +1 -1
- package/dist/{realtimekit-msnGHBbf.mjs → realtimekit-BPwzhNS9.mjs} +1 -1
- package/dist/{registrar-C0EsXf83.mjs → registrar-BEcb90RX.mjs} +1 -1
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-0i1T3zne.mjs} +1 -1
- package/dist/{registry-CJvn75Bq.mjs → registry-DDcSvd8H.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-CLbjHlnw.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-BcKpofP1.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-Ctdi9D-j.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-DGEyVTDN.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-CmuB5rIN.mjs} +1 -1
- package/dist/{rulesets-BHvhAeG_.mjs → rulesets-CGaMq8vG.mjs} +1 -1
- package/dist/{rum-Dyno5zj3.mjs → rum-QT6EP4JK.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-DHryz6SF.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-BgGsmHrL.mjs} +1 -1
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-BCpFhYFv.mjs} +1 -1
- package/dist/{security-center-DRC4Mf3R.mjs → security-center-BNm4uPVB.mjs} +1 -1
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-Be2Bif0z.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-Ckt20hHa.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-Bz2tFTUP.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-BzPQog8H.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-SODkOUyO.mjs} +1 -1
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-B5jY8v_7.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-CHkoow5W.mjs} +1 -1
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-BA0a42eM.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-mmOjxOzo.mjs} +1 -1
- package/dist/{src-CgAVPA4I.mjs → src-CHW7s5IS.mjs} +4 -4
- package/dist/{ssl-BsxTHasY.mjs → ssl-Yr6kELqg.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-DZC531l2.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-Cu0kYWbc.mjs} +1 -1
- package/dist/{submit-BjdywxTq.mjs → submit-Dl_27e0n.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-Cdo_Pwtr.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-EX-ANl6X.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-Bf9hbP3h.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-CDYkWjnt.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-CgyX8R2J.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-BUtzlW-0.mjs} +1 -1
- package/dist/{ui-DjQ4AQww.mjs → ui-DIpjthrV.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-CJsa1Oc9.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-BeKkOZz7.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-Cz-yl0_3.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-BxHjEqpd.mjs} +1 -1
- package/dist/{values-Cmlw5wGZ.mjs → values-C43NurfT.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CjXfiFH4.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BFbc90Wu.mjs} +1 -1
- package/dist/{waiting-rooms-ku9UsAr9.mjs → waiting-rooms-C5jSQv_r.mjs} +1 -1
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-BzM5vVzy.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-Ctv9HGiR.mjs} +1 -1
- package/dist/{workers-D8czeT64.mjs → workers-D-YbIedB.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B44wc67O.mjs} +1 -1
- package/dist/{workflows-BOi5MTEN.mjs → workflows-rFuQWClt.mjs} +1 -1
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-BA6kY-b6.mjs} +1 -1
- package/dist/{zero-trust-BmA0VkgF.mjs → zero-trust-DOFLlUz1.mjs} +1 -1
- package/dist/{zone-Bx5ElO9U.mjs → zone-B_rgejLV.mjs} +1 -1
- package/dist/{zone-tags-izd3WWmy.mjs → zone-tags-BWdza4rH.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-DTWO7Vvn.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-DM4z101s.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.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.",default:!1}).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`],default:`pop`}).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`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).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`],default:`Auto`}).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`],default:`Auto`}).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`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new account-scoped load balancer.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.loadBalancers.account.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);r[`fallback-pool`]===void 0&&(r[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),r.name===void 0&&(r.name=await d(`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 m=l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl});a(await s(`Creating`,async()=>f.loadBalancers.account.create({...m,account_id:p})),{successLabel:`Created`})}};function te(e){return e.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 h={command:`delete <load-balancer-id>`,describe:`Delete a configured account-scoped load balancer.`,builder:te,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/${r[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(r[`load-balancer-id`]))}`,pathParams:{"load-balancer-id":String(r[`load-balancer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.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.",default:!1}).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`],default:`pop`}).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`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).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`],default:`Auto`}).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`],default:`Auto`}).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`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new account-scoped load balancer.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.loadBalancers.account.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);r[`fallback-pool`]===void 0&&(r[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),r.name===void 0&&(r.name=await d(`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 m=l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl});a(await s(`Creating`,async()=>f.loadBalancers.account.create({...m,account_id:p})),{successLabel:`Created`})}};function te(e){return e.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 h={command:`delete <load-balancer-id>`,describe:`Delete a configured account-scoped load balancer.`,builder:te,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/${r[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(r[`load-balancer-id`]))}`,pathParams:{"load-balancer-id":String(r[`load-balancer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.account.delete({account_id:l,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The editable properties shared by load balancer create, update, and patch requests. Operations layer their own `required` constraints on top via `allOf`."})}const _={command:`edit <load-balancer-id>`,describe:`Apply changes to an existing account-scoped load balancer, overwriting the supplied properties.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/${r[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(r[`load-balancer-id`]))}`,pathParams:{"load-balancer-id":String(r[`load-balancer-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.loadBalancers.account.edit({body:e,account_id:f,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Updated`});return}let p=l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl});a(await s(`Updating`,async()=>d.loadBalancers.account.edit({body:p,account_id:f,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Updated`})}};function v(e){return e.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 y={command:`get <load-balancer-id>`,describe:`Fetch a single configured account-scoped load balancer.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/${r[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(r[`load-balancer-id`]))}`,pathParams:{"load-balancer-id":String(r[`load-balancer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.account.get({account_id:l,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List configured account-scoped load balancers.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.account.list({account_id:l})),{successLabel:`Loaded`})}};function S(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <load-balancer-id>`,describe:`Update a configured account-scoped load balancer.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/${r[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(r[`load-balancer-id`]))}`,pathParams:{"load-balancer-id":String(r[`load-balancer-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.loadBalancers.account.update({...e,account_id:p,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Updated`});return}if(r[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);r[`fallback-pool`]===void 0&&(r[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),r.name===void 0&&(r.name=await d(`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 m=l({adaptive_routing:{failover_across_pools:r[`adaptive-routing-failover-across-pools`]},default_pools:r[`default-pools`],description:u(r.description,`description`,`text`),enabled:r.enabled,fallback_pool:u(r[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(r[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(r[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(r.name,`name`,`text`),networks:r.networks,proxied:r.proxied,random_steering:{default_weight:r[`random-steering-default-weight`]},session_affinity:u(r[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:r[`session-affinity-attributes-drain-duration`],headers:r[`session-affinity-attributes-headers`],require_all_headers:r[`session-affinity-attributes-require-all-headers`],samesite:u(r[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(r[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(r[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:r[`session-affinity-ttl`],steering_policy:u(r[`steering-policy`],`steering-policy`,`text`),ttl:r.ttl});a(await s(`Updating`,async()=>f.loadBalancers.account.update({...m,account_id:p,load_balancer_id:r[`load-balancer-id`]})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Get current load balancer resource usage counts for an account.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account usage list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/usage`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.account.usage.list({account_id:l})),{successLabel:`Loaded`})}},E={command:`usage`,describe:`Operations for account.usage`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`account`,describe:`Operations for account`,builder:e=>e.command(ee).command(h).command(_).command(y).command(x).command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.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.",default:!1}).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(`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`],default:`pop`}).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`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).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`],default:`Auto`}).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`],default:`Auto`}).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`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Create a new load balancer.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf load-balancers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/load_balancers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},default_pools:e[`default-pools`],description:u(e.description,`description`,`text`),fallback_pool:u(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(e[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(e[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(e.name,`name`,`text`),networks:e.networks,proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`]},session_affinity:u(e[`session-affinity`],`session-affinity`,`text`),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:u(e[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(e[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(e[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:u(e[`steering-policy`],`steering-policy`,`text`),ttl:e.ttl}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.loadBalancers.create({...r,zone_id:n})),{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 d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),e.name===void 0&&(e.name=await d(`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 f=l({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},default_pools:e[`default-pools`],description:u(e.description,`description`,`text`),fallback_pool:u(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(e[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(e[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(e.name,`name`,`text`),networks:e.networks,proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`]},session_affinity:u(e[`session-affinity`],`session-affinity`,`text`),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:u(e[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(e[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(e[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:u(e[`steering-policy`],`steering-policy`,`text`),ttl:e.ttl});a(await s(`Creating`,async()=>t.loadBalancers.create({...f,zone_id:n})),{successLabel:`Created`})}};function A(e){return e.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 j={command:`delete <load-balancer-id>`,describe:`Delete a configured load balancer.`,builder:A,handler:async e=>{if(e.dryRun){o({command:`cf load-balancers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await f({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>t.loadBalancers.delete({zone_id:n,load_balancer_id:e[`load-balancer-id`]})),{successLabel:`Deleted`})}};function M(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`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(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`edit <load-balancer-id>`,describe:`Apply changes to an existing load balancer, overwriting the supplied properties.`,builder:M,handler:async e=>{if(e.dryRun){o({command:`cf load-balancers edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},default_pools:e[`default-pools`],description:u(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:u(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(e[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(e[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(e.name,`name`,`text`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`]},session_affinity:u(e[`session-affinity`],`session-affinity`,`text`),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:u(e[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(e[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(e[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:u(e[`steering-policy`],`steering-policy`,`text`),ttl:e.ttl}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.loadBalancers.edit({...r,zone_id:n,load_balancer_id:e[`load-balancer-id`]})),{successLabel:`Updated`});return}let d=l({adaptive_routing:{failover_across_pools:e[`adaptive-routing-failover-across-pools`]},default_pools:e[`default-pools`],description:u(e.description,`description`,`text`),enabled:e.enabled,fallback_pool:u(e[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(e[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(e[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(e.name,`name`,`text`),proxied:e.proxied,random_steering:{default_weight:e[`random-steering-default-weight`]},session_affinity:u(e[`session-affinity`],`session-affinity`,`text`),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:u(e[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(e[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(e[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:e[`session-affinity-ttl`],steering_policy:u(e[`steering-policy`],`steering-policy`,`text`),ttl:e.ttl});a(await s(`Updating`,async()=>t.loadBalancers.edit({...d,zone_id:n,load_balancer_id:e[`load-balancer-id`]})),{successLabel:`Updated`})}};function P(e){return e.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 F={command:`get <load-balancer-id>`,describe:`Fetch a single configured load balancer.`,builder:P,handler:async e=>{if(e.dryRun){o({command:`cf load-balancers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/load_balancers/${e[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(e[`load-balancer-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"load-balancer-id":String(e[`load-balancer-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.loadBalancers.get({zone_id:n,load_balancer_id:e[`load-balancer-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List configured load balancers.`,builder:I,handler:async e=>{if(e.dryRun){o({command:`cf load-balancers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/load_balancers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.loadBalancers.list({zone_id:n})),{successLabel:`Loaded`})}};function R(e){return e.option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`create`,describe:`Create a new monitor group.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:e,account_id:p})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:m,account_id:p})),{successLabel:`Created`})}};function B(e){return e.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 V={command:`delete <monitor-group-id>`,describe:`Delete a configured monitor group.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>c.loadBalancers.monitorGroups.delete({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Deleted`})}};function H(e){return e.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(`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 U={command:`edit <monitor-group-id>`,describe:`Apply changes to an existing monitor group, overwriting the supplied properties.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.edit({body:e,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.edit({body:m,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}};function W(e){return e.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 G={command:`get <monitor-group-id>`,describe:`Fetch a single configured monitor group.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.get({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List configured monitor groups.`,builder:K,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.list({account_id:l})),{successLabel:`Loaded`})}};function J(e){return e.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 Y={command:`list`,describe:`Get the list of resources that reference the provided monitor group.`,builder:J,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}/references`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.references.list({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Loaded`})}},X={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`update <monitor-group-id>`,describe:`Modify a configured monitor group.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.update({body:e,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.update({body:m,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}},ne={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).command(Q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`create`,describe:`Create a configured monitor.`,builder:re,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.loadBalancers.monitors.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>d.loadBalancers.monitors.create({body:p,account_id:f})),{successLabel:`Created`})}};function ae(e){return e.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 oe={command:`delete <monitor-id>`,describe:`Delete a configured monitor.`,builder:ae,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./chunk-vbHwaUoU.mjs";var t=e({LOCAL_ACCOUNT_ID:()=>o,NO_LOCAL_EQUIVALENT:()=>n,createLocalFetch:()=>a,disposeLocalRuntime:()=>i});const n=`This command has no local equivalent. Re-run without --local to use the Cloudflare API.`;let r;async function i(){let e=r;r=void 0,await e?.()}function a(e={}){return async function(t,n){let{dispatchLocal:i,disposeLocalSession:a}=await import(`./local-runtime-
|
|
2
|
+
import{n as e}from"./chunk-vbHwaUoU.mjs";var t=e({LOCAL_ACCOUNT_ID:()=>o,NO_LOCAL_EQUIVALENT:()=>n,createLocalFetch:()=>a,disposeLocalRuntime:()=>i});const n=`This command has no local equivalent. Re-run without --local to use the Cloudflare API.`;let r;async function i(){let e=r;r=void 0,await e?.()}function a(e={}){return async function(t,n){let{dispatchLocal:i,disposeLocalSession:a}=await import(`./local-runtime-IAXhEugU.mjs`);return r=a,i(new Request(t,n),e.persistTo,e.apiBaseUrl)}}const o=`local`;export{t as a,i,n,a as r,o 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-DTyuGwTw.mjs";import{i as t}from"./cf-oSz9pud_.mjs";import{n}from"./registry-DDcSvd8H.mjs";import{mkdtempSync as r,rmSync as i,statSync as a}from"node:fs";import{join as o,resolve as s}from"node:path";import{tmpdir as c}from"node:os";import{randomUUID as l}from"node:crypto";import{Miniflare as u}from"miniflare";const d=/^\/accounts\/[^/]+/;function f(e){let n=e!==void 0&&e!==``?o(s(process.cwd(),e),`v3`):o(t(),`state`,`v3`);try{if(!a(n).isDirectory())throw Error(`Local persistence path must be a directory: ${n}`)}catch(e){let t=e.code;if(t===`ENOENT`)return n;throw t===`ENOTDIR`?Error(`Local persistence path must be a directory: ${n}`):e}return n}let p;function m(e){let t=n(),a=r(o(c(),`cf-local-isolated-${process.pid}-`));try{return{mf:new u({unsafeLocalExplorer:!0,cf:!1,resourcePersistencePath:e,unsafeEnableSharedStorage:!0,isolatedResourcePersistencePath:a,unsafeDevRegistryPath:t,workers:[{config:{name:`cf-local-${l()}`,type:`worker`,compatibilityDate:`2026-08-15`,manifest:{mainModule:`cf-local.mjs`,modules:{"cf-local.mjs":{type:`esm`,contents:`export default { fetch() { return new Response(null, { status: 404 }); } };`}}}}}]}),isolatedPersistRoot:a}}catch(e){throw i(a,{recursive:!0,force:!0}),e}}async function h(t,n,r){let i=new URL(t.url),a=new URL(r??`https://api.cloudflare.com/client/v4`).pathname.replace(/\/+$/,``),o=`http://localhost/cdn-cgi/local/explorer/api${i.pathname.slice(a.length).replace(d,``)||`/`}${i.search}`,s=new Headers(t.headers);s.delete(`Authorization`),s.set(`Host`,`localhost`);let c;try{c=p??=m(f(n))}catch(e){return g(500,`Could not start the local runtime: ${_(e)}`)}let l;try{let e={method:t.method,headers:[...s],redirect:`manual`,signal:t.signal};t.body!==null&&(e.body=t.body,e.duplex=`half`),l=await c.mf.dispatchFetch(o,e)}catch(e){return g(500,`The local runtime failed to answer: ${_(e)}`)}if(l.status===404&&l.headers.get(`content-type`)?.includes(`json`)!==!0){await l.body?.cancel();let n=new URL(o).pathname.replace(/^.*\/explorer\/api/,``);return g(404,`${e} The local explorer API does not implement ${t.method} ${n}.`)}return l}function g(e,t){return new Response(JSON.stringify({success:!1,errors:[{message:t}],messages:[],result:null}),{status:e,headers:{"content-type":`application/json`}})}function _(e){return e instanceof Error?e.message:String(e)}async function v(){let e=p;if(p=void 0,e!==void 0)try{let{mf:t,isolatedPersistRoot:n}=e;await t.dispose().finally(()=>i(n,{recursive:!0,force:!0}))}catch{}}export{h as dispatchLocal,v as disposeLocalSession};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{a as i,r as a}from"./auth-DuLchM18.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-B84wYh91.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-CDtLWxNv.mjs";function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`available`,describe:`Returns all dataset types that this account can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:h,handler:async r=>{if(r.dryRun){s({command:`cf logexplorer account datasets available`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/explorer/datasets/available`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.logexplorer.account.datasets.available({account_id:l})),{successLabel:`Loaded`})}};function _(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are ingested.
|
|
3
3
|
If provided, replaces the dataset's default filter entirely.
|
|
4
4
|
See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
|
|
5
5
|
for syntax and examples.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for logo queries based on ID`,builder:s,handler:async s=>{let c={logo_id:s[`logo-id`],offset:s.offset,limit:s.limit};if(s.dryRun){a({command:`cf logo-matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for logo queries based on ID`,builder:u,handler:async s=>{let c={logo_id:s[`logo-id`],offset:s.offset,limit:s.limit};if(s.dryRun){a({command:`cf logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`logo-matches`,describe:`logo-matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{a as r,r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./input-validation-BBKJRoRB.mjs";import{n as u}from"./prompt-CDtLWxNv.mjs";function d(e){return e.option(`tag`,{type:`string`,description:`Tag`}).option(`match-type`,{type:`string`,description:`Match type`}).option(`threshold`,{type:`number`,description:`Threshold`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const f={command:`create`,describe:`Return new saved logo queries created from image files`,builder:d,handler:async u=>{let d={tag:u.tag,match_type:u[`match-type`],threshold:u.threshold};if(u.dryRun){o({command:`cf logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos`,pathParams:{},query:d,bodyKind:`octet-stream`,body:u.body});return}let f=await i(u),p=u.local?e:await t();if(u.accountId=p,u.file){let e=l(u.file);a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(u.body){let e=c(u.body,`body`,`binary`),t=new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function p(e){return e.positional(`logo-id`,{type:`string`,description:`Logo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <logo-id>`,describe:`Return a success message after deleting saved logo queries by ID`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos/${r[`logo-id`]==null?`<logo-id>`:encodeURIComponent(String(r[`logo-id`]))}`,pathParams:{"logo-id":String(r[`logo-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await u({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.logos.delete({account_id:l,logo_id:r[`logo-id`]})),{successLabel:`Deleted`})}},h={command:`logos`,describe:`logos`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-DM4z101s.mjs";function p(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountDatasets.fields.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})}},ee={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:te,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountDatasets.jobs.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})}},g={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(ee).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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:`Creates a new Logpush job for an account.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({dataset:u(r.dataset,`dataset`,`text`),destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountJobs.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=l({dataset:u(r.dataset,`dataset`,`text`),destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountJobs.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,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 x={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-CDtLWxNv.mjs";function p(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountDatasets.fields.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})}},ee={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:te,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountDatasets.jobs.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})}},g={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(ee).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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:`Creates a new Logpush job for an account.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({dataset:u(r.dataset,`dataset`,`text`),destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountJobs.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=l({dataset:u(r.dataset,`dataset`,`text`),destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountJobs.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,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 x={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.logpush.accountJobs.delete({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountJobs.get({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Lists Logpush jobs for an account.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.accountJobs.list({account_id:l})),{successLabel:`Loaded`})}};function E(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 D={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.logpush.accountJobs.update({...e,account_id:f,job_id:r[`job-id`]})),{successLabel:`Updated`});return}let p=l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:u(r.filter,`filter`,`text`),frequency:u(r.frequency,`frequency`,`text`),kind:u(r.kind,`kind`,`text`),logpull_options:u(r[`logpull-options`],`logpull-options`,`text`),name:u(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:u(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:u(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:u(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Updating`,async()=>d.logpush.accountJobs.update({...p,account_id:f,job_id:r[`job-id`]})),{successLabel:`Updated`})}},O={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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:`Gets a new ownership challenge sent to your destination.`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/ownership`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountOwnership.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountOwnership.create({...m,account_id:p})),{successLabel:`Created`})}};function j(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/ownership/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountOwnership.validate.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),r[`ownership-challenge`]===void 0&&(r[`ownership-challenge`]=await d(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let m=l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(r[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountOwnership.validate.create({...m,account_id:p})),{successLabel:`Created`})}},N={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/validate/destination/exists`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountValidate.destinationExistsDelete({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountValidate.destinationExistsDelete({...m,account_id:p})),{successLabel:`Created`})}};function L(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`delete`,describe:`Validates destination.`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/validate/destination`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountValidate.destination.delete({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=l({destination_conf:u(r[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountValidate.destination.delete({...m,account_id:p})),{successLabel:`Created`})}},z={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/validate/origin`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({logpull_options:u(r[`logpull-options`],`logpull-options`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.accountValidate.origin.create({...e,account_id:p})),{successLabel:`Created`});return}r[`logpull-options`]===void 0&&(r[`logpull-options`]=await d(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let m=l({logpull_options:u(r[`logpull-options`],`logpull-options`,`text`)});a(await s(`Creating`,async()=>f.logpush.accountValidate.origin.create({...m,account_id:p})),{successLabel:`Created`})}},H={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(I).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:W,handler:async e=>{if(e.dryRun){o({command:`cf logpush datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.datasets.fields.get({zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},K={command:`fields`,describe:`Operations for datasets.fields`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <dataset-id>`,describe:`Lists Logpush jobs for a zone for a dataset.`,builder:q,handler:async e=>{if(e.dryRun){o({command:`cf logpush datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.datasets.jobs.get({zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},Y={command:`jobs`,describe:`Operations for datasets.jobs`,builder:e=>e.command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},X={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(K).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:Z,handler:async e=>{if(e.dryRun){o({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({fields:u(e.fields,`fields`,`text`),filter:u(e.filter,`filter`,`text`),sample:e.sample}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`});return}let d=l({fields:u(e.fields,`fields`,`text`),filter:u(e.filter,`filter`,`text`),sample:e.sample});a(await s(`Creating`,async()=>t.logpush.edge.create({...d,zone_id:n})),{successLabel:`Created`})}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:ne,handler:async e=>{if(e.dryRun){o({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.edge.get({zone_id:n})),{successLabel:`Loaded`})}},ie={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`create`,describe:`Creates a new Logpush job for a zone.`,builder:ae,handler:async e=>{if(e.dryRun){o({command:`cf logpush jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({dataset:u(e.dataset,`dataset`,`text`),destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:u(e.filter,`filter`,`text`),frequency:u(e.frequency,`frequency`,`text`),kind:u(e.kind,`kind`,`text`),logpull_options:u(e[`logpull-options`],`logpull-options`,`text`),name:u(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:u(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:u(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:u(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.jobs.create({...r,zone_id:n})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=l({dataset:u(e.dataset,`dataset`,`text`),destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:u(e.filter,`filter`,`text`),frequency:u(e.frequency,`frequency`,`text`),kind:u(e.kind,`kind`,`text`),logpull_options:u(e[`logpull-options`],`logpull-options`,`text`),name:u(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:u(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:u(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:u(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>t.logpush.jobs.create({...f,zone_id:n})),{successLabel:`Created`})}};function se(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,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 <job-id>`,describe:`Deletes a Logpush job.`,builder:se,handler:async e=>{if(e.dryRun){o({command:`cf logpush jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await f({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>t.logpush.jobs.delete({zone_id:n,job_id:e[`job-id`]})),{successLabel:`Deleted`})}};function le(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:le,handler:async e=>{if(e.dryRun){o({command:`cf logpush jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.jobs.get({zone_id:n,job_id:e[`job-id`]})),{successLabel:`Loaded`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Lists Logpush jobs for a zone.`,builder:de,handler:async e=>{if(e.dryRun){o({command:`cf logpush jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.jobs.list({zone_id:n})),{successLabel:`Loaded`})}};function pe(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 me={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:pe,handler:async e=>{if(e.dryRun){o({command:`cf logpush jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:u(e.filter,`filter`,`text`),frequency:u(e.frequency,`frequency`,`text`),kind:u(e.kind,`kind`,`text`),logpull_options:u(e[`logpull-options`],`logpull-options`,`text`),name:u(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:u(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:u(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:u(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.logpush.jobs.update({...r,zone_id:n,job_id:e[`job-id`]})),{successLabel:`Updated`});return}let d=l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:u(e.filter,`filter`,`text`),frequency:u(e.frequency,`frequency`,`text`),kind:u(e.kind,`kind`,`text`),logpull_options:u(e[`logpull-options`],`logpull-options`,`text`),name:u(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:u(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:u(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:u(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Updating`,async()=>t.logpush.jobs.update({...d,zone_id:n,job_id:e[`job-id`]})),{successLabel:`Updated`})}},he={command:`jobs`,describe:`Operations for jobs`,builder:e=>e.command(oe).command(ce).command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:ge,handler:async e=>{if(e.dryRun){o({command:`cf logpush ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/ownership`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.ownership.create({...r,zone_id:n})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>t.logpush.ownership.create({...f,zone_id:n})),{successLabel:`Created`})}};function ve(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ye={command:`validate`,describe:`Validates ownership challenge of the destination.`,builder:ve,handler:async e=>{if(e.dryRun){o({command:`cf logpush ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/ownership/validate`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.ownership.validate({...r,zone_id:n})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),e[`ownership-challenge`]===void 0&&(e[`ownership-challenge`]=await d(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let f=l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(e[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>t.logpush.ownership.validate({...f,zone_id:n})),{successLabel:`Created`})}},be={command:`ownership`,describe:`Operations for ownership`,builder:e=>e.command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`version-id`,{type:`number`,description:`Specific version ID to retrieve. When omitted, the latest version is returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get <transformer-id>`,describe:"Returns the SQL query content for a transformer. Without query params, returns the latest version. With `version_id`, returns the specified version.",builder:xe,handler:async r=>{let c={version_id:r[`version-id`]};if(r.dryRun){o({command:`cf logpush transformers content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/content`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.content.get({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})}},Ce={command:`content`,describe:`Operations for transformers.content`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Te={command:`create`,describe:`Creates a new custom log transformer for an account.`,builder:we,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.transformers.create({...e,account_id:p})),{successLabel:`Created`});return}r.code===void 0&&(r.code=await d(`code`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`)),r.name===void 0&&(r.name=await d(`name`,`Customer-provided name for identification.`));let m=l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>f.logpush.transformers.create({...m,account_id:p})),{successLabel:`Created`})}};function Ee(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer 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 De={command:`delete <transformer-id>`,describe:`Deletes a custom log transformer. Returns 409 Conflict if any active logpush jobs reference the transformer.`,builder:Ee,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>c.logpush.transformers.delete({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Deleted`})}};function Oe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get <transformer-id>`,describe:`Gets a single custom log transformer by ID.`,builder:Oe,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.get({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Loaded`})}};function Ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`Lists all custom log transformers for an account.`,builder:Ae,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.list({account_id:l})),{successLabel:`Loaded`})}};function Me(e){return e.option(`sql`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).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:`preview`,describe:`Executes a SQL transformer against a single input record and returns the transformed output. This is a stateless endpoint — nothing is persisted.`,builder:Me,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({sql:u(r.sql,`sql`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Loading`,async()=>f.logpush.transformers.preview({...e,account_id:p})),{successLabel:`Loaded`});return}r.sql===void 0&&(r.sql=await d(`sql`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`));let m=l({sql:u(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>f.logpush.transformers.preview({...m,account_id:p})),{successLabel:`Loaded`})}};function Pe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`update <transformer-id>`,describe:"Updates an existing custom log transformer. When `code` is provided, the SQL query is validated and a new version is created. When `code` is omitted, only the name and description are updated. Omitting `description` clears the existing description.",builder:Pe,handler:async r=>{if(r.dryRun){o({command:`cf logpush transformers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.logpush.transformers.update({...e,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await d(`name`,`Customer-provided name for identification.`));let m=l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)});a(await s(`Updating`,async()=>f.logpush.transformers.update({...m,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`})}};function Fe(e){return e.option(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Maximum number of versions to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`list`,describe:`Returns version metadata for a transformer, newest first. Each version corresponds to a SQL query update.`,builder:Fe,handler:async r=>{let c={limit:r.limit};if(r.dryRun){o({command:`cf logpush transformers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/versions`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.versions.list({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})}},Le={command:`versions`,describe:`Operations for transformers.versions`,builder:e=>e.command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Re={command:`transformers`,describe:`Operations for transformers`,builder:e=>e.command(Te).command(De).command(ke).command(je).command(Ne).command($).command(Ce).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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:`destination-exists`,describe:`Checks if there is an existing job with a destination.`,builder:ze,handler:async e=>{if(e.dryRun){o({command:`cf logpush validate destination-exists`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/destination/exists`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.validate.destinationExists({...r,zone_id:n})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>t.logpush.validate.destinationExists({...f,zone_id:n})),{successLabel:`Created`})}};function Ve(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`destination`,describe:`Validates destination.`,builder:Ve,handler:async e=>{if(e.dryRun){o({command:`cf logpush validate destination`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/destination`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.validate.destination({...r,zone_id:n})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=l({destination_conf:u(e[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>t.logpush.validate.destination({...f,zone_id:n})),{successLabel:`Created`})}};function Ue(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const We={command:`origin`,describe:`Validates logpull origin with logpull_options.`,builder:Ue,handler:async e=>{if(e.dryRun){o({command:`cf logpush validate origin`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/origin`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({logpull_options:u(e[`logpull-options`],`logpull-options`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.logpush.validate.origin({...r,zone_id:n})),{successLabel:`Created`});return}e[`logpull-options`]===void 0&&(e[`logpull-options`]=await d(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let f=l({logpull_options:u(e[`logpull-options`],`logpull-options`,`text`)});a(await s(`Creating`,async()=>t.logpush.validate.origin({...f,zone_id:n})),{successLabel:`Created`})}},Ge={command:`validate`,describe:`Operations for validate`,builder:e=>e.command(He).command(Be).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`logpush`,describe:`logpush`,builder:e=>e.command(_).command(O).command(P).command(U).command(X).command(ie).command(he).command(be).command(Re).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ke as default};
|