cf 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abuse-reports-Ina5TlsU.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
- package/dist/accounts-BIY8wNGA.mjs +22 -0
- package/dist/acm-SqcV8o5o.mjs +3 -0
- package/dist/addressing-CygRm0pN.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-CKb6w43K.mjs} +1 -1
- package/dist/ai-BAmEAjN3.mjs +2 -0
- package/dist/ai-gateway-BENwPvvB.mjs +8 -0
- package/dist/ai-search-Bv_Whw3E.mjs +7 -0
- package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
- package/dist/alerting-D_qWrsoY.mjs +6 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-CwFrx-Dr.mjs} +1 -1
- package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
- package/dist/api-gateway-D9PMVVqL.mjs +33 -0
- package/dist/argo-DwYGbyld.mjs +2 -0
- package/dist/artifacts-DKAjY_n4.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BvQ9uwuy.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-DX9KnJ0P.mjs} +3 -3
- package/dist/{auth-D5hNsOFq.mjs → auth-TYwGydWg.mjs} +1 -1
- package/dist/billing-CRTlRU88.mjs +2 -0
- package/dist/bot-management-DgW--8wM.mjs +5 -0
- package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
- package/dist/brand-protection-ZikBtl0y.mjs +3 -0
- package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
- package/dist/build-Bgw8TV1p.mjs +134 -0
- package/dist/cache-CeN5t6_W.mjs +5 -0
- package/dist/calls-Cv0ieVg4.mjs +4 -0
- package/dist/{certificate-authorities-CtqzAtxQ.mjs → certificate-authorities-BzZnWCac.mjs} +1 -1
- package/dist/client-certificates-BFuzeBrj.mjs +3 -0
- package/dist/{cloud-connector-BA5IRZUP.mjs → cloud-connector-D5h8Dzzg.mjs} +1 -1
- package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-Bvzav4Mj.mjs} +1 -1
- package/dist/connectivity-CjkXmEhO.mjs +3 -0
- package/dist/connector-interrupts-B7eSface.mjs +2 -0
- package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
- package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
- package/dist/connectors-YYu_Vx3H.mjs +3 -0
- package/dist/content-scanning-BorfRGKT.mjs +4 -0
- package/dist/{context-jpewmual.mjs → context-C-WbewL6.mjs} +1 -1
- package/dist/custom-certificates-CfRj7QZb.mjs +5 -0
- package/dist/{custom-hostnames-CtuTdFcX.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
- package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
- package/dist/custom-pages-DamGVA75.mjs +4 -0
- package/dist/d1-sK0O5THv.mjs +4 -0
- package/dist/data-security-DsWpoWiS.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-BYsNl3qc.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-BzlPv3ro.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-IOg-_s5_.mjs} +1 -1
- package/dist/diagnostics-CH7T2WR3.mjs +3 -0
- package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
- package/dist/dns-o7hUPMCG.mjs +29 -0
- package/dist/durable-objects-DgrTbvoF.mjs +2 -0
- package/dist/email-routing-owCvAEpf.mjs +10 -0
- package/dist/email-security-Dng3DVuf.mjs +8 -0
- package/dist/email-sending-bExMH4lu.mjs +3 -0
- package/dist/filters-DKs-wEzt.mjs +4 -0
- package/dist/{firewall-DYZcTtIC.mjs → firewall-BLaTtX3r.mjs} +10 -10
- package/dist/{fraud-C03MtdZb.mjs → fraud-D8WmLKyH.mjs} +1 -1
- package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
- package/dist/healthchecks-BBtW8vRh.mjs +4 -0
- package/dist/hostnames-Bh2IFxIw.mjs +3 -0
- package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
- package/dist/iam-apCCcy7R.mjs +6 -0
- package/dist/images-Cxe45OHm.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-8V4h6H46.mjs +3 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-BE7JbAnc.mjs} +1 -1
- package/dist/keyless-certificates-CfJmXccT.mjs +3 -0
- package/dist/kv-Dz6then8.mjs +5 -0
- package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
- package/dist/load-balancers-ilsGgudX.mjs +6 -0
- package/dist/logpush-BH14TtuA.mjs +4 -0
- package/dist/logs-B8-mkf_I.mjs +3 -0
- package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
- package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
- package/dist/magic-transit-B-kU5e3s.mjs +89 -0
- package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
- package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
- package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
- package/dist/oauth-B5k80sip.mjs +61 -0
- package/dist/observability-9APhqFHo.mjs +4 -0
- package/dist/{organizations-BqJHyvMK.mjs → organizations-Dy3kiV_z.mjs} +6 -6
- package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
- package/dist/origin-tls-client-auth-B30_2_dO.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-zQJGmTCd.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-CxQk5k9X.mjs} +5 -5
- package/dist/pages-5DKLs7CQ.mjs +11 -0
- package/dist/pipelines-DfGE44xo.mjs +6 -0
- package/dist/{progress-DrDErV9w.mjs → progress-CL8I-7YK.mjs} +1 -1
- package/dist/prompt-q3B7sM2A.mjs +3 -0
- package/dist/queues-BoenUGIw.mjs +6 -0
- package/dist/r2-Cq_JCjK0.mjs +21 -0
- package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
- package/dist/{radar-D986zPJr.mjs → radar-YNOCio6T.mjs} +1 -1
- package/dist/rate-limits-CcAF3tMl.mjs +5 -0
- package/dist/{raw-fetch-_n0lMAnD.mjs → raw-fetch-bIXC9D1m.mjs} +1 -1
- package/dist/realtime-kit-4bCGviO5.mjs +18 -0
- package/dist/{registrar-CDIwTz3G.mjs → registrar-CfHlaOOf.mjs} +6 -6
- package/dist/request-tracers-DlHawg5l.mjs +2 -0
- package/dist/resource-sharing-7FhuboJE.mjs +5 -0
- package/dist/resource-tagging-divcugVb.mjs +16 -0
- package/dist/rules-CAXkege8.mjs +4 -0
- package/dist/rulesets-CBsdc8IV.mjs +8 -0
- package/dist/rum-D0hHPNl9.mjs +4 -0
- package/dist/{schema-BR31o4P6.mjs → schema-D8o6HcCr.mjs} +1 -1
- package/dist/schema-validation-BWNDnnIT.mjs +24 -0
- package/dist/scim-CWLli4fi.mjs +3 -0
- package/dist/{secrets-store-BAK9G12O.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
- package/dist/security-center-BQT21oiM.mjs +2 -0
- package/dist/security-txt-CVpmJo29.mjs +3 -0
- package/dist/{session-DHYCE-PM.mjs → session-B8r8LNQN.mjs} +1 -1
- package/dist/{build-HuS9-R0V.mjs → shared-DQI8NGja.mjs} +324 -388
- package/dist/smart-shield-BreBC1Ap.mjs +3 -0
- package/dist/snippets-BAJoWMSJ.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-pmGERpdB.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-DnIRLY95.mjs} +6 -6
- package/dist/speed-UYEVue28.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-BQ1dr9xR.mjs} +4 -4
- package/dist/ssl-D3Pixs8M.mjs +15 -0
- package/dist/stream-BUsuOfQh.mjs +14 -0
- package/dist/{tenants-HLGUazms.mjs → tenants-BdWJTtcg.mjs} +1 -1
- package/dist/token-validation-DUvtXWur.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-CQtA5-cr.mjs} +1 -1
- package/dist/turnstile-CAKVnS1L.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BrNwNHX9.mjs} +1 -1
- package/dist/url-normalization-DA-RAxs4.mjs +3 -0
- package/dist/url-scanner-DmYu43f7.mjs +2 -0
- package/dist/user-Bah4wGGN.mjs +10 -0
- package/dist/vectorize-DhvVG2By.mjs +4 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-NUXxCr0s.mjs} +1 -1
- package/dist/{waiting-rooms-u6KwrzWd.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
- package/dist/web3-n3GW50u-.mjs +4 -0
- package/dist/workers-D6IaQ_F0.mjs +18 -0
- package/dist/workers-builds-DYi0OMMU.mjs +7 -0
- package/dist/workflows-DrdXUQ2g.mjs +4 -0
- package/dist/zaraz-9l7KuLqh.mjs +2 -0
- package/dist/zero-trust-D6V9GH2W.mjs +118 -0
- package/dist/zero_trust-BzXKAX_x.mjs +3 -0
- package/dist/{zones-BXtdwt6E.mjs → zones-0MTkuaFk.mjs} +8 -8
- package/package.json +3 -1
- package/dist/accounts-B_joQcMi.mjs +0 -22
- package/dist/acm-_kIHqYME.mjs +0 -3
- package/dist/addressing-CaFlw8y1.mjs +0 -12
- package/dist/ai-CqnhNb_c.mjs +0 -2
- package/dist/ai-gateway-pgYGI519.mjs +0 -8
- package/dist/ai-search-eqQMPQol.mjs +0 -7
- package/dist/ai_gateway--vuVLnOm.mjs +0 -4
- package/dist/alerting-CPxHiYHb.mjs +0 -6
- package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
- package/dist/api-gateway-BXXGFCVR.mjs +0 -33
- package/dist/argo-aC6A3JyX.mjs +0 -2
- package/dist/artifacts-HD4V2xpK.mjs +0 -4
- package/dist/billing-COaghyxl.mjs +0 -2
- package/dist/bot-management-DmEzeV1Y.mjs +0 -5
- package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
- package/dist/brand-protection-dPrGe8sL.mjs +0 -3
- package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/connectivity-Bx3MgTHX.mjs +0 -3
- package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
- package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
- package/dist/connectors-DRt4e6d_.mjs +0 -3
- package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-nameservers-CWqA51in.mjs +0 -3
- package/dist/custom-pages-DeUKEFGe.mjs +0 -4
- package/dist/d1-DvWY9Gp4.mjs +0 -4
- package/dist/data-security-BPo6dIWu.mjs +0 -6
- package/dist/diagnostics-6nKPmVgz.mjs +0 -3
- package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
- package/dist/dist-t_YrL25p.mjs +0 -82
- package/dist/dns-ClciFGxx.mjs +0 -29
- package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
- package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
- package/dist/email-routing-CGXhFqF5.mjs +0 -10
- package/dist/email-security-D5viPq8S.mjs +0 -8
- package/dist/email-sending-C2jpc3gh.mjs +0 -3
- package/dist/filters-bzsFcWt0.mjs +0 -4
- package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
- package/dist/healthchecks-DRoAlWgr.mjs +0 -4
- package/dist/hostnames-CFgIVI3s.mjs +0 -3
- package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
- package/dist/iam-DqVPzGrb.mjs +0 -6
- package/dist/images-BYfl4YgR.mjs +0 -7
- package/dist/intel-duTEPIHc.mjs +0 -3
- package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
- package/dist/kv-CZoV4tiv.mjs +0 -5
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
- package/dist/load-balancers--OMg0HNt.mjs +0 -6
- package/dist/logpush-C0_lZTyY.mjs +0 -4
- package/dist/logs-BtpWZQfV.mjs +0 -3
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
- package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
- package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
- package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
- package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
- package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
- package/dist/oauth-Bk-F-tIO.mjs +0 -52
- package/dist/observability-BynRbTF4.mjs +0 -4
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
- package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
- package/dist/pages-D4aYteKk.mjs +0 -11
- package/dist/pipelines-G8Iusxq-.mjs +0 -6
- package/dist/queues-DEkbKqZX.mjs +0 -6
- package/dist/r2-CV0IkCAW.mjs +0 -21
- package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/request-tracers-D7SFMDik.mjs +0 -2
- package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
- package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
- package/dist/rules-DHjLP5Kx.mjs +0 -4
- package/dist/rulesets-q4QABpKs.mjs +0 -8
- package/dist/rum-SmT4HZmM.mjs +0 -4
- package/dist/schema-validation-vVetgC_P.mjs +0 -24
- package/dist/scim-ChOkZpNx.mjs +0 -3
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/shared-BAjo72Lz.mjs +0 -2
- package/dist/smart-shield-CWlSsNi8.mjs +0 -3
- package/dist/snippets-DrlgYJYp.mjs +0 -4
- package/dist/speed-ZFrMWDgd.mjs +0 -4
- package/dist/ssl-9JY05sYt.mjs +0 -15
- package/dist/stream-tRU39b8K.mjs +0 -14
- package/dist/token-validation-_VdamKpz.mjs +0 -10
- package/dist/turnstile-BRzXd28B.mjs +0 -23
- package/dist/url-normalization-D-NxuLtN.mjs +0 -3
- package/dist/url-scanner-BzzR6iDx.mjs +0 -2
- package/dist/user-C4omq__w.mjs +0 -10
- package/dist/vectorize-By6EqcNR.mjs +0 -4
- package/dist/web3-DQ5dmE9W.mjs +0 -4
- package/dist/workers-D8Be7_as.mjs +0 -18
- package/dist/workers-builds-BE3W3qNk.mjs +0 -7
- package/dist/workflows-BWWufqFA.mjs +0 -4
- package/dist/zaraz-Bsa9AvVL.mjs +0 -2
- package/dist/zero-trust-UNVZFnKu.mjs +0 -118
- package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-DGgEbf8K.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-MPDDi08e.mjs} +0 -0
- /package/dist/{resolve-C3h-mwp7.mjs → resolve-DGD57PFH.mjs} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{r as c,t as l}from"./prompt-q3B7sM2A.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:u,handler:async n=>{if(n.dryRun){a({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Creating`,async()=>r.smartShield.cacheReserveClear.clear({zone_id:s})),{successLabel:`Created`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:f,handler:async n=>{if(n.dryRun){a({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.smartShield.cacheReserveClear.status({zone_id:s})),{successLabel:`Loaded`})}},m={command:`cache-reserve-clear`,describe:`Cache Reserve Clear operations`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve Smart Shield Settings.`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.smartShield.get({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`,default:!1}).option(`http-config-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.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`,default:!1}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`],default:`GET`}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`,default:`/`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`,default:80}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).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(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`],default:`connection_established`}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`,default:80}).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' and 'TCP'.`,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 v={command:`create`,describe:`Create a new health check.`,builder:_,handler:async l=>{if(l.dryRun){a({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Creating`,async()=>u.smartShield.healthChecks.create({body:e,zone_id:d})),{successLabel:`Created`});return}l.address===void 0&&(l.address=await c(`address`,`The hostname or IP address of the origin server to run health checks on.`)),l.name===void 0&&(l.name=await c(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=r({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)});i(await o(`Creating`,async()=>u.smartShield.healthChecks.create({body:f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <healthcheck-id>`,describe:`Delete a health check.`,builder:y,handler:async n=>{if(n.dryRun){a({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield/healthchecks/${n[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(n[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(n[`healthcheck-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=s,!await l({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>r.smartShield.healthChecks.delete({zone_id:s,healthcheck_id:n[`healthcheck-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-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.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit <healthcheck-id>`,describe:`Patch a configured health check.`,builder:x,handler:async l=>{if(l.dryRun){a({command:`cf smart-shield health-checks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/smart_shield/healthchecks/${l[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(l[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(l[`healthcheck-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Updating`,async()=>u.smartShield.healthChecks.edit({body:e,zone_id:d,healthcheck_id:l[`healthcheck-id`]})),{successLabel:`Updated`});return}l.address===void 0&&(l.address=await c(`address`,`The hostname or IP address of the origin server to run health checks on.`)),l.name===void 0&&(l.name=await c(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=r({address:s(l.address,`address`,`text`),check_regions:l[`check-regions`],consecutive_fails:l[`consecutive-fails`],consecutive_successes:l[`consecutive-successes`],description:s(l.description,`description`,`text`),http_config:{allow_insecure:l[`http-config-allow-insecure`],expected_body:s(l[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:l[`http-config-expected-codes`],follow_redirects:l[`http-config-follow-redirects`],method:s(l[`http-config-method`],`http-config-method`,`text`),path:s(l[`http-config-path`],`http-config-path`,`text`),port:l[`http-config-port`]},interval:l.interval,name:s(l.name,`name`,`text`),retries:l.retries,suspended:l.suspended,tcp_config:{method:s(l[`tcp-config-method`],`tcp-config-method`,`text`),port:l[`tcp-config-port`]},timeout:l.timeout,type:s(l.type,`type`,`text`)});i(await o(`Updating`,async()=>u.smartShield.healthChecks.edit({body:f,zone_id:d,healthcheck_id:l[`healthcheck-id`]})),{successLabel:`Updated`})}};function C(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <healthcheck-id>`,describe:`Fetch a single configured health check.`,builder:C,handler:async n=>{if(n.dryRun){a({command:`cf smart-shield health-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield/healthchecks/${n[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(n[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(n[`healthcheck-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.smartShield.healthChecks.get({zone_id:s,healthcheck_id:n[`healthcheck-id`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List configured health checks.`,builder:T,handler:async n=>{let r={page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf smart-shield health-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.smartShield.healthChecks.list({zone_id:c,...r})),{successLabel:`Loaded`})}};function D(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`result-address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`result-check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`result-consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`result-consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`result-description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`result-http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`result-http-config-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.`}).option(`result-http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`result-http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`result-http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`result-http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`result-http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`result-interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`result-name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`result-retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`result-suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`result-tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`result-tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`result-timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`result-type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).option(`success`,{type:`boolean`,description:`Whether the API call was successful.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <healthcheck-id>`,describe:`Update a configured health check.`,builder:D,handler:async c=>{if(c.dryRun){a({command:`cf smart-shield health-checks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/smart_shield/healthchecks/${c[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(c[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(c[`healthcheck-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({result:{address:s(c[`result-address`],`result-address`,`text`),check_regions:c[`result-check-regions`],consecutive_fails:c[`result-consecutive-fails`],consecutive_successes:c[`result-consecutive-successes`],description:s(c[`result-description`],`result-description`,`text`),http_config:{allow_insecure:c[`result-http-config-allow-insecure`],expected_body:s(c[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:c[`result-http-config-expected-codes`],follow_redirects:c[`result-http-config-follow-redirects`],method:s(c[`result-http-config-method`],`result-http-config-method`,`text`),path:s(c[`result-http-config-path`],`result-http-config-path`,`text`),port:c[`result-http-config-port`]},interval:c[`result-interval`],name:s(c[`result-name`],`result-name`,`text`),retries:c[`result-retries`],suspended:c[`result-suspended`],tcp_config:{method:s(c[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:c[`result-tcp-config-port`]},timeout:c[`result-timeout`],type:s(c[`result-type`],`result-type`,`text`)},success:c.success}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Updating`,async()=>l.smartShield.healthChecks.update({...e,zone_id:u,healthcheck_id:c[`healthcheck-id`]})),{successLabel:`Updated`});return}if(c.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);let d=r({result:{address:s(c[`result-address`],`result-address`,`text`),check_regions:c[`result-check-regions`],consecutive_fails:c[`result-consecutive-fails`],consecutive_successes:c[`result-consecutive-successes`],description:s(c[`result-description`],`result-description`,`text`),http_config:{allow_insecure:c[`result-http-config-allow-insecure`],expected_body:s(c[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:c[`result-http-config-expected-codes`],follow_redirects:c[`result-http-config-follow-redirects`],method:s(c[`result-http-config-method`],`result-http-config-method`,`text`),path:s(c[`result-http-config-path`],`result-http-config-path`,`text`),port:c[`result-http-config-port`]},interval:c[`result-interval`],name:s(c[`result-name`],`result-name`,`text`),retries:c[`result-retries`],suspended:c[`result-suspended`],tcp_config:{method:s(c[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:c[`result-tcp-config-port`]},timeout:c[`result-timeout`],type:s(c[`result-type`],`result-type`,`text`)},success:c.success});i(await o(`Updating`,async()=>l.smartShield.healthChecks.update({...d,zone_id:u,healthcheck_id:c[`healthcheck-id`]})),{successLabel:`Updated`})}},k={command:`health-checks`,describe:`Health checks operations`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`cache-reserve-value`,{type:`string`,description:`Specifies the enablement value of Cache Reserve.`,choices:[`on`,`off`]}).option(`regional-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Regional Tiered Cache.`,choices:[`on`,`off`]}).option(`smart-routing-value`,{type:`string`,description:`Specifies the enablement value of Smart Routing.`,choices:[`on`,`off`]}).option(`smart-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The patch body for Smart Shield.`})}const j={command:`update`,describe:`Set Smart Shield Settings.`,builder:A,handler:async c=>{if(c.dryRun){a({command:`cf smart-shield update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({cache_reserve:{value:s(c[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:s(c[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:s(c[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:s(c[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Updating`,async()=>l.smartShield.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=r({cache_reserve:{value:s(c[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:s(c[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:s(c[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:s(c[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}});i(await o(`Updating`,async()=>l.smartShield.update({...d,zone_id:u})),{successLabel:`Updated`})}},M={command:`smart-shield`,describe:`Smart Shield settings, health checks, and cache reserve management`,builder:e=>e.command(g).command(j).command(m).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{M as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{N as e}from"./oauth-B5k80sip.mjs";import{i as t,n}from"./auth-DX9KnJ0P.mjs";import{n as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s,t as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./prompt-q3B7sM2A.mjs";import{n as u,t as d}from"./raw-fetch-bIXC9D1m.mjs";function f(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const p={command:`get <snippet-name>`,describe:`Fetches the content of a snippet belonging to the zone.`,builder:f,handler:async t=>{if(t.dryRun){a({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}/content`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let r=await n(t);t.zoneId=await e({zone:t.zone},r,{quiet:t.quiet});let i=await o(`Loading`,async()=>d(`/zones/${t.zoneId}/snippets/${encodeURIComponent(String(t[`snippet-name`]))}/content`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));u(t.text===!0?i.toString(`utf-8`):i)}},m={command:`content`,describe:`Raw JavaScript source code content of individual snippets`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <snippet-name>`,describe:`Deletes a snippet belonging to the zone.`,builder:h,handler:async t=>{if(t.dryRun){a({command:`cf snippets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let r=await n(t),s=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=s,!await l({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>r.snippets.delete({zone_id:s,snippet_name:t[`snippet-name`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <snippet-name>`,describe:`Fetches a snippet belonging to the zone.`,builder:_,handler:async t=>{if(t.dryRun){a({command:`cf snippets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/${t[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(t[`snippet-name`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"snippet-name":String(t[`snippet-name`]??``)},bodyKind:`none`});return}let r=await n(t),s=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>r.snippets.get({zone_id:s,snippet_name:t[`snippet-name`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Specifies the current page number.`}).option(`per-page`,{type:`number`,description:`Specifies how many results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches all snippets belonging to the zone.`,builder:y,handler:async t=>{let r={page:t.page,per_page:t[`per-page`]};if(t.dryRun){a({command:`cf snippets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,i(await o(`Loading`,async()=>s.snippets.list({zone_id:c,...r})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete`,describe:`Deletes all snippet rules belonging to the zone.`,builder:x,handler:async t=>{if(t.dryRun){a({command:`cf snippets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),s=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=s,!await l({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}i(await o(`Deleting`,async()=>r.snippets.rules.delete({zone_id:s})),{successLabel:`Deleted`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Fetches all snippet rules belonging to the zone.`,builder:C,handler:async t=>{if(t.dryRun){a({command:`cf snippets rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),s=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>r.snippets.rules.list({zone_id:s})),{successLabel:`Loaded`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet rules object.`})}const E={command:`update`,describe:`Updates all snippet rules belonging to the zone.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf snippets rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/snippets/snippet_rules`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:r(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=r(s.body);i(await o(`Updating`,async()=>c.snippets.rules.update({...e,zone_id:l})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/snippets/snippet_rules`)),{successLabel:`Updated`})}},D={command:`rules`,describe:`Rules that determine which requests trigger specific snippets based on URL patterns`,builder:e=>e.command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet object.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`Provide metadata about the snippet.`})}const k={command:`update <snippet-name>`,describe:`Creates or updates a snippet belonging to the zone.`,builder:O,handler:async r=>{if(r.dryRun){a({command:`cf snippets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/snippets/${r[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(r[`snippet-name`]))}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"snippet-name":String(r[`snippet-name`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,metadata:r.metadata}});return}let l=await n(r);if(r.zoneId=await e({zone:r.zone},l,{quiet:r.quiet}),r.file!==void 0||r.body!==void 0||r.metadata!==void 0){let e=new FormData;if(r.file){let t=c(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.metadata!==void 0){let t=typeof r.metadata==`string`?s(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}i(await o(`Updating`,async()=>t(l,`PUT`,`/zones/${r.zoneId}/snippets/${encodeURIComponent(String(r[`snippet-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(r.body){let e=s(r.body,`body`,`binary`);i(await o(`Updating`,async()=>t(l,`PUT`,`/zones/${r.zoneId}/snippets/${encodeURIComponent(String(r[`snippet-name`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},A={command:`snippets`,describe:`Lightweight JavaScript snippets that run on requests before Workers — for quick header modifications and redirects`,builder:e=>e.command(g).command(v).command(b).command(k).command(m).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./src-
|
|
2
|
+
import{t as e}from"./src-BQ1dr9xR.mjs";import{a as t}from"./theme-DbNbIY4d.mjs";import"./ui-BrNwNHX9.mjs";import{existsSync as n,readFileSync as r}from"node:fs";import{homedir as i}from"node:os";import{join as a}from"node:path";import{execFileSync as o,spawn as s}from"node:child_process";function c(e){return t=>{if(!t.pkgRoot)return null;let r=a(t.pkgRoot,`bin`,e);return n(r)?r:null}}function l(){let e=a(process.env.CARGO_HOME??a(i(),`.cargo`),`bin`,`cloudflare-rs-dev-server`);return n(e)?e:null}const u=[{ecosystem:`npm`,pkg:`@cloudflare/vite-plugin`,minimumVersion:`1.42.0`,description:`Vite-based dev server (recommended for JavaScript/TypeScript)`,manifest:`package.json`,binary:c(`cf-vite`),installHint:`npm install --save-dev @cloudflare/vite-plugin@latest`},{ecosystem:`npm`,pkg:`wrangler`,fallback:!0,minimumVersion:`4.102.0`,description:`Wrangler-based dev server (legacy Worker projects)`,manifest:`package.json`,binary:c(`cf-wrangler.js`),installHint:`npm install --save-dev wrangler@latest`},{ecosystem:`pypi`,pkg:`cloudflare-py-dev-server`,description:`Python dev server (Pyodide via workerd)`,manifest:`pyproject.toml`,binary:()=>null,installHint:`pip install cloudflare-py-dev-server (or: uv add --dev cloudflare-py-dev-server)`},{ecosystem:`cargo`,pkg:`cloudflare-rs-dev-server`,description:`Rust dev server (wasm-bindgen + workerd)`,manifest:`Cargo.toml`,binary:l,installHint:`cargo install cloudflare-rs-dev-server`}];function d(e){return u.find(t=>t.pkg===e)}function f(e){let t=[];t.push(...p(e)),t.push(...g(e)),t.push(...b(e));let n=t.filter(e=>!e.impl.fallback);return n.length>0?n:t}function p(e){let t=a(e,`package.json`);if(!n(t))return[];let i;try{let e=r(t,`utf-8`);i=JSON.parse(e)}catch{return[]}let o=m(i),s=[];for(let n of o){let r=d(n);if(!r||r.ecosystem!==`npm`)continue;let i=h(e,n),a=i?r.binary({cwd:e,pkgRoot:i}):null;s.push({impl:r,binary:a,installed:!!i,manifestPath:t})}return s}function m(e){let t=new Set;for(let n of[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`]){let r=e[n];if(r&&typeof r==`object`)for(let e of Object.keys(r))t.add(e)}return t}function h(e,t){if(n(a(e,`node_modules`,t,`package.json`)))return a(e,`node_modules`,t)}function g(e){let t=a(e,`pyproject.toml`);if(!n(t))return[];let i;try{i=r(t,`utf-8`)}catch{return[]}let o=[];for(let n of _()){if(!v(i,n.pkg))continue;let r=y(e,n.pkg);o.push({impl:n,binary:r,manifestPath:t})}return o}function _(){let e=[],t=new Set;for(let n of S())n.ecosystem===`pypi`&&!t.has(n.pkg)&&(e.push(n),t.add(n.pkg));return e}function v(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`["']${n}(?=[\\s\\[<>=!~"';])`,`m`).test(e)}function y(e,t){if(n(a(e,`uv.lock`)))return`uv:${t}`;try{let r=o(`python3`,[`-c`,`import shutil, sys; p = shutil.which(${JSON.stringify(t)}); sys.stdout.write(p or "")`],{cwd:e,stdio:[`ignore`,`pipe`,`ignore`],encoding:`utf-8`}).trim();if(r&&n(r))return r}catch{}return null}function b(e){let t=a(e,`Cargo.toml`);if(!n(t))return[];let i;try{i=r(t,`utf-8`)}catch{return[]}let o=[];for(let n of S()){if(n.ecosystem!==`cargo`||!x(i,n.pkg))continue;let r=n.binary({cwd:e});o.push({impl:n,binary:r,manifestPath:t})}return o}function x(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^\\s*${n}\\s*=)|(^\\s*\\[[^\\]]*\\.${n}\\s*\\])`,`m`).test(e)}function S(){return u}function C(t){let n=f(t);if(n.length===0)throw w(t),new e(1);if(n.length>1)throw T(n),new e(1);let[r]=n;if(!r)throw new e(1);if(!r.binary)throw E(r),new e(1);return r}function w(e){console.error(`
|
|
3
3
|
No Cloudflare dev-server is installed in this project.
|
|
4
4
|
|
|
5
5
|
A project must declare exactly one of the following in its manifest:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{r as c,t as l}from"./prompt-q3B7sM2A.mjs";import{t as u}from"./cli-types-DGgEbf8K.mjs";function d(e){return e.option(`app-id`,{type:`string`,description:`Comma-delimited list of Spectrum Application Id(s). If provided, the response will be limited to Spectrum Application Id(s) that match.`}).option(`colo-name`,{type:`string`,description:`Co-location identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves analytics aggregated from the last minute of usage on Spectrum applications underneath a given zone.`,builder:d,handler:async n=>{let r={appID:n[`app-id`],colo_name:n[`colo-name`]};if(n.dryRun){a({command:`cf spectrum analytics aggregates currents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/analytics/aggregate/current`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.spectrum.analytics.aggregates.currents.get({zone_id:c,...r})),{successLabel:`Loaded`})}},p={command:`currents`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`aggregates`,describe:`Operations for analytics.aggregates`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dimensions`,{type:`string`,description:`Can be used to break down the data by given attributes. Options are:
|
|
3
3
|
|
|
4
4
|
Dimension | Name | Example
|
|
5
5
|
--------------------------|---------------------------------|--------------------------
|
|
@@ -27,7 +27,7 @@ Operator | Name | URL Encoded
|
|
|
27
27
|
\\>= | Greater than or equal to | %3E%3D
|
|
28
28
|
\\<= | Less than or equal to | %3C%3D
|
|
29
29
|
|
|
30
|
-
Use the above to construct filters.`}).option(`since`,{type:`string`,description:"Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified."}).option(`time-delta`,{type:`string`,description:`Used to select time series resolution.`,choices:[`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieves a list of aggregate metrics grouped by time interval.`,builder:u(h),handler:async
|
|
30
|
+
Use the above to construct filters.`}).option(`since`,{type:`string`,description:"Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified."}).option(`time-delta`,{type:`string`,description:`Used to select time series resolution.`,choices:[`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieves a list of aggregate metrics grouped by time interval.`,builder:u(h),handler:async n=>{let r={dimensions:n.dimensions,sort:n.sort,until:n.until,metrics:n.metrics,filters:n.filters,since:n.since,time_delta:n[`time-delta`]};if(n.dryRun){a({command:`cf spectrum analytics events bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/analytics/events/bytime`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.spectrum.analytics.events.bytimes.get({zone_id:c,...r})),{successLabel:`Loaded`})}},_={command:`bytimes`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`dimensions`,{type:`string`,description:`Can be used to break down the data by given attributes. Options are:
|
|
31
31
|
|
|
32
32
|
Dimension | Name | Example
|
|
33
33
|
--------------------------|---------------------------------|--------------------------
|
|
@@ -55,9 +55,9 @@ Operator | Name | URL Encoded
|
|
|
55
55
|
\\>= | Greater than or equal to | %3E%3D
|
|
56
56
|
\\<= | Less than or equal to | %3C%3D
|
|
57
57
|
|
|
58
|
-
Use the above to construct filters.`}).option(`since`,{type:`string`,description:"Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get`,describe:`Retrieves a list of summarised aggregate metrics over a given time period.`,builder:u(v),handler:async
|
|
58
|
+
Use the above to construct filters.`}).option(`since`,{type:`string`,description:"Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get`,describe:`Retrieves a list of summarised aggregate metrics over a given time period.`,builder:u(v),handler:async n=>{let r={dimensions:n.dimensions,sort:n.sort,until:n.until,metrics:n.metrics,filters:n.filters,since:n.since};if(n.dryRun){a({command:`cf spectrum analytics events summaries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/analytics/events/summary`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.spectrum.analytics.events.summaries.get({zone_id:c,...r})),{successLabel:`Loaded`})}},b={command:`summaries`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`events`,describe:`Operations for analytics.events`,builder:e=>e.command(_).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(m).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`argo-smart-routing`,{type:`boolean`,description:`Enables Argo Smart Routing for this application.
|
|
59
59
|
Notes: Only available for TCP or UDP applications with traffic_type set to "direct".`,default:!1}).option(`dns-name`,{type:`string`,description:`The name of the DNS record associated with the application.`}).option(`dns-type`,{type:`string`,description:`The type of DNS record associated with the application.`,choices:[`CNAME`,`ADDRESS`]}).option(`edge-ips-connectivity`,{type:`string`,description:`The IP versions supported for inbound connections on Spectrum anycast IPs.`,choices:[`all`,`ipv4`,`ipv6`]}).option(`edge-ips-type`,{type:`string`,description:`The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.`,choices:[`dynamic`,`static`]}).option(`edge-ips-ips`,{type:`string`,array:!0,description:`The array of customer owned IPs we broadcast via anycast for this hostname and application.`}).option(`ip-firewall`,{type:`boolean`,description:`Enables IP Access Rules for this application.
|
|
60
|
-
Notes: Only available for TCP applications.`,default:!1}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`],default:`off`}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`],default:`off`}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`],default:`direct`}).option(`virtual-network-id`,{type:`string`,description:`Optional UUID of a virtual network for routing origin traffic through tunnel virtual networks.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const w={command:`create`,describe:`Creates a new Spectrum application from a configuration using a name for the origin.`,builder:C,handler:async
|
|
61
|
-
`);return}
|
|
60
|
+
Notes: Only available for TCP applications.`,default:!1}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`],default:`off`}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`],default:`off`}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`],default:`direct`}).option(`virtual-network-id`,{type:`string`,description:`Optional UUID of a virtual network for routing origin traffic through tunnel virtual networks.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const w={command:`create`,describe:`Creates a new Spectrum application from a configuration using a name for the origin.`,builder:C,handler:async l=>{if(l.dryRun){a({command:`cf spectrum apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/spectrum/apps`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({argo_smart_routing:l[`argo-smart-routing`],dns:{name:s(l[`dns-name`],`dns-name`,`text`),type:s(l[`dns-type`],`dns-type`,`text`)},edge_ips:{connectivity:s(l[`edge-ips-connectivity`],`edge-ips-connectivity`,`text`),type:s(l[`edge-ips-type`],`edge-ips-type`,`text`),ips:l[`edge-ips-ips`]},ip_firewall:l[`ip-firewall`],origin_direct:l[`origin-direct`],origin_dns:{name:s(l[`origin-dns-name`],`origin-dns-name`,`text`),ttl:l[`origin-dns-ttl`],type:s(l[`origin-dns-type`],`origin-dns-type`,`text`)},protocol:s(l.protocol,`protocol`,`text`),proxy_protocol:s(l[`proxy-protocol`],`proxy-protocol`,`text`),tls:s(l.tls,`tls`,`text`),traffic_type:s(l[`traffic-type`],`traffic-type`,`text`),virtual_network_id:s(l[`virtual-network-id`],`virtual-network-id`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Creating`,async()=>u.spectrum.apps.create({body:e,zone_id:d})),{successLabel:`Created`});return}l.protocol===void 0&&(l.protocol=await c(`protocol`,'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'));let f=r({argo_smart_routing:l[`argo-smart-routing`],dns:{name:s(l[`dns-name`],`dns-name`,`text`),type:s(l[`dns-type`],`dns-type`,`text`)},edge_ips:{connectivity:s(l[`edge-ips-connectivity`],`edge-ips-connectivity`,`text`),type:s(l[`edge-ips-type`],`edge-ips-type`,`text`),ips:l[`edge-ips-ips`]},ip_firewall:l[`ip-firewall`],origin_direct:l[`origin-direct`],origin_dns:{name:s(l[`origin-dns-name`],`origin-dns-name`,`text`),ttl:l[`origin-dns-ttl`],type:s(l[`origin-dns-type`],`origin-dns-type`,`text`)},protocol:s(l.protocol,`protocol`,`text`),proxy_protocol:s(l[`proxy-protocol`],`proxy-protocol`,`text`),tls:s(l.tls,`tls`,`text`),traffic_type:s(l[`traffic-type`],`traffic-type`,`text`),virtual_network_id:s(l[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Creating`,async()=>u.spectrum.apps.create({body:f,zone_id:d})),{successLabel:`Created`})}};function T(e){return e.positional(`app-id`,{type:`string`,description:`Identifier.`,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 E={command:`delete <app-id>`,describe:`Deletes a previously existing application.`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf spectrum apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/apps/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}`,pathParams:{"app-id":String(n[`app-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=s,!await l({force:!!n.force})){process.stderr.write(`Aborted.
|
|
61
|
+
`);return}i(await o(`Deleting`,async()=>r.spectrum.apps.delete({zone_id:s,app_id:n[`app-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`app-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <app-id>`,describe:`Gets the application configuration of a specific application inside a zone.`,builder:D,handler:async n=>{if(n.dryRun){a({command:`cf spectrum apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/apps/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}`,pathParams:{"app-id":String(n[`app-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.spectrum.apps.get({zone_id:s,app_id:n[`app-id`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`page`,{type:`number`,description:"Page number of paginated results. This parameter is required in order to use other pagination parameters. If included in the query, `result_info` will be present in the response."}).option(`per-page`,{type:`number`,description:`Sets the maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sets the direction by which results are ordered.`,choices:[`asc`,`desc`]}).option(`order`,{type:`string`,description:`Application field by which results are ordered.`,choices:[`protocol`,`app_id`,`created_on`,`modified_on`,`dns`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Retrieves a list of currently existing Spectrum applications inside a zone.`,builder:u(k),handler:async n=>{let r={page:n.page,per_page:n[`per-page`],direction:n.direction,order:n.order};if(n.dryRun){a({command:`cf spectrum apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/spectrum/apps`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.spectrum.apps.list({zone_id:c,...r})),{successLabel:`Loaded`})}};function j(e){return e.positional(`app-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`argo-smart-routing`,{type:`boolean`,description:`Enables Argo Smart Routing for this application.
|
|
62
62
|
Notes: Only available for TCP or UDP applications with traffic_type set to "direct".`}).option(`dns-name`,{type:`string`,description:`The name of the DNS record associated with the application.`}).option(`dns-type`,{type:`string`,description:`The type of DNS record associated with the application.`,choices:[`CNAME`,`ADDRESS`]}).option(`edge-ips-connectivity`,{type:`string`,description:`The IP versions supported for inbound connections on Spectrum anycast IPs.`,choices:[`all`,`ipv4`,`ipv6`]}).option(`edge-ips-type`,{type:`string`,description:`The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.`,choices:[`dynamic`,`static`]}).option(`edge-ips-ips`,{type:`string`,array:!0,description:`The array of customer owned IPs we broadcast via anycast for this hostname and application.`}).option(`ip-firewall`,{type:`boolean`,description:`Enables IP Access Rules for this application.
|
|
63
|
-
Notes: Only available for TCP applications.`}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`]}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`]}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`]}).option(`virtual-network-id`,{type:`string`,description:`Optional UUID of a virtual network for routing origin traffic through tunnel virtual networks.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const M={command:`update <app-id>`,describe:`Updates a previously existing application's configuration that uses a name for the origin.`,builder:j,handler:async
|
|
63
|
+
Notes: Only available for TCP applications.`}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`]}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`]}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`]}).option(`virtual-network-id`,{type:`string`,description:`Optional UUID of a virtual network for routing origin traffic through tunnel virtual networks.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const M={command:`update <app-id>`,describe:`Updates a previously existing application's configuration that uses a name for the origin.`,builder:j,handler:async l=>{if(l.dryRun){a({command:`cf spectrum apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/spectrum/apps/${l[`app-id`]==null?`<app-id>`:encodeURIComponent(String(l[`app-id`]))}`,pathParams:{"app-id":String(l[`app-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({argo_smart_routing:l[`argo-smart-routing`],dns:{name:s(l[`dns-name`],`dns-name`,`text`),type:s(l[`dns-type`],`dns-type`,`text`)},edge_ips:{connectivity:s(l[`edge-ips-connectivity`],`edge-ips-connectivity`,`text`),type:s(l[`edge-ips-type`],`edge-ips-type`,`text`),ips:l[`edge-ips-ips`]},ip_firewall:l[`ip-firewall`],origin_direct:l[`origin-direct`],origin_dns:{name:s(l[`origin-dns-name`],`origin-dns-name`,`text`),ttl:l[`origin-dns-ttl`],type:s(l[`origin-dns-type`],`origin-dns-type`,`text`)},protocol:s(l.protocol,`protocol`,`text`),proxy_protocol:s(l[`proxy-protocol`],`proxy-protocol`,`text`),tls:s(l.tls,`tls`,`text`),traffic_type:s(l[`traffic-type`],`traffic-type`,`text`),virtual_network_id:s(l[`virtual-network-id`],`virtual-network-id`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Updating`,async()=>u.spectrum.apps.update({body:e,zone_id:d,app_id:l[`app-id`]})),{successLabel:`Updated`});return}l.protocol===void 0&&(l.protocol=await c(`protocol`,'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'));let f=r({argo_smart_routing:l[`argo-smart-routing`],dns:{name:s(l[`dns-name`],`dns-name`,`text`),type:s(l[`dns-type`],`dns-type`,`text`)},edge_ips:{connectivity:s(l[`edge-ips-connectivity`],`edge-ips-connectivity`,`text`),type:s(l[`edge-ips-type`],`edge-ips-type`,`text`),ips:l[`edge-ips-ips`]},ip_firewall:l[`ip-firewall`],origin_direct:l[`origin-direct`],origin_dns:{name:s(l[`origin-dns-name`],`origin-dns-name`,`text`),ttl:l[`origin-dns-ttl`],type:s(l[`origin-dns-type`],`origin-dns-type`,`text`)},protocol:s(l.protocol,`protocol`,`text`),proxy_protocol:s(l[`proxy-protocol`],`proxy-protocol`,`text`),tls:s(l.tls,`tls`,`text`),traffic_type:s(l[`traffic-type`],`traffic-type`,`text`),virtual_network_id:s(l[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Updating`,async()=>u.spectrum.apps.update({body:f,zone_id:d,app_id:l[`app-id`]})),{successLabel:`Updated`})}},N={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`spectrum`,describe:`Proxy and protect arbitrary TCP/UDP applications through Cloudflare's network with DDoS mitigation`,builder:e=>e.command(S).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n}from"./body-parser-DWSy7uZ8.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{t as o}from"./prompt-q3B7sM2A.mjs";import{t as s}from"./cli-types-DGgEbf8K.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`list`,describe:`Retrieves quota for all plans, as well as the current zone quota.`,builder:c,handler:async n=>{if(n.dryRun){i({command:`cf speed availabilities list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/availabilities`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(n),s=await e({zone:n.zone},o,{quiet:n.quiet});n.zoneId=s,r(await a(`Loading`,async()=>o.speed.availabilities.list({zone_id:s})),{successLabel:`Loaded`})}},u={command:`availabilities`,describe:`Operations for availabilities`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists all webpages which have been tested.`,builder:d,handler:async n=>{if(n.dryRun){i({command:`cf speed pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/pages`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(n),s=await e({zone:n.zone},o,{quiet:n.quiet});n.zoneId=s,r(await a(`Loading`,async()=>o.speed.pages.list({zone_id:s})),{successLabel:`Loaded`})}};function p(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create <url>`,describe:`Starts a test for a specific webpage, in a specific region.`,builder:p,handler:async o=>{if(o.dryRun){i({command:`cf speed pages tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/speed_api/pages/${o.url==null?`<url>`:encodeURIComponent(String(o.url))}/tests`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),url:String(o.url??``)},bodyKind:`json`,body:o.body===void 0?void 0:n(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=n(o.body);r(await a(`Creating`,async()=>s.speed.pages.tests.create({...e,zone_id:c,url:o.url})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>s.speed.pages.tests.create({zone_id:c,url:o.url})),{successLabel:`Created`})}};function h(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <url>`,describe:`Deletes all tests for a specific webpage from a specific region. Deleted tests are still counted as part of the quota.`,builder:s(h),handler:async n=>{let s={region:n.region};if(n.dryRun){i({command:`cf speed pages tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/pages/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}/tests`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:s,bodyKind:`none`});return}let c=await t(n),l=await e({zone:n.zone},c,{quiet:n.quiet});if(n.zoneId=l,!await o({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>c.speed.pages.tests.delete({zone_id:l,url:n.url,...s})),{successLabel:`Deleted`})}};function _(e){return e.positional(`test-id`,{type:`string`,description:`Test ID`,demandOption:!0}).option(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <test-id>`,describe:`Retrieves the result of a specific test.`,builder:_,handler:async n=>{if(n.dryRun){i({command:`cf speed pages tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/pages/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}/tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``),"test-id":String(n[`test-id`]??``)},bodyKind:`none`});return}let o=await t(n),s=await e({zone:n.zone},o,{quiet:n.quiet});n.zoneId=s,r(await a(`Loading`,async()=>o.speed.pages.tests.get({zone_id:s,url:n.url,test_id:n[`test-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Test history (list of tests) for a specific webpage.`,builder:s(y),handler:async n=>{let o={page:n.page,per_page:n[`per-page`],region:n.region};if(n.dryRun){i({command:`cf speed pages tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/pages/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}/tests`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:o,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,r(await a(`Loading`,async()=>s.speed.pages.tests.list({zone_id:c,url:n.url,...o})),{successLabel:`Loaded`})}},x={command:`tests`,describe:`Operations for pages.tests`,builder:e=>e.command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`],demandOption:!0}).option(`device-type`,{type:`string`,description:`The type of device.`,choices:[`DESKTOP`,`MOBILE`],demandOption:!0}).option(`start`,{type:`string`,description:`Start`,demandOption:!0}).option(`end`,{type:`string`,description:`End`}).option(`tz`,{type:`string`,description:`The timezone of the start and end timestamps.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to include in the results.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`trend <url>`,describe:`Lists the core web vital metrics trend over time for a specific page.`,builder:s(S),handler:async n=>{let o={region:n.region,deviceType:n[`device-type`],start:n.start,end:n.end,tz:n.tz,metrics:n.metrics};if(n.dryRun){i({command:`cf speed pages trend`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/pages/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}/trend`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:o,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,r(await a(`Loading`,async()=>s.speed.pages.trend({zone_id:c,url:n.url,...o})),{successLabel:`Loaded`})}},w={command:`pages`,describe:`Operations for pages`,builder:e=>e.command(f).command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`]}).option(`frequency`,{type:`string`,description:`The frequency of the scheduled test. Defaults to WEEKLY for free plans, DAILY for paid plans.`,choices:[`DAILY`,`WEEKLY`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`create <url>`,describe:`Creates a scheduled test for a page.`,builder:s(T),handler:async n=>{let o={region:n.region,frequency:n.frequency};if(n.dryRun){i({command:`cf speed schedule create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/schedule/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:o,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,r(await a(`Creating`,async()=>s.speed.schedule.create({zone_id:c,url:n.url,...o})),{successLabel:`Created`})}};function D(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`]}).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 O={command:`delete <url>`,describe:`Deletes a scheduled test for a page.`,builder:s(D),handler:async n=>{let s={region:n.region};if(n.dryRun){i({command:`cf speed schedule delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/schedule/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:s,bodyKind:`none`});return}let c=await t(n),l=await e({zone:n.zone},c,{quiet:n.quiet});if(n.zoneId=l,!await o({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}r(await a(`Deleting`,async()=>c.speed.schedule.delete({zone_id:l,url:n.url,...s})),{successLabel:`Deleted`})}};function k(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <url>`,describe:`Retrieves the test schedule for a page in a specific region.`,builder:s(k),handler:async n=>{let o={region:n.region};if(n.dryRun){i({command:`cf speed schedule get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/speed_api/schedule/${n.url==null?`<url>`:encodeURIComponent(String(n.url))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),url:String(n.url??``)},query:o,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,r(await a(`Loading`,async()=>s.speed.schedule.get({zone_id:c,url:n.url,...o})),{successLabel:`Loaded`})}},j={command:`schedule`,describe:`Operations for schedule`,builder:e=>e.command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`speed`,describe:`speed`,builder:e=>e.command(u).command(w).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{M as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o as e,t}from"./chunk-DH-VkVmc.mjs";import{b as n,n as r,r as i,t as a,x as o,y as s}from"./session-
|
|
2
|
+
import{o as e,t}from"./chunk-DH-VkVmc.mjs";import{b as n,n as r,r as i,t as a,x as o,y as s}from"./session-B8r8LNQN.mjs";import{r as c}from"./sdk-DhIhH6GB.mjs";import{R as l}from"./dist-C6zxsVdY.mjs";import{a as u,n as d,t as f}from"./theme-DbNbIY4d.mjs";import{a as p,t as m}from"./ui-BrNwNHX9.mjs";import{createRequire as h}from"node:module";import{notStrictEqual as g,strictEqual as ee}from"assert";import{basename as _,dirname as te,extname as v,join as ne,normalize as re,relative as ie,resolve as y}from"path";import{readFileSync as b,readdirSync as ae,statSync as x,writeFile as S}from"fs";import{format as oe,inspect as se}from"util";import{fileURLToPath as ce}from"url";import{readFileSync as le,readdirSync as ue}from"node:fs";const de={right:C,center:ge};var fe=class{constructor(e){this.width=e.width,this.wrap=e.wrap??!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(``),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==`string`)return this.applyLayoutDSL(e[0]);let t=e.map(e=>typeof e==`string`?this.colFromString(e):e);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==`string`&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
3
3
|
`).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&w.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),w.stringWidth(e[0])))}),t.forEach(e=>{this.div(...e.map((t,r)=>({text:t.trim(),padding:this.measurePadding(t),width:r===0&&e.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=w.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(e=>!e.hidden).map(e=>e.text).join(`
|
|
4
4
|
`)}rowToString(e,t){return this.rasterize(e).forEach((n,r)=>{let i=``;n.forEach((n,a)=>{let{width:o}=e[a],s=this.negatePadding(e[a]),c=n;if(s>w.stringWidth(n)&&(c+=` `.repeat(s-w.stringWidth(n))),e[a].align&&e[a].align!==`left`&&this.wrap){let t=de[e[a].align];c=t(c,s),w.stringWidth(c)<s&&(c+=` `.repeat((o||0)-w.stringWidth(c)-1))}let l=e[a].padding||[0,0,0,0];l[3]&&(i+=` `.repeat(l[3])),i+=pe(e[a],c,`| `),i+=c,i+=pe(e[a],c,` |`),l[1]&&(i+=` `.repeat(l[1])),r===0&&t.length>0&&(i=this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,``),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,i=t.text,a=w.stringWidth(i.trimRight());return t.span?this.wrap?r<a?e:(t.hidden=!0,i.trimRight()+` `.repeat(r-a)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),r;return e.forEach((e,i)=>{e.width=n[i],r=this.wrap?w.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
|
|
5
5
|
`):e.text.split(`
|
|
@@ -95,7 +95,7 @@ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name
|
|
|
95
95
|
`)}`:``;t.fail(i(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(r).length,Object.keys(r).join(`, `)+n))}},a.unknownArguments=function(n,r,o,s,c=!0){let l=e.getInternalMethods().getCommandInstance().getCommands(),u=[],d=e.getInternalMethods().getContext();if(Object.keys(n).forEach(t=>{!Zt.includes(t)&&!Object.prototype.hasOwnProperty.call(o,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!a.isValidAndSomeAliasIsNotNew(t,r)&&u.push(t)}),c&&(d.commands.length>0||l.length>0||s)&&n._.slice(d.commands.length).forEach(e=>{l.includes(``+e)||u.push(``+e)}),c){let t=e.getDemandedCommands()._?.max||0,r=d.commands.length+t;r<n._.length&&n._.slice(r).forEach(e=>{e=String(e),!d.commands.includes(e)&&!u.includes(e)&&u.push(e)})}u.length&&t.fail(i(`Unknown argument: %s`,`Unknown arguments: %s`,u.length,u.map(e=>e.trim()?e:`"${e}"`).join(`, `)))},a.unknownCommands=function(n){let r=e.getInternalMethods().getCommandInstance().getCommands(),a=[],o=e.getInternalMethods().getContext();return(o.commands.length>0||r.length>0)&&n._.slice(o.commands.length).forEach(e=>{r.includes(``+e)||a.push(``+e)}),a.length>0?(t.fail(i(`Unknown command: %s`,`Unknown commands: %s`,a.length,a.join(`, `))),!0):!1},a.isValidAndSomeAliasIsNotNew=function(t,n){if(!Object.prototype.hasOwnProperty.call(n,t))return!1;let r=e.parsed.newAliases;return[t,...n[t]].some(e=>!Object.prototype.hasOwnProperty.call(r,e)||!r[t])},a.limitedChoices=function(n){let i=e.getOptions(),a={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach(e=>{Zt.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(i.choices,e)&&[].concat(n[e]).forEach(t=>{i.choices[e].indexOf(t)===-1&&t!==void 0&&(a[e]=(a[e]||[]).concat(t))})});let o=Object.keys(a);if(!o.length)return;let s=r(`Invalid values:`);o.forEach(e=>{s+=`\n ${r(`Argument: %s, Given: %s, Choices: %s`,e,t.stringifiedValues(a[e]),t.stringifiedValues(i.choices[e]))}`}),t.fail(s)};let o={};a.implies=function(t,r){N(`<string|object> [array|number|string]`,[t,r],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.implies(e,t[e])}):(e.global(t),o[t]||(o[t]=[]),Array.isArray(r)?r.forEach(e=>a.implies(t,e)):(A(r,void 0,n),o[t].push(r)))},a.getImplied=function(){return o};function s(e,t){let n=Number(t);return t=isNaN(n)?t:n,typeof t==`number`?t=e._.length>=t:t.match(/^--no-.+/)?(t=t.match(/^--no-(.+)/)[1],t=!Object.prototype.hasOwnProperty.call(e,t)):t=Object.prototype.hasOwnProperty.call(e,t),t}a.implications=function(e){let n=[];if(Object.keys(o).forEach(t=>{let r=t;(o[t]||[]).forEach(t=>{let i=r,a=t;i=s(e,i),t=s(e,t),i&&!t&&n.push(` ${r} -> ${a}`)})}),n.length){let e=`${r(`Implications failed:`)}\n`;n.forEach(t=>{e+=t}),t.fail(e)}};let c={};a.conflicts=function(t,n){N(`<string|object> [array|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.conflicts(e,t[e])}):(e.global(t),c[t]||(c[t]=[]),Array.isArray(n)?n.forEach(e=>a.conflicts(t,e)):c[t].push(n))},a.getConflicting=()=>c,a.conflicting=function(i){Object.keys(i).forEach(e=>{c[e]&&c[e].forEach(n=>{n&&i[e]!==void 0&&i[n]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,n))})}),e.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(c).forEach(e=>{c[e].forEach(a=>{a&&i[n.Parser.camelCase(e)]!==void 0&&i[n.Parser.camelCase(a)]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,a))})})},a.recommendCommands=function(e,n){n=n.sort((e,t)=>t.length-e.length);let i=null,a=1/0;for(let t=0,r;(r=n[t])!==void 0;t++){let t=Xt(e,r);t<=3&&t<a&&(a=t,i=r)}i&&t.fail(r(`Did you mean %s?`,i))},a.reset=function(e){return o=Rt(o,t=>!e[t]),c=Rt(c,t=>!e[t]),a};let l=[];return a.freeze=function(){l.push({implied:o,conflicting:c})},a.unfreeze=function(){let e=l.pop();A(e,void 0,n),{implied:o,conflicting:c}=e},a}let $t=[],en;function tn(e,t,n,r){en=r;let i={};if(Object.prototype.hasOwnProperty.call(e,`extends`)){if(typeof e.extends!=`string`)return i;let a=/\.json|\..*rc$/.test(e.extends),o=null;if(a)o=rn(t,e.extends);else try{o=import.meta.resolve(e.extends)}catch{return e}nn(o),$t.push(o),i=a?JSON.parse(en.readFileSync(o,`utf8`)):r.require(e.extends),delete e.extends,i=tn(i,en.path.dirname(o),n,en)}return $t=[],n?an(i,e):Object.assign({},i,e)}function nn(e){if($t.indexOf(e)>-1)throw new M(`Circular extended configurations: '${e}'.`)}function rn(e,t){return en.path.resolve(e,t)}function an(e,t){let n={};function r(e){return e&&typeof e==`object`&&!Array.isArray(e)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=an(e[i],t[i]):n[i]=t[i];return n}var P=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},F=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},I,on,sn,L,R,cn,z,ln,un,B,dn,V,H,U,W,fn,pn,G,K,mn,hn,q,gn,_n,vn,yn,bn,J,xn,Sn,Cn,Y,wn,X,Z;function Tn(e){return(t=[],n=e.process.cwd(),r)=>{let i=new sr(t,n,r,e);return Object.defineProperty(i,`argv`,{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const En=Symbol(`copyDoubleDash`),Dn=Symbol(`copyDoubleDash`),On=Symbol(`deleteFromParserHintObject`),kn=Symbol(`emitWarning`),An=Symbol(`freeze`),jn=Symbol(`getDollarZero`),Mn=Symbol(`getParserConfiguration`),Nn=Symbol(`getUsageConfiguration`),Pn=Symbol(`guessLocale`),Fn=Symbol(`guessVersion`),In=Symbol(`parsePositionalNumbers`),Ln=Symbol(`pkgUp`),Q=Symbol(`populateParserHintArray`),Rn=Symbol(`populateParserHintSingleValueDictionary`),zn=Symbol(`populateParserHintArrayDictionary`),Bn=Symbol(`populateParserHintDictionary`),Vn=Symbol(`sanitizeKey`),Hn=Symbol(`setKey`),Un=Symbol(`unfreeze`),Wn=Symbol(`validateAsync`),Gn=Symbol(`getCommandInstance`),Kn=Symbol(`getContext`),qn=Symbol(`getHasOutput`),Jn=Symbol(`getLoggerInstance`),Yn=Symbol(`getParseContext`),Xn=Symbol(`getUsageInstance`),Zn=Symbol(`getValidationInstance`),Qn=Symbol(`hasParseCallback`),$n=Symbol(`isGlobalContext`),er=Symbol(`postProcess`),tr=Symbol(`rebase`),nr=Symbol(`reset`),rr=Symbol(`runYargsParserAndExecuteCommands`),ir=Symbol(`runValidation`),ar=Symbol(`setHasOutput`),or=Symbol(`kTrackManuallySetKeys`);var sr=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,I.set(this,void 0),on.set(this,void 0),sn.set(this,{commands:[],fullCommands:[]}),L.set(this,null),R.set(this,null),cn.set(this,`show-hidden`),z.set(this,null),ln.set(this,!0),un.set(this,{}),B.set(this,!0),dn.set(this,[]),V.set(this,void 0),H.set(this,{}),U.set(this,!1),W.set(this,null),fn.set(this,!0),pn.set(this,void 0),G.set(this,``),K.set(this,void 0),mn.set(this,void 0),hn.set(this,{}),q.set(this,null),gn.set(this,null),_n.set(this,{}),vn.set(this,{}),yn.set(this,void 0),bn.set(this,!1),J.set(this,void 0),xn.set(this,!1),Sn.set(this,!1),Cn.set(this,!1),Y.set(this,void 0),wn.set(this,{}),X.set(this,null),Z.set(this,void 0),P(this,J,r,`f`),P(this,yn,e,`f`),P(this,on,t,`f`),P(this,mn,n,`f`),P(this,V,new Tt(this),`f`),this.$0=this[jn](),this[nr](),P(this,I,F(this,I,`f`),`f`),P(this,Y,F(this,Y,`f`),`f`),P(this,Z,F(this,Z,`f`),`f`),P(this,K,F(this,K,`f`),`f`),F(this,K,`f`).showHiddenOpt=F(this,cn,`f`),P(this,pn,this[Dn](),`f`),F(this,J,`f`).y18n.setLocale(`en_US`)}addHelpOpt(e,t){return N(`[string|boolean] [string]`,[e,t],arguments.length),F(this,W,`f`)&&(this[On](F(this,W,`f`)),P(this,W,null,`f`)),e===!1&&t===void 0?this:(P(this,W,typeof e==`string`?e:`help`,`f`),this.boolean(F(this,W,`f`)),this.describe(F(this,W,`f`),t||F(this,Y,`f`).deferY18nLookup(`Show help`)),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(N(`[string|boolean] [string]`,[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e==`string`?e:F(this,cn,`f`);return this.boolean(n),this.describe(n,t||F(this,Y,`f`).deferY18nLookup(`Show hidden options`)),F(this,K,`f`).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[zn](this.alias.bind(this),`alias`,e,t),this}array(e){return N(`<array|string>`,[e],arguments.length),this[Q](`array`,e),this[or](e),this}boolean(e){return N(`<array|string>`,[e],arguments.length),this[Q](`boolean`,e),this[or](e),this}check(e,t){return N(`<function> [boolean]`,[e,t],arguments.length),this.middleware((t,n)=>Ot(()=>e(t,n.getOptions()),n=>(n?(typeof n==`string`||n instanceof Error)&&F(this,Y,`f`).fail(n.toString(),n):F(this,Y,`f`).fail(F(this,J,`f`).y18n.__(`Argument check failed: %s`,e.toString())),t),e=>(F(this,Y,`f`).fail(e.message?e.message:e.toString(),e),t)),!1,t),this}choices(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[zn](this.choices.bind(this),`choices`,e,t),this}coerce(e,t){if(N(`<object|string|array> [function]`,[e,t],arguments.length),Array.isArray(e)){if(!t)throw new M(`coerce callback must be provided`);for(let n of e)this.coerce(n,t);return this}else if(typeof e==`object`){for(let t of Object.keys(e))this.coerce(t,e[t]);return this}if(!t)throw new M(`coerce callback must be provided`);let n=e;return F(this,K,`f`).key[n]=!0,F(this,V,`f`).addCoerceMiddleware((e,r)=>{let i=[n,...r.getAliases()[n]??[]].filter(t=>Object.prototype.hasOwnProperty.call(e,t));return i.length===0?e:Ot(()=>t(e[i[0]]),t=>(i.forEach(n=>{e[n]=t}),e),e=>{throw new M(e.message)})},n),this}conflicts(e,t){return N(`<string|object> [string|array]`,[e,t],arguments.length),F(this,Z,`f`).conflicts(e,t),this}config(e=`config`,t,n){return N(`[object|string] [string|function] [function]`,[e,t,n],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=tn(e,F(this,on,`f`),this[Mn]()[`deep-merge-config`]||!1,F(this,J,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(e),this):(typeof t==`function`&&(n=t,t=void 0),this.describe(e,t||F(this,Y,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{F(this,K,`f`).config[e]=n||!0}),this)}completion(e,t,n){return N(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),P(this,R,e||F(this,R,`f`)||`completion`,`f`),!t&&t!==!1&&(t=`generate completion script`),this.command(F(this,R,`f`),t),n&&F(this,L,`f`).registerFunction(n),this}command(e,t,n,r,i,a){return N(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,i,a],arguments.length),F(this,I,`f`).addHandler(e,t,n,r,i,a),this}commands(e,t,n,r,i,a){return this.command(e,t,n,r,i,a)}commandDir(e,t){N(`<string> [object]`,[e,t],arguments.length);let n=F(this,mn,`f`)||F(this,J,`f`).require;return F(this,I,`f`).addDirectory(e,n,F(this,J,`f`).getCallerFile(),t),this}count(e){return N(`<array|string>`,[e],arguments.length),this[Q](`count`,e),this[or](e),this}default(e,t,n){return N(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(yt(e,F(this,J,`f`)),F(this,K,`f`).defaultDescription[e]=n),typeof t==`function`&&(yt(e,F(this,J,`f`)),F(this,K,`f`).defaultDescription[e]||(F(this,K,`f`).defaultDescription[e]=F(this,Y,`f`).functionDescription(t)),t=t.call()),this[Rn](this.default.bind(this),`default`,e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,r){return N(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[e,t,n,r],arguments.length),typeof t!=`number`&&(n=t,t=1/0),this.global(`_`,!1),F(this,K,`f`).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(e=>{A(n,!0,F(this,J,`f`)),this.demandOption(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(A(n,!0,F(this,J,`f`)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{A(n,!0,F(this,J,`f`)),this.demandOption(e,n)}):typeof n==`string`?this.demandOption(e,n):(n===!0||n===void 0)&&this.demandOption(e),this}demandOption(e,t){return N(`<object|string|array> [string]`,[e,t],arguments.length),this[Rn](this.demandOption.bind(this),`demandedOptions`,e,t),this}deprecateOption(e,t){return N(`<string> [string|boolean]`,[e,t],arguments.length),F(this,K,`f`).deprecatedOptions[e]=t,this}describe(e,t){return N(`<object|string|array> [string]`,[e,t],arguments.length),this[Hn](e,!0),F(this,Y,`f`).describe(e,t),this}detectLocale(e){return N(`<boolean>`,[e],arguments.length),P(this,ln,e,`f`),this}env(e){return N(`[string|boolean]`,[e],arguments.length),e===!1?delete F(this,K,`f`).envPrefix:F(this,K,`f`).envPrefix=e||``,this}epilogue(e){return N(`<string>`,[e],arguments.length),F(this,Y,`f`).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return N(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>this.example(...e)):F(this,Y,`f`).example(e,t),this}exit(e,t){P(this,U,!0,`f`),P(this,z,t,`f`),F(this,B,`f`)&&F(this,J,`f`).process.exit(e)}exitProcess(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,B,e,`f`),this}fail(e){if(N(`<function|boolean>`,[e],arguments.length),typeof e==`boolean`&&e!==!1)throw new M(`Invalid first argument. Expected function or boolean 'false'`);return F(this,Y,`f`).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return N(`<array> [function]`,[e,t],arguments.length),t?F(this,L,`f`).getCompletion(e,t):new Promise((t,n)=>{F(this,L,`f`).getCompletion(e,(e,r)=>{e?n(e):t(r)})})}getDemandedOptions(){return N([],0),F(this,K,`f`).demandedOptions}getDemandedCommands(){return N([],0),F(this,K,`f`).demandedCommands}getDeprecatedOptions(){return N([],0),F(this,K,`f`).deprecatedOptions}getDetectLocale(){return F(this,ln,`f`)}getExitProcess(){return F(this,B,`f`)}getGroups(){return Object.assign({},F(this,H,`f`),F(this,vn,`f`))}getHelp(){if(P(this,U,!0,`f`),!F(this,Y,`f`).hasCachedHelpMessage()){if(!this.parsed){let e=this[rr](F(this,yn,`f`),void 0,void 0,0,!0);if(j(e))return e.then(()=>F(this,Y,`f`).help())}let e=F(this,I,`f`).runDefaultBuilderOn(this);if(j(e))return e.then(()=>F(this,Y,`f`).help())}return Promise.resolve(F(this,Y,`f`).help())}getOptions(){return F(this,K,`f`)}getStrict(){return F(this,xn,`f`)}getStrictCommands(){return F(this,Sn,`f`)}getStrictOptions(){return F(this,Cn,`f`)}global(e,t){return N(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{F(this,K,`f`).local.includes(e)||F(this,K,`f`).local.push(e)}):F(this,K,`f`).local=F(this,K,`f`).local.filter(t=>e.indexOf(t)===-1),this}group(e,t){N(`<string|array> <string>`,[e,t],arguments.length);let n=F(this,vn,`f`)[t]||F(this,H,`f`)[t];F(this,vn,`f`)[t]&&delete F(this,vn,`f`)[t];let r={};return F(this,H,`f`)[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),this}hide(e){return N(`<string>`,[e],arguments.length),F(this,K,`f`).hiddenOptions.push(e),this}implies(e,t){return N(`<string|object> [number|string|array]`,[e,t],arguments.length),F(this,Z,`f`).implies(e,t),this}locale(e){return N(`[string]`,[e],arguments.length),e===void 0?(this[Pn](),F(this,J,`f`).y18n.getLocale()):(P(this,ln,!1,`f`),F(this,J,`f`).y18n.setLocale(e),this)}middleware(e,t,n){return F(this,V,`f`).addMiddleware(e,!!t,n)}nargs(e,t){return N(`<string|object|array> [number]`,[e,t],arguments.length),this[Rn](this.nargs.bind(this),`narg`,e,t),this}normalize(e){return N(`<array|string>`,[e],arguments.length),this[Q](`normalize`,e),this}number(e){return N(`<array|string>`,[e],arguments.length),this[Q](`number`,e),this[or](e),this}option(e,t){if(N(`<string|object> [object]`,[e,t],arguments.length),typeof e==`object`)Object.keys(e).forEach(t=>{this.options(t,e[t])});else{typeof t!=`object`&&(t={}),this[or](e),F(this,X,`f`)&&(e===`version`||t?.alias===`version`)&&this[kn]([`"version" is a reserved word.`,`Please do one of the following:`,'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)",`- Use a different option key`,`https://yargs.js.org/docs/#api-reference-version`].join(`
|
|
96
96
|
`),void 0,`versionWarning`),F(this,K,`f`).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption==`string`?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),`default`in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type===`boolean`)&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type===`array`)&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type===`number`)&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type===`string`)&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type===`count`)&&this.count(e),typeof t.global==`boolean`&&this.global(e,t.global),t.defaultDescription&&(F(this,K,`f`).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let i=t.describe||t.description||t.desc,a=F(this,Y,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(a,e)||typeof i==`string`)&&this.describe(e,i),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){N(`[string|array] [function|boolean|object] [function]`,[e,t,n],arguments.length),this[An](),e===void 0&&(e=F(this,yn,`f`)),typeof t==`object`&&(P(this,gn,t,`f`),t=n),typeof t==`function`&&(P(this,q,t,`f`),t=!1),t||P(this,yn,e,`f`),F(this,q,`f`)&&P(this,B,!1,`f`);let r=this[rr](e,!!t),i=this.parsed;return F(this,L,`f`).setParsed(this.parsed),j(r)?r.then(e=>(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),e,F(this,G,`f`)),e)).catch(e=>{throw F(this,q,`f`)&&F(this,q,`f`)(e,this.parsed.argv,F(this,G,`f`)),e}).finally(()=>{this[Un](),this.parsed=i}):(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),r,F(this,G,`f`)),this[Un](),this.parsed=i,r)}parseAsync(e,t,n){let r=this.parse(e,t,n);return j(r)?r:Promise.resolve(r)}parseSync(e,t,n){let r=this.parse(e,t,n);if(j(r))throw new M(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return r}parserConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,hn,e,`f`),this}pkgConf(e,t){N(`<string> [string]`,[e,t],arguments.length);let n=null,r=this[Ln](t||F(this,on,`f`));return r[e]&&typeof r[e]==`object`&&(n=tn(r[e],t||F(this,on,`f`),this[Mn]()[`deep-merge-config`]||!1,F(this,J,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(n)),this}positional(e,t){N(`<string> <object>`,[e,t],arguments.length);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=Rt(t,(e,t)=>e===`type`&&![`string`,`number`,`boolean`].includes(t)?!1:n.includes(e));let r=F(this,sn,`f`).fullCommands[F(this,sn,`f`).fullCommands.length-1],i=r?F(this,I,`f`).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return bt(i).forEach(n=>{let r=i[n];Array.isArray(r)?r.indexOf(e)!==-1&&(t[n]=!0):r[e]&&!(n in t)&&(t[n]=r[e])}),this.group(e,F(this,Y,`f`).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,bn,e,`f`),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return N(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&F(this,K,`f`).narg[e]||this[Rn](this.requiresArg.bind(this),`narg`,e,NaN),this}showCompletionScript(e,t){return N(`[string] [string]`,[e,t],arguments.length),e||=this.$0,F(this,pn,`f`).log(F(this,L,`f`).generateCompletionScript(e,t||F(this,R,`f`)||`completion`)),this}showHelp(e){if(N(`[string|function]`,[e],arguments.length),P(this,U,!0,`f`),!F(this,Y,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[rr](F(this,yn,`f`),void 0,void 0,0,!0);if(j(t))return t.then(()=>{F(this,Y,`f`).showHelp(e)}),this}let t=F(this,I,`f`).runDefaultBuilderOn(this);if(j(t))return t.then(()=>{F(this,Y,`f`).showHelp(e)}),this}return F(this,Y,`f`).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return N(`[boolean|string] [string]`,[e,t],arguments.length),F(this,Y,`f`).showHelpOnFail(e,t),this}showVersion(e){return N(`[string|function]`,[e],arguments.length),F(this,Y,`f`).showVersion(e),this}skipValidation(e){return N(`<array|string>`,[e],arguments.length),this[Q](`skipValidation`,e),this}strict(e){return N(`[boolean]`,[e],arguments.length),P(this,xn,e!==!1,`f`),this}strictCommands(e){return N(`[boolean]`,[e],arguments.length),P(this,Sn,e!==!1,`f`),this}strictOptions(e){return N(`[boolean]`,[e],arguments.length),P(this,Cn,e!==!1,`f`),this}string(e){return N(`<array|string>`,[e],arguments.length),this[Q](`string`,e),this[or](e),this}terminalWidth(){return N([],0),F(this,J,`f`).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return N(`<object>`,[e],arguments.length),P(this,ln,!1,`f`),F(this,J,`f`).y18n.updateLocale(e),this}usage(e,t,n,r){if(N(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,r],arguments.length),t!==void 0){if(A(e,null,F(this,J,`f`)),(e||``).match(/^\$0( |$)/))return this.command(e,t,n,r);throw new M(`.usage() description must start with $0 if being used as alias for .command()`)}else return F(this,Y,`f`).usage(e),this}usageConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,wn,e,`f`),this}version(e,t,n){let r=`version`;if(N(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),F(this,X,`f`)&&(this[On](F(this,X,`f`)),F(this,Y,`f`).version(void 0),P(this,X,null,`f`)),arguments.length===0)n=this[Fn](),e=r;else if(arguments.length===1){if(e===!1)return this;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return P(this,X,typeof e==`string`?e:r,`f`),t||=F(this,Y,`f`).deferY18nLookup(`Show version number`),F(this,Y,`f`).version(n||void 0),this.boolean(F(this,X,`f`)),this.describe(F(this,X,`f`),t),this}wrap(e){return N(`<number|null|undefined>`,[e],arguments.length),F(this,Y,`f`).wrap(e),this}[(I=new WeakMap,on=new WeakMap,sn=new WeakMap,L=new WeakMap,R=new WeakMap,cn=new WeakMap,z=new WeakMap,ln=new WeakMap,un=new WeakMap,B=new WeakMap,dn=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,fn=new WeakMap,pn=new WeakMap,G=new WeakMap,K=new WeakMap,mn=new WeakMap,hn=new WeakMap,q=new WeakMap,gn=new WeakMap,_n=new WeakMap,vn=new WeakMap,yn=new WeakMap,bn=new WeakMap,J=new WeakMap,xn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,Y=new WeakMap,wn=new WeakMap,X=new WeakMap,Z=new WeakMap,En)](e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch{}return e}[Dn](){return{log:(...e)=>{this[Qn]()||console.log(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
|
|
97
97
|
`,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)},error:(...e)=>{this[Qn]()||console.error(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
|
|
98
|
-
`,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)}}}[On](e){bt(F(this,K,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=F(this,K,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete F(this,Y,`f`).getDescriptions()[e]}[kn](e,t,n){F(this,un,`f`)[n]||(F(this,J,`f`).process.emitWarning(e,t),F(this,un,`f`)[n]=!0)}[An](){F(this,dn,`f`).push({options:F(this,K,`f`),configObjects:F(this,K,`f`).configObjects.slice(0),exitProcess:F(this,B,`f`),groups:F(this,H,`f`),strict:F(this,xn,`f`),strictCommands:F(this,Sn,`f`),strictOptions:F(this,Cn,`f`),completionCommand:F(this,R,`f`),output:F(this,G,`f`),exitError:F(this,z,`f`),hasOutput:F(this,U,`f`),parsed:this.parsed,parseFn:F(this,q,`f`),parseContext:F(this,gn,`f`)}),F(this,Y,`f`).freeze(),F(this,Z,`f`).freeze(),F(this,I,`f`).freeze(),F(this,V,`f`).freeze()}[jn](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(F(this,J,`f`).process.argv()[0])?F(this,J,`f`).process.argv().slice(1,2):F(this,J,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[tr](F(this,on,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),F(this,J,`f`).getEnv(`_`)&&F(this,J,`f`).getProcessArgvBin()===F(this,J,`f`).getEnv(`_`)&&(e=F(this,J,`f`).getEnv(`_`).replace(`${F(this,J,`f`).path.dirname(F(this,J,`f`).process.execPath())}/`,``)),e}[Mn](){return F(this,hn,`f`)}[Nn](){return F(this,wn,`f`)}[Pn](){if(!F(this,ln,`f`))return;let e=F(this,J,`f`).getEnv(`LC_ALL`)||F(this,J,`f`).getEnv(`LC_MESSAGES`)||F(this,J,`f`).getEnv(`LANG`)||F(this,J,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[Fn](){return this[Ln]().version||`unknown`}[In](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)F(this,J,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[Ln](e){let t=e||`*`;if(F(this,_n,`f`)[t])return F(this,_n,`f`)[t];let n={};try{let t=e||F(this,J,`f`).mainFilename;F(this,J,`f`).path.extname(t)&&(t=F(this,J,`f`).path.dirname(t));let r=F(this,J,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});A(r,void 0,F(this,J,`f`)),n=JSON.parse(F(this,J,`f`).readFileSync(r,`utf8`))}catch{}return F(this,_n,`f`)[t]=n||{},F(this,_n,`f`)[t]}[Q](e,t){t=[].concat(t),t.forEach(t=>{t=this[Vn](t),F(this,K,`f`)[e].push(t)})}[Rn](e,t,n,r){this[Bn](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=n})}[zn](e,t,n,r){this[Bn](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=(F(this,K,`f`)[e][t]||[]).concat(n)})}[Bn](e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of bt(n))e(t,n[t]);else i(t,this[Vn](n),r)}[Vn](e){return e===`__proto__`?`___proto___`:e}[Hn](e,t){return this[Rn](this[Hn].bind(this),`key`,e,t),this}[Un](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=F(this,dn,`f`).pop();A(f,void 0,F(this,J,`f`));let p;e=this,t=this,n=this,r=this,i=this,a=this,o=this,s=this,c=this,l=this,u=this,d=this,{options:{set value(t){P(e,K,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){P(t,B,e,`f`)}}.value,groups:{set value(e){P(n,H,e,`f`)}}.value,output:{set value(e){P(r,G,e,`f`)}}.value,exitError:{set value(e){P(i,z,e,`f`)}}.value,hasOutput:{set value(e){P(a,U,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){P(o,xn,e,`f`)}}.value,strictCommands:{set value(e){P(s,Sn,e,`f`)}}.value,strictOptions:{set value(e){P(c,Cn,e,`f`)}}.value,completionCommand:{set value(e){P(l,R,e,`f`)}}.value,parseFn:{set value(e){P(u,q,e,`f`)}}.value,parseContext:{set value(e){P(d,gn,e,`f`)}}.value}=f,F(this,K,`f`).configObjects=p,F(this,Y,`f`).unfreeze(),F(this,Z,`f`).unfreeze(),F(this,I,`f`).unfreeze(),F(this,V,`f`).unfreeze()}[Wn](e,t){return Ot(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[Gn].bind(this),getContext:this[Kn].bind(this),getHasOutput:this[qn].bind(this),getLoggerInstance:this[Jn].bind(this),getParseContext:this[Yn].bind(this),getParserConfiguration:this[Mn].bind(this),getUsageConfiguration:this[Nn].bind(this),getUsageInstance:this[Xn].bind(this),getValidationInstance:this[Zn].bind(this),hasParseCallback:this[Qn].bind(this),isGlobalContext:this[$n].bind(this),postProcess:this[er].bind(this),reset:this[nr].bind(this),runValidation:this[ir].bind(this),runYargsParserAndExecuteCommands:this[rr].bind(this),setHasOutput:this[ar].bind(this)}}[Gn](){return F(this,I,`f`)}[Kn](){return F(this,sn,`f`)}[qn](){return F(this,U,`f`)}[Jn](){return F(this,pn,`f`)}[Yn](){return F(this,gn,`f`)||{}}[Xn](){return F(this,Y,`f`)}[Zn](){return F(this,Z,`f`)}[Qn](){return!!F(this,q,`f`)}[$n](){return F(this,fn,`f`)}[er](e,t,n,r){return n||j(e)?e:(t||(e=this[En](e)),(this[Mn]()[`parse-positional-numbers`]||this[Mn]()[`parse-positional-numbers`]===void 0)&&(e=this[In](e)),r&&(e=Dt(e,this,F(this,V,`f`).getMiddleware(),!1)),e)}[nr](e={}){P(this,K,F(this,K,`f`)||{},`f`);let t={};t.local=F(this,K,`f`).local||[],t.configObjects=F(this,K,`f`).configObjects||[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(F(this,vn,`f`),Object.keys(F(this,H,`f`)).reduce((e,t)=>{let r=F(this,H,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),P(this,H,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(F(this,K,`f`)[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(e=>{t[e]=Rt(F(this,K,`f`)[e],e=>!n[e])}),t.envPrefix=F(this,K,`f`).envPrefix,P(this,K,t,`f`),P(this,Y,F(this,Y,`f`)?F(this,Y,`f`).reset(n):Vt(this,F(this,J,`f`)),`f`),P(this,Z,F(this,Z,`f`)?F(this,Z,`f`).reset(n):Qt(this,F(this,Y,`f`),F(this,J,`f`)),`f`),P(this,I,F(this,I,`f`)?F(this,I,`f`).reset():Mt(F(this,Y,`f`),F(this,Z,`f`),F(this,V,`f`),F(this,J,`f`)),`f`),F(this,L,`f`)||P(this,L,qt(this,F(this,Y,`f`),F(this,I,`f`),F(this,J,`f`)),`f`),F(this,V,`f`).reset(),P(this,R,null,`f`),P(this,G,``,`f`),P(this,z,null,`f`),P(this,U,!1,`f`),this.parsed=!1,this}[tr](e,t){return F(this,J,`f`).path.relative(e,t)}[rr](e,t,n,r=0,i=!1){let a=!!n||i;e||=F(this,yn,`f`),F(this,K,`f`).__=F(this,J,`f`).y18n.__,F(this,K,`f`).configuration=this[Mn]();let o=!!F(this,K,`f`).configuration[`populate--`],s=Object.assign({},F(this,K,`f`).configuration,{"populate--":!0}),c=F(this,J,`f`).Parser.detailed(e,Object.assign({},F(this,K,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,F(this,gn,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===F(this,W,`f`)&&l[e]?f=!0:e===F(this,X,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&F(this,Y,`f`).clearCachedHelpMessage();try{if(this[Pn](),t)return this[er](l,o,!!n,!1);F(this,W,`f`)&&[F(this,W,`f`)].concat(d[F(this,W,`f`)]||[]).filter(e=>e.length>1).includes(``+l._[l._.length-1])&&(l._.pop(),f=!0),P(this,fn,!1,`f`);let s=F(this,I,`f`).getCommands(),m=F(this,L,`f`)?.completionKey?[F(this,L,`f`)?.completionKey,...this.getAliases()[F(this,L,`f`)?.completionKey]??[]].some(e=>Object.prototype.hasOwnProperty.call(l,e)):!1,h=f||m||i;if(l._.length){if(s.length){let e;for(let t=r||0,a;l._[t]!==void 0;t++)if(a=String(l._[t]),s.includes(a)&&a!==F(this,R,`f`)){let e=F(this,I,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[er](e,o,!!n,!1)}else if(!e&&a!==F(this,R,`f`)){e=a;break}!F(this,I,`f`).hasDefaultCommand()&&F(this,bn,`f`)&&e&&!h&&F(this,Z,`f`).recommendCommands(e,s)}F(this,R,`f`)&&l._.includes(F(this,R,`f`))&&!m&&(F(this,B,`f`)&&zt(!0),this.showCompletionScript(),this.exit(0))}if(F(this,I,`f`).hasDefaultCommand()&&!h){let e=F(this,I,`f`).runCommand(null,this,c,0,i,f||p||i);return this[er](e,o,!!n,!1)}if(m){F(this,B,`f`)&&zt(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${F(this,L,`f`).completionKey}`)+1);return F(this,L,`f`).getCompletion(t,(e,t)=>{if(e)throw new M(e.message);(t||[]).forEach(e=>{F(this,pn,`f`).log(e)}),this.exit(0)}),this[er](l,!o,!!n,!1)}if(F(this,U,`f`)||(f?(F(this,B,`f`)&&zt(!0),a=!0,this.showHelp(e=>{F(this,pn,`f`).log(e),this.exit(0)})):p&&(F(this,B,`f`)&&zt(!0),a=!0,F(this,Y,`f`).showVersion(`log`),this.exit(0))),!a&&F(this,K,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>F(this,K,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new M(c.error.message);if(!m){let e=this[ir](d,{},c.error);n||(u=Dt(l,this,F(this,V,`f`).getMiddleware(),!0)),u=this[Wn](e,u??l),j(u)&&!n&&(u=u.then(()=>Dt(l,this,F(this,V,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof M)F(this,Y,`f`).fail(e.message,e);else throw e}return this[er](u??l,o,!!n,!0)}[ir](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new M(n.message);F(this,Z,`f`).nonOptionCount(a),F(this,Z,`f`).requiredArguments(a,i);let o=!1;F(this,Sn,`f`)&&(o=F(this,Z,`f`).unknownCommands(a)),F(this,xn,`f`)&&!o?F(this,Z,`f`).unknownArguments(a,e,t,!!r):F(this,Cn,`f`)&&F(this,Z,`f`).unknownArguments(a,e,{},!1,!1),F(this,Z,`f`).limitedChoices(a),F(this,Z,`f`).implications(a),F(this,Z,`f`).conflicting(a)}}[ar](){P(this,U,!0,`f`)}[or](e){if(typeof e==`string`)F(this,K,`f`).key[e]=!0;else for(let t of e)F(this,K,`f`).key[t]=!0}};function cr(e){return!!e&&typeof e.getInternalMethods==`function`}const lr=Tn(vt);function $(e,t,n){return{command:e,describe:t,builder:async e=>{let t=(await n()).default.builder;return typeof t==`function`?t(e):e},handler:async e=>{await(await n()).default.handler(e)}}}const ur=[{command:$(`abuse-reports`,`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,()=>import(`./abuse-reports-Ina5TlsU.mjs`)),hideCommand:!0},{command:$(`accounts`,`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,()=>import(`./accounts-B_joQcMi.mjs`)),hideCommand:!1},{command:$(`acm`,`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,()=>import(`./acm-_kIHqYME.mjs`)),hideCommand:!0},{command:$(`addressing`,`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,()=>import(`./addressing-CaFlw8y1.mjs`)),hideCommand:!0},{command:$(`ai`,`Run inference on Workers AI models — text generation, image classification, embeddings, and more`,()=>import(`./ai-CqnhNb_c.mjs`)),hideCommand:!0},{command:$(`ai_gateway`,`ai_gateway`,()=>import(`./ai_gateway--vuVLnOm.mjs`)),hideCommand:!0},{command:$(`ai-gateway`,`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,()=>import(`./ai-gateway-pgYGI519.mjs`)),hideCommand:!0},{command:$(`ai-search`,`ai-search`,()=>import(`./ai-search-eqQMPQol.mjs`)),hideCommand:!1},{command:$(`alerting`,`Notification policies, delivery destinations, silence windows, and alert history`,()=>import(`./alerting-CPxHiYHb.mjs`)),hideCommand:!0},{command:$(`analytics`,`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,()=>import(`./analytics-DSSRDZz8.mjs`)),hideCommand:!0},{command:$(`analytics_engine`,`analytics_engine`,()=>import(`./analytics_engine-gWyfnsCs.mjs`)),hideCommand:!0},{command:$(`api-gateway`,`Discover, monitor, and protect your API endpoints with schema validation, abuse detection, and routing`,()=>import(`./api-gateway-BXXGFCVR.mjs`)),hideCommand:!0},{command:$(`argo`,`Network optimization features that speed up and improve reliability of traffic to your origins`,()=>import(`./argo-aC6A3JyX.mjs`)),hideCommand:!0},{command:$(`artifacts`,`artifacts`,()=>import(`./artifacts-HD4V2xpK.mjs`)),hideCommand:!0},{command:$(`audit-logs`,`Immutable audit trail of actions taken by account members — who changed what and when`,()=>import(`./audit-logs-BuExU_nz.mjs`)),hideCommand:!0},{command:$(`billing`,`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,()=>import(`./billing-COaghyxl.mjs`)),hideCommand:!0},{command:$(`bot-management`,`Bot detection and mitigation settings — configure bot scores, JavaScript detections, and challenge behavior`,()=>import(`./bot-management-DmEzeV1Y.mjs`)),hideCommand:!0},{command:$(`botnet-feed`,`Botnet threat intelligence feeds — IP and ASN-level data on known command-and-control infrastructure`,()=>import(`./botnet-feed-ByEAXAkw.mjs`)),hideCommand:!0},{command:$(`brand-protection`,`Monitor the Internet for phishing sites, lookalike domains, and unauthorized use of your brand assets`,()=>import(`./brand-protection-dPrGe8sL.mjs`)),hideCommand:!0},{command:$(`browser-rendering`,`browser-rendering`,()=>import(`./browser-rendering-BiSGnpBf.mjs`)),hideCommand:!0},{command:$(`cache`,`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,()=>import(`./cache-CY-7Lt71.mjs`)),hideCommand:!0},{command:$(`calls`,`calls`,()=>import(`./calls-wOQGDWPl.mjs`)),hideCommand:!0},{command:$(`certificate-authorities`,`Map client certificates to specific hostnames for mTLS authentication`,()=>import(`./certificate-authorities-CtqzAtxQ.mjs`)),hideCommand:!0},{command:$(`client-certificates`,`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,()=>import(`./client-certificates-CRf41xLe.mjs`)),hideCommand:!0},{command:$(`cloud-connector`,`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,()=>import(`./cloud-connector-BA5IRZUP.mjs`)),hideCommand:!0},{command:$(`cloudforce-one`,`Threat intelligence platform — request investigations, scan indicators, and track threat events`,()=>import(`./cloudforce-one-Bq_qPAWs.mjs`)),hideCommand:!0},{command:$(`connectivity`,`Service directory for network connectivity endpoints and their configurations`,()=>import(`./connectivity-Bx3MgTHX.mjs`)),hideCommand:!0},{command:$(`connector-interrupts`,`connector-interrupts`,()=>import(`./connector-interrupts-D7ylweJZ.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-events`,`connector-telemetry-events`,()=>import(`./connector-telemetry-events-6izV1kbP.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-snapshots`,`connector-telemetry-snapshots`,()=>import(`./connector-telemetry-snapshots-BnjKbyxX.mjs`)),hideCommand:!0},{command:$(`connectors`,`connectors`,()=>import(`./connectors-DRt4e6d_.mjs`)),hideCommand:!0},{command:$(`content-scanning`,`content-scanning`,()=>import(`./content-scanning-Cd2vy5Sz.mjs`)),hideCommand:!0},{command:$(`custom-certificates`,`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,()=>import(`./custom-certificates-DYE-9epx.mjs`)),hideCommand:!0},{command:$(`custom-hostnames`,`Bring custom vanity domains to your SaaS zone with per-hostname SSL and origin mapping`,()=>import(`./custom-hostnames-CtuTdFcX.mjs`)),hideCommand:!0},{command:$(`custom-nameservers`,`Vanity nameservers that use your own domain instead of Cloudflare-assigned NS records`,()=>import(`./custom-nameservers-CWqA51in.mjs`)),hideCommand:!0},{command:$(`custom-pages`,`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,()=>import(`./custom-pages-DeUKEFGe.mjs`)),hideCommand:!0},{command:$(`d1`,`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,()=>import(`./d1-DvWY9Gp4.mjs`)),hideCommand:!0},{command:$(`data-security`,`data-security`,()=>import(`./data-security-BPo6dIWu.mjs`)),hideCommand:!0},{command:$(`dcv-delegation`,`Delegate domain control validation (DCV) to Cloudflare so certificates auto-renew without manual DNS changes`,()=>import(`./dcv-delegation-Bgf86J-r.mjs`)),hideCommand:!0},{command:$(`diagnostics`,`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,()=>import(`./diagnostics-6nKPmVgz.mjs`)),hideCommand:!0},{command:$(`dispatch-namespaces`,`Workers for Platforms dispatch namespaces — isolate customer Workers for SaaS and multi-tenant deployments`,()=>import(`./dispatch-namespaces-64lXx2WJ.mjs`)),hideCommand:!0},{command:$(`dns`,`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,()=>import(`./dns-ClciFGxx.mjs`)),hideCommand:!1},{command:$(`dns-firewall`,`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,()=>import(`./dns-firewall-DfUmXDCe.mjs`)),hideCommand:!0},{command:$(`durable-objects`,`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,()=>import(`./durable-objects-CMaYZ-YU.mjs`)),hideCommand:!0},{command:$(`email-routing`,`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,()=>import(`./email-routing-CGXhFqF5.mjs`)),hideCommand:!0},{command:$(`email-security`,`Cloud email security (Area 1) — investigate threats, manage allow/block policies, and detect phishing`,()=>import(`./email-security-D5viPq8S.mjs`)),hideCommand:!0},{command:$(`email-sending`,`Send emails and manage sending subdomains`,()=>import(`./email-sending-C2jpc3gh.mjs`)),hideCommand:!0},{command:$(`filters`,`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,()=>import(`./filters-bzsFcWt0.mjs`)),hideCommand:!0},{command:$(`firewall`,`Legacy firewall rules, zone lockdowns, access rules, user-agent blocking, and WAF packages`,()=>import(`./firewall-DYZcTtIC.mjs`)),hideCommand:!0},{command:$(`fraud`,`Fraud detection for login and signup flows — identify credential stuffing, account takeover, and fake accounts`,()=>import(`./fraud-C03MtdZb.mjs`)),hideCommand:!0},{command:$(`google-tag-gateway`,`Google Tag Gateway operations`,()=>import(`./google-tag-gateway-Dfy887yA.mjs`)),hideCommand:!0},{command:$(`healthchecks`,`Standalone health checks that monitor origin server availability from Cloudflare's edge`,()=>import(`./healthchecks-DRoAlWgr.mjs`)),hideCommand:!0},{command:$(`hostnames`,`Per-hostname TLS settings — minimum TLS version, ciphers, and certificate pinning overrides`,()=>import(`./hostnames-CFgIVI3s.mjs`)),hideCommand:!0},{command:$(`hyperdrive`,`Accelerate access to existing databases by caching queries and pooling connections at the edge`,()=>import(`./hyperdrive-C7-gwTSV.mjs`)),hideCommand:!0},{command:$(`iam`,`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,()=>import(`./iam-DqVPzGrb.mjs`)),hideCommand:!0},{command:$(`images`,`images`,()=>import(`./images-BYfl4YgR.mjs`)),hideCommand:!1},{command:$(`intel`,`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,()=>import(`./intel-duTEPIHc.mjs`)),hideCommand:!0},{command:$(`ips`,`List Cloudflare's IP ranges used for proxying traffic — useful for firewall allowlisting`,()=>import(`./ips-nv9INuWZ.mjs`)),hideCommand:!0},{command:$(`keyless-certificates`,`Use your own SSL certificates without exposing private keys — keys stay on your infrastructure`,()=>import(`./keyless-certificates-CRCDVd3g.mjs`)),hideCommand:!0},{command:$(`kv`,`Global, low-latency key-value storage for Workers — namespaces, keys, values, and bulk operations`,()=>import(`./kv-CZoV4tiv.mjs`)),hideCommand:!0},{command:$(`leaked-credential-checks`,`leaked-credential-checks`,()=>import(`./leaked-credential-checks-DNIBg7Pe.mjs`)),hideCommand:!0},{command:$(`load-balancers`,`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,()=>import(`./load-balancers--OMg0HNt.mjs`)),hideCommand:!0},{command:$(`logpush`,`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,()=>import(`./logpush-C0_lZTyY.mjs`)),hideCommand:!0},{command:$(`logs`,`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,()=>import(`./logs-BtpWZQfV.mjs`)),hideCommand:!0},{command:$(`magic-cloud-networking`,`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,()=>import(`./magic-cloud-networking-u6rwYbGg.mjs`)),hideCommand:!0},{command:$(`magic-network-monitoring`,`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,()=>import(`./magic-network-monitoring-CKgQyRj4.mjs`)),hideCommand:!0},{command:$(`magic-transit`,`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,()=>import(`./magic-transit-CLhMcJ_-.mjs`)),hideCommand:!0},{command:$(`managed-transforms`,`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,()=>import(`./managed-transforms-D0Z2mlth.mjs`)),hideCommand:!0},{command:$(`mtls-certificates`,`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,()=>import(`./mtls-certificates-BL65NK5T.mjs`)),hideCommand:!0},{command:$(`network-interconnects`,`Physical and virtual private interconnects between your infrastructure and Cloudflare's network`,()=>import(`./network-interconnects-Bgu9gmaG.mjs`)),hideCommand:!0},{command:$(`observability`,`observability`,()=>import(`./observability-BynRbTF4.mjs`)),hideCommand:!0},{command:$(`organizations`,`Multi-user organizations that group accounts, members, and shared settings under a single entity`,()=>import(`./organizations-BqJHyvMK.mjs`)),hideCommand:!0},{command:$(`origin-ca-certificates`,`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,()=>import(`./origin-ca-certificates-BGvYwm3C.mjs`)),hideCommand:!0},{command:$(`origin-post-quantum-encryption`,`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,()=>import(`./origin-post-quantum-encryption-9KOE8YPI.mjs`)),hideCommand:!0},{command:$(`origin-tls-client-auth`,`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,()=>import(`./origin-tls-client-auth-d3snC3vr.mjs`)),hideCommand:!0},{command:$(`page-rules`,`Legacy URL-pattern rules that override zone settings for matching requests — prefer Rules/Transform Rules instead`,()=>import(`./page-rules-EZHJePmn.mjs`)),hideCommand:!0},{command:$(`page-shield`,`Client-side security — monitor JavaScript, connections, and cookies on your pages for supply-chain attacks`,()=>import(`./page-shield-CXJioWPs.mjs`)),hideCommand:!0},{command:$(`pages`,`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,()=>import(`./pages-D4aYteKk.mjs`)),hideCommand:!0},{command:$(`pipelines`,`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,()=>import(`./pipelines-G8Iusxq-.mjs`)),hideCommand:!0},{command:$(`queues`,`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,()=>import(`./queues-DEkbKqZX.mjs`)),hideCommand:!0},{command:$(`r2`,`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,()=>import(`./r2-CV0IkCAW.mjs`)),hideCommand:!0},{command:$(`r2-data-catalog`,`Iceberg-compatible data catalog for R2 — organize objects into tables and namespaces for SQL query engines`,()=>import(`./r2-data-catalog-NtqGC_a_.mjs`)),hideCommand:!0},{command:$(`radar`,`radar`,()=>import(`./radar-D986zPJr.mjs`)),hideCommand:!0},{command:$(`rate-limits`,`Legacy per-zone rate limiting rules — prefer Advanced Rate Limiting in Rulesets for new configurations`,()=>import(`./rate-limits-B2wRsUX1.mjs`)),hideCommand:!0},{command:$(`realtime-kit`,`Real-time video and audio — meetings, livestreams, recordings, and session management via Cloudflare Calls`,()=>import(`./realtime-kit-Ld3c5eU6.mjs`)),hideCommand:!0},{command:$(`registrar`,`Domain registration and transfer management through Cloudflare Registrar`,()=>import(`./registrar-CDIwTz3G.mjs`)),hideCommand:!1},{command:$(`request-tracers`,`request-tracers`,()=>import(`./request-tracers-D7SFMDik.mjs`)),hideCommand:!0},{command:$(`resource-sharing`,`resource-sharing`,()=>import(`./resource-sharing-YIQ04jXE.mjs`)),hideCommand:!0},{command:$(`resource-tagging`,`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,()=>import(`./resource-tagging-Bd6Y03sg.mjs`)),hideCommand:!0},{command:$(`rules`,`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,()=>import(`./rules-DHjLP5Kx.mjs`)),hideCommand:!0},{command:$(`rulesets`,`Versioned collections of rules that control how Cloudflare processes traffic — WAF, transform, redirect, and more`,()=>import(`./rulesets-q4QABpKs.mjs`)),hideCommand:!0},{command:$(`rum`,`rum`,()=>import(`./rum-SmT4HZmM.mjs`)),hideCommand:!0},{command:$(`schema-validation`,`API schema validation settings — enforce request/response schemas and configure validation behavior`,()=>import(`./schema-validation-vVetgC_P.mjs`)),hideCommand:!0},{command:$(`scim`,`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,()=>import(`./scim-ChOkZpNx.mjs`)),hideCommand:!0},{command:$(`secrets-store`,`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,()=>import(`./secrets-store-BAK9G12O.mjs`)),hideCommand:!0},{command:$(`security-center`,`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,()=>import(`./security-center-eScuYDKP.mjs`)),hideCommand:!0},{command:$(`security-txt`,`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,()=>import(`./security-txt-x7R4gmQu.mjs`)),hideCommand:!0},{command:$(`smart-shield`,`Smart Shield settings, health checks, and cache reserve management`,()=>import(`./smart-shield-CWlSsNi8.mjs`)),hideCommand:!0},{command:$(`snippets`,`Lightweight JavaScript snippets that run on requests before Workers — for quick header modifications and redirects`,()=>import(`./snippets-DrlgYJYp.mjs`)),hideCommand:!0},{command:$(`spectrum`,`Proxy and protect arbitrary TCP/UDP applications through Cloudflare's network with DDoS mitigation`,()=>import(`./spectrum-pVGxb7u5.mjs`)),hideCommand:!0},{command:$(`speed`,`speed`,()=>import(`./speed-ZFrMWDgd.mjs`)),hideCommand:!0},{command:$(`ssl`,`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,()=>import(`./ssl-9JY05sYt.mjs`)),hideCommand:!0},{command:$(`stream`,`stream`,()=>import(`./stream-tRU39b8K.mjs`)),hideCommand:!0},{command:$(`tenants`,`Multi-tenant account management — manage tenant accounts, entitlements, and memberships`,()=>import(`./tenants-HLGUazms.mjs`)),hideCommand:!0},{command:$(`token-validation`,`Validate JWT tokens at the edge — configure token sources, signing keys, and validation rules`,()=>import(`./token-validation-_VdamKpz.mjs`)),hideCommand:!0},{command:$(`turnstile`,`turnstile`,()=>import(`./turnstile-BRzXd28B.mjs`)),hideCommand:!0},{command:$(`url-normalization`,`Normalize incoming request URLs to a consistent format before rule evaluation and caching`,()=>import(`./url-normalization-D-NxuLtN.mjs`)),hideCommand:!0},{command:$(`url-scanner`,`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,()=>import(`./url-scanner-BzzR6iDx.mjs`)),hideCommand:!0},{command:$(`user`,`Your Cloudflare user profile, invitations, organizations, billing, and personal API tokens`,()=>import(`./user-C4omq__w.mjs`)),hideCommand:!0},{command:$(`vectorize`,`Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers`,()=>import(`./vectorize-By6EqcNR.mjs`)),hideCommand:!0},{command:$(`waiting-rooms`,`Virtual queues that throttle traffic to your site during peak demand with customizable waiting pages`,()=>import(`./waiting-rooms-u6KwrzWd.mjs`)),hideCommand:!0},{command:$(`web3`,`Web3 gateways — serve IPFS and Ethereum content through custom hostnames on Cloudflare`,()=>import(`./web3-DQ5dmE9W.mjs`)),hideCommand:!0},{command:$(`workers`,`Deploy and manage serverless JavaScript/WASM applications on Cloudflare's global network`,()=>import(`./workers-D8Be7_as.mjs`)),hideCommand:!0},{command:$(`workers-builds`,`Automated build and deployment pipeline for Workers — track builds, logs, and repo connections`,()=>import(`./workers-builds-BE3W3qNk.mjs`)),hideCommand:!0},{command:$(`workflows`,`Durable, multi-step workflows that run on Workers with automatic retries and state persistence`,()=>import(`./workflows-BWWufqFA.mjs`)),hideCommand:!0},{command:$(`zaraz`,`Server-side tag manager — load third-party tools (analytics, pixels, etc.) from Cloudflare's edge without client-side JS`,()=>import(`./zaraz-Bsa9AvVL.mjs`)),hideCommand:!0},{command:$(`zero_trust`,`zero_trust`,()=>import(`./zero_trust-B0_Rk4p2.mjs`)),hideCommand:!0},{command:$(`zero-trust`,`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,()=>import(`./zero-trust-UNVZFnKu.mjs`)),hideCommand:!0},{command:$(`zones`,`Zones are domains on Cloudflare — list, create, and configure domain settings`,()=>import(`./zones-BXtdwt6E.mjs`)),hideCommand:!1}];function dr(e){try{let t=new URL(e);return`${t.pathname.replace(/^\/client\/v\d+/,``)}${t.search}`}catch{return e}}function fr(e){if(a(s),e instanceof c){let t=d(),n=e.statusCode,r=e.body,i=n===void 0?`Envelope Error`:mr(n),a=[];if(r){let e=r;Array.isArray(e.errors)&&(a=e.errors)}let o=e.rawResponse?.url?`HTTP ${dr(e.rawResponse.url)}`:void 0,s=n===void 0?i:`${n} ${i}`,c=o?`${s} · ${o}`:s,l=t.dim(c),u=``;return a.length>0?u=a.map((e,n)=>{let r=typeof e.code==`number`?t.hex(f.error).bold(`[${e.code}]`):t.hex(f.error).bold(`[error]`),i=t.bold(e.message??``);return n===a.length-1?`${r} ${i}\n${l}`:`${r} ${i}`}).join(`
|
|
98
|
+
`,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)}}}[On](e){bt(F(this,K,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=F(this,K,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete F(this,Y,`f`).getDescriptions()[e]}[kn](e,t,n){F(this,un,`f`)[n]||(F(this,J,`f`).process.emitWarning(e,t),F(this,un,`f`)[n]=!0)}[An](){F(this,dn,`f`).push({options:F(this,K,`f`),configObjects:F(this,K,`f`).configObjects.slice(0),exitProcess:F(this,B,`f`),groups:F(this,H,`f`),strict:F(this,xn,`f`),strictCommands:F(this,Sn,`f`),strictOptions:F(this,Cn,`f`),completionCommand:F(this,R,`f`),output:F(this,G,`f`),exitError:F(this,z,`f`),hasOutput:F(this,U,`f`),parsed:this.parsed,parseFn:F(this,q,`f`),parseContext:F(this,gn,`f`)}),F(this,Y,`f`).freeze(),F(this,Z,`f`).freeze(),F(this,I,`f`).freeze(),F(this,V,`f`).freeze()}[jn](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(F(this,J,`f`).process.argv()[0])?F(this,J,`f`).process.argv().slice(1,2):F(this,J,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[tr](F(this,on,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),F(this,J,`f`).getEnv(`_`)&&F(this,J,`f`).getProcessArgvBin()===F(this,J,`f`).getEnv(`_`)&&(e=F(this,J,`f`).getEnv(`_`).replace(`${F(this,J,`f`).path.dirname(F(this,J,`f`).process.execPath())}/`,``)),e}[Mn](){return F(this,hn,`f`)}[Nn](){return F(this,wn,`f`)}[Pn](){if(!F(this,ln,`f`))return;let e=F(this,J,`f`).getEnv(`LC_ALL`)||F(this,J,`f`).getEnv(`LC_MESSAGES`)||F(this,J,`f`).getEnv(`LANG`)||F(this,J,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[Fn](){return this[Ln]().version||`unknown`}[In](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)F(this,J,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[Ln](e){let t=e||`*`;if(F(this,_n,`f`)[t])return F(this,_n,`f`)[t];let n={};try{let t=e||F(this,J,`f`).mainFilename;F(this,J,`f`).path.extname(t)&&(t=F(this,J,`f`).path.dirname(t));let r=F(this,J,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});A(r,void 0,F(this,J,`f`)),n=JSON.parse(F(this,J,`f`).readFileSync(r,`utf8`))}catch{}return F(this,_n,`f`)[t]=n||{},F(this,_n,`f`)[t]}[Q](e,t){t=[].concat(t),t.forEach(t=>{t=this[Vn](t),F(this,K,`f`)[e].push(t)})}[Rn](e,t,n,r){this[Bn](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=n})}[zn](e,t,n,r){this[Bn](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=(F(this,K,`f`)[e][t]||[]).concat(n)})}[Bn](e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of bt(n))e(t,n[t]);else i(t,this[Vn](n),r)}[Vn](e){return e===`__proto__`?`___proto___`:e}[Hn](e,t){return this[Rn](this[Hn].bind(this),`key`,e,t),this}[Un](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=F(this,dn,`f`).pop();A(f,void 0,F(this,J,`f`));let p;e=this,t=this,n=this,r=this,i=this,a=this,o=this,s=this,c=this,l=this,u=this,d=this,{options:{set value(t){P(e,K,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){P(t,B,e,`f`)}}.value,groups:{set value(e){P(n,H,e,`f`)}}.value,output:{set value(e){P(r,G,e,`f`)}}.value,exitError:{set value(e){P(i,z,e,`f`)}}.value,hasOutput:{set value(e){P(a,U,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){P(o,xn,e,`f`)}}.value,strictCommands:{set value(e){P(s,Sn,e,`f`)}}.value,strictOptions:{set value(e){P(c,Cn,e,`f`)}}.value,completionCommand:{set value(e){P(l,R,e,`f`)}}.value,parseFn:{set value(e){P(u,q,e,`f`)}}.value,parseContext:{set value(e){P(d,gn,e,`f`)}}.value}=f,F(this,K,`f`).configObjects=p,F(this,Y,`f`).unfreeze(),F(this,Z,`f`).unfreeze(),F(this,I,`f`).unfreeze(),F(this,V,`f`).unfreeze()}[Wn](e,t){return Ot(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[Gn].bind(this),getContext:this[Kn].bind(this),getHasOutput:this[qn].bind(this),getLoggerInstance:this[Jn].bind(this),getParseContext:this[Yn].bind(this),getParserConfiguration:this[Mn].bind(this),getUsageConfiguration:this[Nn].bind(this),getUsageInstance:this[Xn].bind(this),getValidationInstance:this[Zn].bind(this),hasParseCallback:this[Qn].bind(this),isGlobalContext:this[$n].bind(this),postProcess:this[er].bind(this),reset:this[nr].bind(this),runValidation:this[ir].bind(this),runYargsParserAndExecuteCommands:this[rr].bind(this),setHasOutput:this[ar].bind(this)}}[Gn](){return F(this,I,`f`)}[Kn](){return F(this,sn,`f`)}[qn](){return F(this,U,`f`)}[Jn](){return F(this,pn,`f`)}[Yn](){return F(this,gn,`f`)||{}}[Xn](){return F(this,Y,`f`)}[Zn](){return F(this,Z,`f`)}[Qn](){return!!F(this,q,`f`)}[$n](){return F(this,fn,`f`)}[er](e,t,n,r){return n||j(e)?e:(t||(e=this[En](e)),(this[Mn]()[`parse-positional-numbers`]||this[Mn]()[`parse-positional-numbers`]===void 0)&&(e=this[In](e)),r&&(e=Dt(e,this,F(this,V,`f`).getMiddleware(),!1)),e)}[nr](e={}){P(this,K,F(this,K,`f`)||{},`f`);let t={};t.local=F(this,K,`f`).local||[],t.configObjects=F(this,K,`f`).configObjects||[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(F(this,vn,`f`),Object.keys(F(this,H,`f`)).reduce((e,t)=>{let r=F(this,H,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),P(this,H,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(F(this,K,`f`)[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(e=>{t[e]=Rt(F(this,K,`f`)[e],e=>!n[e])}),t.envPrefix=F(this,K,`f`).envPrefix,P(this,K,t,`f`),P(this,Y,F(this,Y,`f`)?F(this,Y,`f`).reset(n):Vt(this,F(this,J,`f`)),`f`),P(this,Z,F(this,Z,`f`)?F(this,Z,`f`).reset(n):Qt(this,F(this,Y,`f`),F(this,J,`f`)),`f`),P(this,I,F(this,I,`f`)?F(this,I,`f`).reset():Mt(F(this,Y,`f`),F(this,Z,`f`),F(this,V,`f`),F(this,J,`f`)),`f`),F(this,L,`f`)||P(this,L,qt(this,F(this,Y,`f`),F(this,I,`f`),F(this,J,`f`)),`f`),F(this,V,`f`).reset(),P(this,R,null,`f`),P(this,G,``,`f`),P(this,z,null,`f`),P(this,U,!1,`f`),this.parsed=!1,this}[tr](e,t){return F(this,J,`f`).path.relative(e,t)}[rr](e,t,n,r=0,i=!1){let a=!!n||i;e||=F(this,yn,`f`),F(this,K,`f`).__=F(this,J,`f`).y18n.__,F(this,K,`f`).configuration=this[Mn]();let o=!!F(this,K,`f`).configuration[`populate--`],s=Object.assign({},F(this,K,`f`).configuration,{"populate--":!0}),c=F(this,J,`f`).Parser.detailed(e,Object.assign({},F(this,K,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,F(this,gn,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===F(this,W,`f`)&&l[e]?f=!0:e===F(this,X,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&F(this,Y,`f`).clearCachedHelpMessage();try{if(this[Pn](),t)return this[er](l,o,!!n,!1);F(this,W,`f`)&&[F(this,W,`f`)].concat(d[F(this,W,`f`)]||[]).filter(e=>e.length>1).includes(``+l._[l._.length-1])&&(l._.pop(),f=!0),P(this,fn,!1,`f`);let s=F(this,I,`f`).getCommands(),m=F(this,L,`f`)?.completionKey?[F(this,L,`f`)?.completionKey,...this.getAliases()[F(this,L,`f`)?.completionKey]??[]].some(e=>Object.prototype.hasOwnProperty.call(l,e)):!1,h=f||m||i;if(l._.length){if(s.length){let e;for(let t=r||0,a;l._[t]!==void 0;t++)if(a=String(l._[t]),s.includes(a)&&a!==F(this,R,`f`)){let e=F(this,I,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[er](e,o,!!n,!1)}else if(!e&&a!==F(this,R,`f`)){e=a;break}!F(this,I,`f`).hasDefaultCommand()&&F(this,bn,`f`)&&e&&!h&&F(this,Z,`f`).recommendCommands(e,s)}F(this,R,`f`)&&l._.includes(F(this,R,`f`))&&!m&&(F(this,B,`f`)&&zt(!0),this.showCompletionScript(),this.exit(0))}if(F(this,I,`f`).hasDefaultCommand()&&!h){let e=F(this,I,`f`).runCommand(null,this,c,0,i,f||p||i);return this[er](e,o,!!n,!1)}if(m){F(this,B,`f`)&&zt(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${F(this,L,`f`).completionKey}`)+1);return F(this,L,`f`).getCompletion(t,(e,t)=>{if(e)throw new M(e.message);(t||[]).forEach(e=>{F(this,pn,`f`).log(e)}),this.exit(0)}),this[er](l,!o,!!n,!1)}if(F(this,U,`f`)||(f?(F(this,B,`f`)&&zt(!0),a=!0,this.showHelp(e=>{F(this,pn,`f`).log(e),this.exit(0)})):p&&(F(this,B,`f`)&&zt(!0),a=!0,F(this,Y,`f`).showVersion(`log`),this.exit(0))),!a&&F(this,K,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>F(this,K,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new M(c.error.message);if(!m){let e=this[ir](d,{},c.error);n||(u=Dt(l,this,F(this,V,`f`).getMiddleware(),!0)),u=this[Wn](e,u??l),j(u)&&!n&&(u=u.then(()=>Dt(l,this,F(this,V,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof M)F(this,Y,`f`).fail(e.message,e);else throw e}return this[er](u??l,o,!!n,!0)}[ir](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new M(n.message);F(this,Z,`f`).nonOptionCount(a),F(this,Z,`f`).requiredArguments(a,i);let o=!1;F(this,Sn,`f`)&&(o=F(this,Z,`f`).unknownCommands(a)),F(this,xn,`f`)&&!o?F(this,Z,`f`).unknownArguments(a,e,t,!!r):F(this,Cn,`f`)&&F(this,Z,`f`).unknownArguments(a,e,{},!1,!1),F(this,Z,`f`).limitedChoices(a),F(this,Z,`f`).implications(a),F(this,Z,`f`).conflicting(a)}}[ar](){P(this,U,!0,`f`)}[or](e){if(typeof e==`string`)F(this,K,`f`).key[e]=!0;else for(let t of e)F(this,K,`f`).key[t]=!0}};function cr(e){return!!e&&typeof e.getInternalMethods==`function`}const lr=Tn(vt);function $(e,t,n){return{command:e,describe:t,builder:async e=>{let t=(await n()).default.builder;return typeof t==`function`?t(e):e},handler:async e=>{await(await n()).default.handler(e)}}}const ur=[{command:$(`abuse-reports`,`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,()=>import(`./abuse-reports-DUs4SKVx.mjs`)),hideCommand:!0},{command:$(`accounts`,`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,()=>import(`./accounts-BIY8wNGA.mjs`)),hideCommand:!1},{command:$(`acm`,`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,()=>import(`./acm-SqcV8o5o.mjs`)),hideCommand:!0},{command:$(`addressing`,`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,()=>import(`./addressing-CygRm0pN.mjs`)),hideCommand:!0},{command:$(`ai`,`Run inference on Workers AI models — text generation, image classification, embeddings, and more`,()=>import(`./ai-BAmEAjN3.mjs`)),hideCommand:!0},{command:$(`ai_gateway`,`ai_gateway`,()=>import(`./ai_gateway-C6WP9oBH.mjs`)),hideCommand:!0},{command:$(`ai-gateway`,`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,()=>import(`./ai-gateway-BENwPvvB.mjs`)),hideCommand:!0},{command:$(`ai-search`,`ai-search`,()=>import(`./ai-search-Bv_Whw3E.mjs`)),hideCommand:!1},{command:$(`alerting`,`Notification policies, delivery destinations, silence windows, and alert history`,()=>import(`./alerting-D_qWrsoY.mjs`)),hideCommand:!0},{command:$(`analytics`,`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,()=>import(`./analytics-CwFrx-Dr.mjs`)),hideCommand:!0},{command:$(`analytics_engine`,`analytics_engine`,()=>import(`./analytics_engine-BjV6XLyG.mjs`)),hideCommand:!0},{command:$(`api-gateway`,`Discover, monitor, and protect your API endpoints with schema validation, abuse detection, and routing`,()=>import(`./api-gateway-D9PMVVqL.mjs`)),hideCommand:!0},{command:$(`argo`,`Network optimization features that speed up and improve reliability of traffic to your origins`,()=>import(`./argo-DwYGbyld.mjs`)),hideCommand:!0},{command:$(`artifacts`,`artifacts`,()=>import(`./artifacts-DKAjY_n4.mjs`)),hideCommand:!0},{command:$(`audit-logs`,`Immutable audit trail of actions taken by account members — who changed what and when`,()=>import(`./audit-logs-BvQ9uwuy.mjs`)),hideCommand:!0},{command:$(`billing`,`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,()=>import(`./billing-CRTlRU88.mjs`)),hideCommand:!0},{command:$(`bot-management`,`Bot detection and mitigation settings — configure bot scores, JavaScript detections, and challenge behavior`,()=>import(`./bot-management-DgW--8wM.mjs`)),hideCommand:!0},{command:$(`botnet-feed`,`Botnet threat intelligence feeds — IP and ASN-level data on known command-and-control infrastructure`,()=>import(`./botnet-feed-CIX6ZORT.mjs`)),hideCommand:!0},{command:$(`brand-protection`,`Monitor the Internet for phishing sites, lookalike domains, and unauthorized use of your brand assets`,()=>import(`./brand-protection-ZikBtl0y.mjs`)),hideCommand:!0},{command:$(`browser-rendering`,`browser-rendering`,()=>import(`./browser-rendering-D_ZQVWn8.mjs`)),hideCommand:!0},{command:$(`cache`,`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,()=>import(`./cache-CeN5t6_W.mjs`)),hideCommand:!0},{command:$(`calls`,`calls`,()=>import(`./calls-Cv0ieVg4.mjs`)),hideCommand:!0},{command:$(`certificate-authorities`,`Map client certificates to specific hostnames for mTLS authentication`,()=>import(`./certificate-authorities-BzZnWCac.mjs`)),hideCommand:!0},{command:$(`client-certificates`,`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,()=>import(`./client-certificates-BFuzeBrj.mjs`)),hideCommand:!0},{command:$(`cloud-connector`,`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,()=>import(`./cloud-connector-D5h8Dzzg.mjs`)),hideCommand:!0},{command:$(`cloudforce-one`,`Threat intelligence platform — request investigations, scan indicators, and track threat events`,()=>import(`./cloudforce-one-aqDCIBMp.mjs`)),hideCommand:!0},{command:$(`connectivity`,`Service directory for network connectivity endpoints and their configurations`,()=>import(`./connectivity-CjkXmEhO.mjs`)),hideCommand:!0},{command:$(`connector-interrupts`,`connector-interrupts`,()=>import(`./connector-interrupts-B7eSface.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-events`,`connector-telemetry-events`,()=>import(`./connector-telemetry-events-F3Co8HUf.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-snapshots`,`connector-telemetry-snapshots`,()=>import(`./connector-telemetry-snapshots-CQY8XMUg.mjs`)),hideCommand:!0},{command:$(`connectors`,`connectors`,()=>import(`./connectors-YYu_Vx3H.mjs`)),hideCommand:!0},{command:$(`content-scanning`,`content-scanning`,()=>import(`./content-scanning-BorfRGKT.mjs`)),hideCommand:!0},{command:$(`custom-certificates`,`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,()=>import(`./custom-certificates-CfRj7QZb.mjs`)),hideCommand:!0},{command:$(`custom-hostnames`,`Bring custom vanity domains to your SaaS zone with per-hostname SSL and origin mapping`,()=>import(`./custom-hostnames-CcK7_17e.mjs`)),hideCommand:!0},{command:$(`custom-nameservers`,`Vanity nameservers that use your own domain instead of Cloudflare-assigned NS records`,()=>import(`./custom-nameservers-BkKx0THn.mjs`)),hideCommand:!0},{command:$(`custom-pages`,`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,()=>import(`./custom-pages-DamGVA75.mjs`)),hideCommand:!0},{command:$(`d1`,`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,()=>import(`./d1-sK0O5THv.mjs`)),hideCommand:!0},{command:$(`data-security`,`data-security`,()=>import(`./data-security-DsWpoWiS.mjs`)),hideCommand:!0},{command:$(`dcv-delegation`,`Delegate domain control validation (DCV) to Cloudflare so certificates auto-renew without manual DNS changes`,()=>import(`./dcv-delegation-BYsNl3qc.mjs`)),hideCommand:!0},{command:$(`diagnostics`,`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,()=>import(`./diagnostics-CH7T2WR3.mjs`)),hideCommand:!0},{command:$(`dispatch-namespaces`,`Workers for Platforms dispatch namespaces — isolate customer Workers for SaaS and multi-tenant deployments`,()=>import(`./dispatch-namespaces-Bgj9XCRx.mjs`)),hideCommand:!0},{command:$(`dns`,`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,()=>import(`./dns-o7hUPMCG.mjs`)),hideCommand:!1},{command:$(`dns-firewall`,`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,()=>import(`./dns-firewall-VmQf3UVP.mjs`)),hideCommand:!0},{command:$(`durable-objects`,`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,()=>import(`./durable-objects-DgrTbvoF.mjs`)),hideCommand:!0},{command:$(`email-routing`,`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,()=>import(`./email-routing-owCvAEpf.mjs`)),hideCommand:!0},{command:$(`email-security`,`Cloud email security (Area 1) — investigate threats, manage allow/block policies, and detect phishing`,()=>import(`./email-security-Dng3DVuf.mjs`)),hideCommand:!0},{command:$(`email-sending`,`Send emails and manage sending subdomains`,()=>import(`./email-sending-bExMH4lu.mjs`)),hideCommand:!0},{command:$(`filters`,`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,()=>import(`./filters-DKs-wEzt.mjs`)),hideCommand:!0},{command:$(`firewall`,`Legacy firewall rules, zone lockdowns, access rules, user-agent blocking, and WAF packages`,()=>import(`./firewall-BLaTtX3r.mjs`)),hideCommand:!0},{command:$(`fraud`,`Fraud detection for login and signup flows — identify credential stuffing, account takeover, and fake accounts`,()=>import(`./fraud-D8WmLKyH.mjs`)),hideCommand:!0},{command:$(`google-tag-gateway`,`Google Tag Gateway operations`,()=>import(`./google-tag-gateway-DyCY43k0.mjs`)),hideCommand:!0},{command:$(`healthchecks`,`Standalone health checks that monitor origin server availability from Cloudflare's edge`,()=>import(`./healthchecks-BBtW8vRh.mjs`)),hideCommand:!0},{command:$(`hostnames`,`Per-hostname TLS settings — minimum TLS version, ciphers, and certificate pinning overrides`,()=>import(`./hostnames-Bh2IFxIw.mjs`)),hideCommand:!0},{command:$(`hyperdrive`,`Accelerate access to existing databases by caching queries and pooling connections at the edge`,()=>import(`./hyperdrive-DJm1eD-M.mjs`)),hideCommand:!0},{command:$(`iam`,`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,()=>import(`./iam-apCCcy7R.mjs`)),hideCommand:!0},{command:$(`images`,`images`,()=>import(`./images-Cxe45OHm.mjs`)),hideCommand:!1},{command:$(`intel`,`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,()=>import(`./intel-8V4h6H46.mjs`)),hideCommand:!0},{command:$(`ips`,`List Cloudflare's IP ranges used for proxying traffic — useful for firewall allowlisting`,()=>import(`./ips-BE7JbAnc.mjs`)),hideCommand:!0},{command:$(`keyless-certificates`,`Use your own SSL certificates without exposing private keys — keys stay on your infrastructure`,()=>import(`./keyless-certificates-CfJmXccT.mjs`)),hideCommand:!0},{command:$(`kv`,`Global, low-latency key-value storage for Workers — namespaces, keys, values, and bulk operations`,()=>import(`./kv-Dz6then8.mjs`)),hideCommand:!0},{command:$(`leaked-credential-checks`,`leaked-credential-checks`,()=>import(`./leaked-credential-checks-BJ-zQMlx.mjs`)),hideCommand:!0},{command:$(`load-balancers`,`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,()=>import(`./load-balancers-ilsGgudX.mjs`)),hideCommand:!0},{command:$(`logpush`,`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,()=>import(`./logpush-BH14TtuA.mjs`)),hideCommand:!0},{command:$(`logs`,`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,()=>import(`./logs-B8-mkf_I.mjs`)),hideCommand:!0},{command:$(`magic-cloud-networking`,`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,()=>import(`./magic-cloud-networking-DylCXoG4.mjs`)),hideCommand:!0},{command:$(`magic-network-monitoring`,`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,()=>import(`./magic-network-monitoring-DnyrZy77.mjs`)),hideCommand:!0},{command:$(`magic-transit`,`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,()=>import(`./magic-transit-B-kU5e3s.mjs`)),hideCommand:!0},{command:$(`managed-transforms`,`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,()=>import(`./managed-transforms-GC9Pq5dg.mjs`)),hideCommand:!0},{command:$(`mtls-certificates`,`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,()=>import(`./mtls-certificates-BRlhWw_G.mjs`)),hideCommand:!0},{command:$(`network-interconnects`,`Physical and virtual private interconnects between your infrastructure and Cloudflare's network`,()=>import(`./network-interconnects-DuyoFD9_.mjs`)),hideCommand:!0},{command:$(`observability`,`observability`,()=>import(`./observability-9APhqFHo.mjs`)),hideCommand:!0},{command:$(`organizations`,`Multi-user organizations that group accounts, members, and shared settings under a single entity`,()=>import(`./organizations-Dy3kiV_z.mjs`)),hideCommand:!0},{command:$(`origin-ca-certificates`,`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,()=>import(`./origin-ca-certificates-2rwPoQdG.mjs`)),hideCommand:!0},{command:$(`origin-post-quantum-encryption`,`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,()=>import(`./origin-post-quantum-encryption-BnBLTvEO.mjs`)),hideCommand:!0},{command:$(`origin-tls-client-auth`,`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,()=>import(`./origin-tls-client-auth-B30_2_dO.mjs`)),hideCommand:!0},{command:$(`page-rules`,`Legacy URL-pattern rules that override zone settings for matching requests — prefer Rules/Transform Rules instead`,()=>import(`./page-rules-zQJGmTCd.mjs`)),hideCommand:!0},{command:$(`page-shield`,`Client-side security — monitor JavaScript, connections, and cookies on your pages for supply-chain attacks`,()=>import(`./page-shield-CxQk5k9X.mjs`)),hideCommand:!0},{command:$(`pages`,`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,()=>import(`./pages-5DKLs7CQ.mjs`)),hideCommand:!0},{command:$(`pipelines`,`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,()=>import(`./pipelines-DfGE44xo.mjs`)),hideCommand:!0},{command:$(`queues`,`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,()=>import(`./queues-BoenUGIw.mjs`)),hideCommand:!0},{command:$(`r2`,`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,()=>import(`./r2-Cq_JCjK0.mjs`)),hideCommand:!0},{command:$(`r2-data-catalog`,`Iceberg-compatible data catalog for R2 — organize objects into tables and namespaces for SQL query engines`,()=>import(`./r2-data-catalog-eLxltWdO.mjs`)),hideCommand:!0},{command:$(`radar`,`radar`,()=>import(`./radar-YNOCio6T.mjs`)),hideCommand:!0},{command:$(`rate-limits`,`Legacy per-zone rate limiting rules — prefer Advanced Rate Limiting in Rulesets for new configurations`,()=>import(`./rate-limits-CcAF3tMl.mjs`)),hideCommand:!0},{command:$(`realtime-kit`,`Real-time video and audio — meetings, livestreams, recordings, and session management via Cloudflare Calls`,()=>import(`./realtime-kit-4bCGviO5.mjs`)),hideCommand:!0},{command:$(`registrar`,`Domain registration and transfer management through Cloudflare Registrar`,()=>import(`./registrar-CfHlaOOf.mjs`)),hideCommand:!1},{command:$(`request-tracers`,`request-tracers`,()=>import(`./request-tracers-DlHawg5l.mjs`)),hideCommand:!0},{command:$(`resource-sharing`,`resource-sharing`,()=>import(`./resource-sharing-7FhuboJE.mjs`)),hideCommand:!0},{command:$(`resource-tagging`,`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,()=>import(`./resource-tagging-divcugVb.mjs`)),hideCommand:!0},{command:$(`rules`,`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,()=>import(`./rules-CAXkege8.mjs`)),hideCommand:!0},{command:$(`rulesets`,`Versioned collections of rules that control how Cloudflare processes traffic — WAF, transform, redirect, and more`,()=>import(`./rulesets-CBsdc8IV.mjs`)),hideCommand:!0},{command:$(`rum`,`rum`,()=>import(`./rum-D0hHPNl9.mjs`)),hideCommand:!0},{command:$(`schema-validation`,`API schema validation settings — enforce request/response schemas and configure validation behavior`,()=>import(`./schema-validation-BWNDnnIT.mjs`)),hideCommand:!0},{command:$(`scim`,`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,()=>import(`./scim-CWLli4fi.mjs`)),hideCommand:!0},{command:$(`secrets-store`,`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,()=>import(`./secrets-store-B7_HkE8I.mjs`)),hideCommand:!0},{command:$(`security-center`,`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,()=>import(`./security-center-BQT21oiM.mjs`)),hideCommand:!0},{command:$(`security-txt`,`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,()=>import(`./security-txt-CVpmJo29.mjs`)),hideCommand:!0},{command:$(`smart-shield`,`Smart Shield settings, health checks, and cache reserve management`,()=>import(`./smart-shield-BreBC1Ap.mjs`)),hideCommand:!0},{command:$(`snippets`,`Lightweight JavaScript snippets that run on requests before Workers — for quick header modifications and redirects`,()=>import(`./snippets-BAJoWMSJ.mjs`)),hideCommand:!0},{command:$(`spectrum`,`Proxy and protect arbitrary TCP/UDP applications through Cloudflare's network with DDoS mitigation`,()=>import(`./spectrum-DnIRLY95.mjs`)),hideCommand:!0},{command:$(`speed`,`speed`,()=>import(`./speed-UYEVue28.mjs`)),hideCommand:!0},{command:$(`ssl`,`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,()=>import(`./ssl-D3Pixs8M.mjs`)),hideCommand:!0},{command:$(`stream`,`stream`,()=>import(`./stream-BUsuOfQh.mjs`)),hideCommand:!0},{command:$(`tenants`,`Multi-tenant account management — manage tenant accounts, entitlements, and memberships`,()=>import(`./tenants-BdWJTtcg.mjs`)),hideCommand:!0},{command:$(`token-validation`,`Validate JWT tokens at the edge — configure token sources, signing keys, and validation rules`,()=>import(`./token-validation-DUvtXWur.mjs`)),hideCommand:!0},{command:$(`turnstile`,`turnstile`,()=>import(`./turnstile-CAKVnS1L.mjs`)),hideCommand:!0},{command:$(`url-normalization`,`Normalize incoming request URLs to a consistent format before rule evaluation and caching`,()=>import(`./url-normalization-DA-RAxs4.mjs`)),hideCommand:!0},{command:$(`url-scanner`,`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,()=>import(`./url-scanner-DmYu43f7.mjs`)),hideCommand:!0},{command:$(`user`,`Your Cloudflare user profile, invitations, organizations, billing, and personal API tokens`,()=>import(`./user-Bah4wGGN.mjs`)),hideCommand:!0},{command:$(`vectorize`,`Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers`,()=>import(`./vectorize-DhvVG2By.mjs`)),hideCommand:!0},{command:$(`waiting-rooms`,`Virtual queues that throttle traffic to your site during peak demand with customizable waiting pages`,()=>import(`./waiting-rooms-DoOkT4Mu.mjs`)),hideCommand:!0},{command:$(`web3`,`Web3 gateways — serve IPFS and Ethereum content through custom hostnames on Cloudflare`,()=>import(`./web3-n3GW50u-.mjs`)),hideCommand:!0},{command:$(`workers`,`Deploy and manage serverless JavaScript/WASM applications on Cloudflare's global network`,()=>import(`./workers-D6IaQ_F0.mjs`)),hideCommand:!0},{command:$(`workers-builds`,`Automated build and deployment pipeline for Workers — track builds, logs, and repo connections`,()=>import(`./workers-builds-DYi0OMMU.mjs`)),hideCommand:!0},{command:$(`workflows`,`Durable, multi-step workflows that run on Workers with automatic retries and state persistence`,()=>import(`./workflows-DrdXUQ2g.mjs`)),hideCommand:!0},{command:$(`zaraz`,`Server-side tag manager — load third-party tools (analytics, pixels, etc.) from Cloudflare's edge without client-side JS`,()=>import(`./zaraz-9l7KuLqh.mjs`)),hideCommand:!0},{command:$(`zero_trust`,`zero_trust`,()=>import(`./zero_trust-BzXKAX_x.mjs`)),hideCommand:!0},{command:$(`zero-trust`,`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,()=>import(`./zero-trust-D6V9GH2W.mjs`)),hideCommand:!0},{command:$(`zones`,`Zones are domains on Cloudflare — list, create, and configure domain settings`,()=>import(`./zones-0MTkuaFk.mjs`)),hideCommand:!1}];function dr(e){try{let t=new URL(e);return`${t.pathname.replace(/^\/client\/v\d+/,``)}${t.search}`}catch{return e}}function fr(e){if(a(s),e instanceof c){let t=d(),n=e.statusCode,r=e.body,i=n===void 0?`Envelope Error`:mr(n),a=[];if(r){let e=r;Array.isArray(e.errors)&&(a=e.errors)}let o=e.rawResponse?.url?`HTTP ${dr(e.rawResponse.url)}`:void 0,s=n===void 0?i:`${n} ${i}`,c=o?`${s} · ${o}`:s,l=t.dim(c),u=``;return a.length>0?u=a.map((e,n)=>{let r=typeof e.code==`number`?t.hex(f.error).bold(`[${e.code}]`):t.hex(f.error).bold(`[error]`),i=t.bold(e.message??``);return n===a.length-1?`${r} ${i}\n${l}`:`${r} ${i}`}).join(`
|
|
99
99
|
|
|
100
100
|
`):(u=t.hex(f.error).bold(e.message||c),e.message&&c&&(u+=`\n${l}`)),console.error(p(u,void 0,{title:`APIError`,rawMessage:!0})),n===401?console.error(`
|
|
101
101
|
`+m(`Try running: cf auth login`)):n===403&&console.error(`
|
|
@@ -103,6 +103,6 @@ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name
|
|
|
103
103
|
|
|
104
104
|
`)}else{let n=t.hex(f.error).bold(e.message);a=r?`${n}\n${r}`:n}return console.error(p(a,void 0,{title:`APIError`,rawMessage:!0})),e.status===401?console.error(`
|
|
105
105
|
`+m(`Try running: cf auth login`)):e.status===403&&console.error(`
|
|
106
|
-
`+m(`Check your API token permissions`)),e}if(e instanceof Error){let t=process.env.DEBUG&&e.stack?pr(e.stack):void 0;return console.error(p(e.message,t)),e}return console.error(p(`An unexpected error occurred`,String(e))),e}function pr(e){return e.replace(/[A-Za-z0-9_-]{40,}/g,`[REDACTED]`)}function mr(e){return{400:`Bad Request`,401:`Unauthorized`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,409:`Conflict`,422:`Unprocessable Entity`,429:`Too Many Requests`,500:`Internal Server Error`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`}[e]??``}const hr=$(`auth`,`Manage authentication and profiles`,()=>import(`./auth-
|
|
106
|
+
`+m(`Check your API token permissions`)),e}if(e instanceof Error){let t=process.env.DEBUG&&e.stack?pr(e.stack):void 0;return console.error(p(e.message,t)),e}return console.error(p(`An unexpected error occurred`,String(e))),e}function pr(e){return e.replace(/[A-Za-z0-9_-]{40,}/g,`[REDACTED]`)}function mr(e){return{400:`Bad Request`,401:`Unauthorized`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,409:`Conflict`,422:`Unprocessable Entity`,429:`Too Many Requests`,500:`Internal Server Error`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`}[e]??``}const hr=$(`auth`,`Manage authentication and profiles`,()=>import(`./auth-TYwGydWg.mjs`)),gr=$(`context`,`Manage default account and zone context`,()=>import(`./context-C-WbewL6.mjs`)),_r=$(`complete [shell]`,`Generate and handle shell completions`,()=>import(`./completions-Bvzav4Mj.mjs`)),vr=$(`schema [command..]`,`Show API schema details for a command`,()=>import(`./schema-D8o6HcCr.mjs`)),yr=$(`agent-context [product]`,`Output agent context and tool definitions`,()=>import(`./agent-context-CKb6w43K.mjs`)),br=$(`tools`,!1,()=>import(`./tools-CQtA5-cr.mjs`)),xr=$(`dev [implArgs..]`,`Run the project's Cloudflare dev server`,()=>import(`./dev-IOg-_s5_.mjs`)),Sr=$(`build`,`Build a project for Cloudflare`,()=>import(`./build-Bgw8TV1p.mjs`).then(e=>e.t)),Cr=$(`deploy`,`Deploy a project to Cloudflare`,()=>import(`./deploy-BzlPv3ro.mjs`)),wr=$(`versions`,`Manage Worker Versions`,()=>import(`./versions-NUXxCr0s.mjs`));function Tr(e){return e.includes(`--quiet`)||e.includes(`-q`)}function Er(){process.stderr.isTTY&&(Tr(process.argv.slice(2))||process.argv.slice(2).find(e=>!e.startsWith(`-`))!==`complete`&&import(`./config-B5k-XbwS.mjs`).then(e=>e.t).then(({loadConfig:e,updateConfig:t})=>{e().completions?.prompted||(process.stderr.write(u.muted("Tip: run `cf complete <bash|zsh|fish>` to install shell completions.\n")),t({completions:{prompted:!0}}))}))}function Dr(){let e=process.argv.slice(2);return!e.includes(`--version`)&&!e.includes(`-v`)?!1:(console.log(i(s)),!0)}function Or(){if(process.argv.slice(2).length>0)return!1;let e=[i(s),``,`The Cloudflare CLI — manage your account, zones, and developer platform.`,``,`${u.bold(`Get started:`)}`,` ${u.code(`cf auth login`)} ${u.muted(`Authenticate with Cloudflare`)}`,` ${u.code(`cf --help`)} ${u.muted(`Browse all commands`)}`,` ${u.code(`cf <command> --help`)} ${u.muted(`Per-command help`)}`,` ${u.code(`cf complete bash`)} ${u.muted(`Install shell completions`)}`,``,`${u.bold(`Docs:`)} ${u.brand(`https://developers.cloudflare.com/`)}`,``];return console.log(e.join(`
|
|
107
107
|
`)),!0}function kr(){let e=process.argv.slice(2);e.length!==0&&(e.includes(`--version`)||e.includes(`-v`)||e.find(e=>!e.startsWith(`-`))!==`complete`&&a(s,{quiet:Tr(e)}))}function Ar(e){let t=e=>u.brand(e),n=lr(e).scriptName(`cf`).usage(`$0 <command> [options]`).usage(`
|
|
108
|
-
The Cloudflare CLI - manage your Cloudflare resources`).updateStrings({"Commands:":t(`Commands`),"Options:":t(`Options`),"Positionals:":t(`Positionals`),"Examples:":t(`Examples`)}).help(`help`,`Show help`).alias(`h`,`help`).option(`quiet`,{type:`boolean`,alias:`q`,description:`Suppress non-essential output`,global:!0,default:!1}).option(`zone`,{type:`string`,alias:`z`,description:`Zone ID or domain name (overrides CLOUDFLARE_ZONE_ID)`,global:!0}).option(`profile`,{type:`string`,description:`Use a specific auth profile`,requiresArg:!0,global:!0}).option(`local`,{type:`boolean`,description:"Route to a local `wrangler dev` / `cf dev` Miniflare session",global:!0,default:!1}).option(`local-endpoint`,{type:`string`,description:`Local Miniflare endpoint URL (required with --local until auto-discovery ships)`,global:!0}).group([`quiet`,`zone`,`profile`,`local`,`local-endpoint`,`help`,`version`],t(`Global flags`)).command(hr).command(gr).command(Sr).command(_r).command(Cr).command(xr).command(wr).command(vr).command(yr).command(br);for(let e of ur)e.hideCommand?n.command({...e.command,describe:!1}):n.command(e.command);return n.middleware(async e=>{if(e.local&&!e.localEndpoint)throw Error("--local requires --local-endpoint <url> (e.g. http://127.0.0.1:8787).\nDiscovery via the dev registry will land in a future release; until then,\npoint cf at your running `wrangler dev` / `cf dev` session explicitly.");if(!e.local){let{resolveProfile:t}=await import(`./oauth-
|
|
108
|
+
The Cloudflare CLI - manage your Cloudflare resources`).updateStrings({"Commands:":t(`Commands`),"Options:":t(`Options`),"Positionals:":t(`Positionals`),"Examples:":t(`Examples`)}).help(`help`,`Show help`).alias(`h`,`help`).option(`quiet`,{type:`boolean`,alias:`q`,description:`Suppress non-essential output`,global:!0,default:!1}).option(`zone`,{type:`string`,alias:`z`,description:`Zone ID or domain name (overrides CLOUDFLARE_ZONE_ID)`,global:!0}).option(`profile`,{type:`string`,description:`Use a specific auth profile`,requiresArg:!0,global:!0}).option(`local`,{type:`boolean`,description:"Route to a local `wrangler dev` / `cf dev` Miniflare session",global:!0,default:!1}).option(`local-endpoint`,{type:`string`,description:`Local Miniflare endpoint URL (required with --local until auto-discovery ships)`,global:!0}).group([`quiet`,`zone`,`profile`,`local`,`local-endpoint`,`help`,`version`],t(`Global flags`)).command(hr).command(gr).command(Sr).command(_r).command(Cr).command(xr).command(wr).command(vr).command(yr).command(br);for(let e of ur)e.hideCommand?n.command({...e.command,describe:!1}):n.command(e.command);return n.middleware(async e=>{if(e.local&&!e.localEndpoint)throw Error("--local requires --local-endpoint <url> (e.g. http://127.0.0.1:8787).\nDiscovery via the dev registry will land in a future release; until then,\npoint cf at your running `wrangler dev` / `cf dev` session explicitly.");if(!e.local){let{resolveProfile:t}=await import(`./oauth-B5k80sip.mjs`).then(e=>e.c);r(t(e.profile))}}).demandCommand(1,`You need to specify a command`).strict().version(s).alias(`v`,`version`).epilogue(`For more information, visit https://developers.cloudflare.com/`).exitProcess(!1).fail((e,t,n)=>{if(t)throw t;if(e===`Please specify a subcommand`){n.showHelp(`log`);return}throw n.showHelp(`error`),Error(e)}),n}var jr=class extends Error{constructor(e){super(`CliExit(${e})`),this.code=e,this.name=`CliExit`}};async function Mr(e){let t=process.argv;process.argv=[`node`,`cf`,...e];try{await Nr()}finally{process.argv=t}}async function Nr(){if(Dr()||Or())throw new jr(0);kr();let e=Ar(ct(process.argv));Er();try{await e.parse(ct(process.argv))}catch(e){throw e instanceof jr?e:fr(e)}}export{Mr as i,Ar as n,Nr as r,jr as t};
|