cf 1.0.0-beta.1 → 1.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/_meta/commands.json +11448 -13819
- package/dist/_meta/hand-written-commands.json +579 -41
- package/dist/_meta/schemas.json +14496 -16450
- package/dist/abuse-reports-DX5xgeka.mjs +24 -0
- package/dist/access-DuHs0Mii.mjs +2 -0
- package/dist/{account-tags-DAf-hq1m.mjs → account-tags-CiKwgOWd.mjs} +6 -6
- package/dist/{accounts-BDIKjiG2.mjs → accounts-DfXSHrkF.mjs} +63 -57
- package/dist/{acm-D-q1FVWJ.mjs → acm-BgSr3Ig4.mjs} +7 -7
- package/dist/{addressing-0w2U1NEy.mjs → addressing-B70NFnrX.mjs} +43 -43
- package/dist/agent-context-GRiQ4zRU.mjs +2 -0
- package/dist/{agent-memory-Drumm4qd.mjs → agent-memory-DJRquHeq.mjs} +15 -15
- package/dist/ai-CP2oIS-I.mjs +29 -0
- package/dist/{ai-audit-CPrmohqf.mjs → ai-audit-Bn_BfMFS.mjs} +3 -3
- package/dist/ai-gateway-CrrEtzUP.mjs +82 -0
- package/dist/{ai-search-B5l4IDSR.mjs → ai-search-C4YWVTCa.mjs} +42 -42
- package/dist/{ai-security-C7_IGDDl.mjs → ai-security-Bt_fG65f.mjs} +4 -4
- package/dist/{alerting-B6m1Rhf4.mjs → alerting-CRr88fVR.mjs} +26 -26
- package/dist/{analytics-nnzFBB_7.mjs → analytics-XqS9OP5B.mjs} +11 -12
- package/dist/{analytics_engine-BvjKCwn1.mjs → analytics_engine-CzmYem4f.mjs} +2 -2
- package/dist/{api-security-B9IozS2a.mjs → api-security-gB1FHrHq.mjs} +57 -57
- package/dist/{argo-C_QcqR6P.mjs → argo-wFCAsYx7.mjs} +5 -5
- package/dist/args-CXgkQKK7.mjs +2 -0
- package/dist/{artifacts-DDFNpYBz.mjs → artifacts-qFjlNRqb.mjs} +20 -20
- package/dist/{audit-logs-cTzNV0DV.mjs → audit-logs-CpPUjMUP.mjs} +2 -2
- package/dist/auth-7Fk7PVIC.mjs +2 -0
- package/dist/auth-BmJ946bE.mjs +2 -0
- package/dist/auth-Br-t8vL_.mjs +2 -0
- package/dist/auth-token-DeG33BMQ.mjs +8 -0
- package/dist/autoconfig-D-copdZG.mjs +511 -0
- package/dist/banner-Xk4xBN8U.mjs +2 -0
- package/dist/basin-catalog-CshcpsAH.mjs +46 -0
- package/dist/{billing-DU2X-q-x.mjs → billing-B-xNxxiP.mjs} +11 -11
- package/dist/{bot-management-BHAAoZOh.mjs → bot-management-DhafeA2J.mjs} +4 -4
- package/dist/{botnet-feed-DOOnGVVY.mjs → botnet-feed-D6uCLE_D.mjs} +5 -5
- package/dist/{brand-protection-C_DYa7IK.mjs → brand-protection-c3WiHbYn.mjs} +13 -13
- package/dist/browser-extension-Dee2Y1qn.mjs +2 -0
- package/dist/{browser-run-Dw-vgWGR.mjs → browser-run-D9_cwaSD.mjs} +24 -24
- package/dist/build-9ihDp-Gy.mjs +2 -0
- package/dist/build-DrG6TqMw.mjs +2 -0
- package/dist/{builds-CO0MmSd3.mjs → builds-Dl8if-2k.mjs} +32 -32
- package/dist/cache-CIZokBjd.mjs +45 -0
- package/dist/{certificate-authorities-Dmxh7w-Z.mjs → certificate-authorities-NUQzCDK8.mjs} +3 -3
- package/dist/cf-DfQfIu3q.mjs +18 -0
- package/dist/chunk-FT2NMTJB-BFqlGcem.mjs +97 -0
- package/dist/chunk-KKDV4JPS-B_t8sDTz.mjs +2 -0
- package/dist/chunk-U6NEESU5-BhF4rnpx.mjs +2 -0
- package/dist/chunk-WMOON6TZ-B8xCqjB1.mjs +2 -0
- package/dist/cli-aChy8ou_.mjs +6 -0
- package/dist/cli-exit-Dqoo6Jgb.mjs +2 -0
- package/dist/client-certificates-qgLpBn8t.mjs +13 -0
- package/dist/{client-side-security-D7NWV0YH.mjs → client-side-security-DZO6Xw14.mjs} +14 -14
- package/dist/{cloud-connector-XMFOTNqT.mjs → cloud-connector-C7vGDCzX.mjs} +3 -3
- package/dist/{cloudflared-DhItYrCq.mjs → cloudflared-CEfZhSQH.mjs} +1 -1
- package/dist/{cloudforce-one-Cew4MHvA.mjs → cloudforce-one-CE7y5UkF.mjs} +237 -246
- package/dist/command-07vhr56i.mjs +2 -0
- package/dist/command-B6TpINoN.mjs +2 -0
- package/dist/command-BWC9CbE7.mjs +2 -0
- package/dist/command-BsmF3J_l.mjs +2 -0
- package/dist/command-C2pNxAeL.mjs +2 -0
- package/dist/command-C65Ed0o9.mjs +2 -0
- package/dist/command-Cdx___59.mjs +2 -0
- package/dist/command-CrtDkZNs.mjs +2 -0
- package/dist/command-D0MKPucK.mjs +2 -0
- package/dist/command-DHdWKtqx.mjs +2 -0
- package/dist/command-Ds5OVat3.mjs +2 -0
- package/dist/command-Dv6YavZa.mjs +2 -0
- package/dist/command-dAYWrB5y.mjs +2 -0
- package/dist/command-eM48o0J6.mjs +2 -0
- package/dist/command-maDJWJgu.mjs +2 -0
- package/dist/{completions-xPLd1cvL.mjs → completions-D0280hul.mjs} +26 -26
- package/dist/{connector-interrupts-BfQN_pm6.mjs → connector-interrupts-CVjFhU-C.mjs} +3 -3
- package/dist/{connector-telemetry-events-B7qLZsZJ.mjs → connector-telemetry-events-Bu3LKP6T.mjs} +3 -3
- package/dist/{connector-telemetry-snapshots-Ckvg9BPc.mjs → connector-telemetry-snapshots-BbDTIc06.mjs} +3 -3
- package/dist/{connectors-BhvAP5fb.mjs → connectors-DGtx-rPI.mjs} +7 -7
- package/dist/{containers-Cq1gtnq6.mjs → containers-CzNbBrYE.mjs} +70 -72
- package/dist/{containers-Bl3EY-cy.mjs → containers-DEFrbNgO.mjs} +17 -17
- package/dist/{content-scan-BYGe9fFj.mjs → content-scan-BCtWBCqd.mjs} +6 -6
- package/dist/context-CquYYyS3.mjs +7 -0
- package/dist/{cps-BWMDWeVq.mjs → cps-C8BbnbuD.mjs} +1 -1
- package/dist/{csamScanner-DMYGzLNi.mjs → csamScanner-CsJ9H2fA.mjs} +3 -3
- package/dist/{ct-alerting-Vq4l2s7n.mjs → ct-alerting-CYsQZO2H.mjs} +3 -3
- package/dist/{custom-certificates-BDEHH0Ym.mjs → custom-certificates-CA8HqolM.mjs} +8 -8
- package/dist/{custom-csrs-CHSkZNdX.mjs → custom-csrs-D0P2vWJE.mjs} +5 -5
- package/dist/{custom-hostnames-Bch3iQZC.mjs → custom-hostnames-CzYMChbh.mjs} +12 -12
- package/dist/{custom-nameservers-Tdvu1-vr.mjs → custom-nameservers-Cet3oF56.mjs} +5 -5
- package/dist/{custom-pages-rFsiIXlr.mjs → custom-pages-DUkHIaTP.mjs} +10 -10
- package/dist/d1-B2duXfH2.mjs +41 -0
- package/dist/{dcv-delegation-D6xiYj2l.mjs → dcv-delegation-BkdRVEAH.mjs} +2 -2
- package/dist/{delegate-GctF_lrq.mjs → delegate-CCGgla7X.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-D04Xvm0m.mjs → deploy-BdWBEbLj.mjs} +1 -1
- package/dist/{deploy-input-COEKxOA1.mjs → deploy-input-LmLfj6kI.mjs} +1 -1
- package/dist/dev-BHkVwAea.mjs +4 -0
- package/dist/{diagnostics-BZVAAguV.mjs → diagnostics-9Wj5UWBL.mjs} +7 -7
- package/dist/dialog-Dpi-UVbz.mjs +2 -0
- package/dist/discover-BYkHr5Ja.mjs +2 -0
- package/dist/discover-t6E9lpf3.mjs +2 -0
- package/dist/{dist-BpadEMNY.mjs → dist-Cpb7_h4N.mjs} +35 -35
- package/dist/dist-D1iG7guo.mjs +366 -0
- package/dist/dist-zep5OXGt.mjs +48 -0
- package/dist/{dls-BsnURYja.mjs → dls-Caya7FZc.mjs} +8 -8
- package/dist/{dns-B_nTXhuM.mjs → dns-BLNa0GrP.mjs} +72 -63
- package/dist/{dns-firewall-DDsrdulo.mjs → dns-firewall-ChCvC5rT.mjs} +8 -8
- package/dist/dot-prop-IITUZ2XW-BsZYdILY.mjs +2 -0
- package/dist/dotenv-CcQjGlV0.mjs +4 -0
- package/dist/dry-run-p9Q7nMZ5.mjs +2 -0
- package/dist/durable-objects-DuRbdp7N.mjs +6 -0
- package/dist/{email-auth-CzjtGH6g.mjs → email-auth-C28s03aI.mjs} +3 -3
- package/dist/{email-routing-B92fty1-.mjs → email-routing-Ci-xjXIN.mjs} +24 -24
- package/dist/email-security-DPU6xvI9.mjs +158 -0
- package/dist/{email-sending-B7f95epu.mjs → email-sending-kTVAlVKO.mjs} +23 -23
- package/dist/error-sanitization-BbEw--0B.mjs +2 -0
- package/dist/error-sanitization-p5rmb53x.mjs +2 -0
- package/dist/errors-cuuW88wR.mjs +3 -0
- package/dist/{fieldExtractors-DL_H1m7E.mjs → fieldExtractors-ceaXu4zD.mjs} +4 -4
- package/dist/firewall-BND3qSY2.mjs +36 -0
- package/dist/flagship-DfxbNzgx.mjs +28 -0
- package/dist/{fraud-DU_YCLC5.mjs → fraud-DgyYv_CC.mjs} +3 -3
- package/dist/generate-9P8Q_RiO.mjs +2 -0
- package/dist/generate-VxmGG8BF.mjs +3 -0
- package/dist/{google-tag-gateway-xqN-QudN.mjs → google-tag-gateway-v3p7murv.mjs} +3 -3
- package/dist/gt-KlYHH-UC.mjs +2 -0
- package/dist/{healthchecks-COnq1YOx.mjs → healthchecks-CByb4qYA.mjs} +10 -10
- package/dist/{hostnames-CxRAY_Pp.mjs → hostnames-3CqeMF5g.mjs} +6 -6
- package/dist/hyperdrive-CmyYTE-K.mjs +37 -0
- package/dist/{iam-CtX9NPCy.mjs → iam-CV_M681j.mjs} +24 -24
- package/dist/{images-CuWFOsGw.mjs → images-DaLPjskW.mjs} +33 -33
- package/dist/index.mjs +1 -1
- package/dist/init-CBKifk5L.mjs +39 -0
- package/dist/{intel-BeGV3VXt.mjs → intel-MpftjuPB.mjs} +36 -36
- package/dist/interactive-D80kbTap.mjs +32 -0
- package/dist/interactive-mJQ_IrGd.mjs +2 -0
- package/dist/{ips-d6aoKAI4.mjs → ips-WWvPwSBc.mjs} +1 -1
- package/dist/k2-D0QYUFqT.mjs +13 -0
- package/dist/keyless-certificates-DqILy3t9.mjs +13 -0
- package/dist/{keys-Fyf3vWcA.mjs → keys-DhX4AcqF.mjs} +2 -2
- package/dist/kv-DLUfUL0_.mjs +15 -0
- package/dist/lazy-command--5YpWUVY.mjs +2 -0
- package/dist/{leaked-credential-checks-B7ewx3W-.mjs → leaked-credential-checks-C0U1oYM5.mjs} +8 -8
- package/dist/{load-balancers-DHD4f2CT.mjs → load-balancers-BJKI9lm7.mjs} +39 -39
- package/dist/local-DkYQiSQQ.mjs +2 -0
- package/dist/{local-B6b2OIBW.mjs → local-rYpzEQb-.mjs} +1 -1
- package/dist/{local-runtime-DD8DAIlm.mjs → local-runtime-DZTTIe6x.mjs} +1 -1
- package/dist/login-CnE2Ii_F.mjs +2 -0
- package/dist/login-bnylLTit.mjs +5 -0
- package/dist/{logo-matches-BAX8v3iL.mjs → logo-matches-DFZybI0C.mjs} +3 -3
- package/dist/{logos-BWBVGwU6.mjs → logos-Da2YtqSN.mjs} +4 -4
- package/dist/{logpush-CZKR8DHO.mjs → logpush-Q7WIEHS1.mjs} +23 -23
- package/dist/logs-c3b3USyS.mjs +36 -0
- package/dist/{magic-cloud-networking-DttrBXqd.mjs → magic-cloud-networking-BoyDmFq3.mjs} +37 -37
- package/dist/{magic-network-monitoring-9VXDSYuL.mjs → magic-network-monitoring-BkUbpMUp.mjs} +18 -18
- package/dist/{magic-transit-Dsu_cSGM.mjs → magic-transit-4-THD45G.mjs} +161 -165
- package/dist/{managed-defense-SYreve4W.mjs → managed-defense-CTMqSp6z.mjs} +9 -9
- package/dist/{managed-transforms-CzSy_xPw.mjs → managed-transforms-DcYAvqTe.mjs} +4 -4
- package/dist/{matches-qf7GReyu.mjs → matches-hnU16rSJ.mjs} +3 -3
- package/dist/{mcp-DYSk5_gc.mjs → mcp-kZX4irfN.mjs} +15 -15
- package/dist/{mesh-DdY07OYt.mjs → mesh-Dxzvvso6.mjs} +12 -12
- package/dist/migrate-BNvUWrjy.mjs +2 -0
- package/dist/monetization-Dsqj9DCA.mjs +20 -0
- package/dist/mtls-certificates-BSbMwIna.mjs +13 -0
- package/dist/{network-interconnects-C4uUoeNa.mjs → network-interconnects-osO_vAPu.mjs} +17 -17
- package/dist/{network-DpaZ5LJL.mjs → network-mEnXTEiG.mjs} +24 -24
- package/dist/oauth-CeZ3d_dB.mjs +9 -0
- package/dist/{oauth-clients-D7Ou7oAS.mjs → oauth-clients-CWPHi-Yn.mjs} +7 -7
- package/dist/{oauth-scopes-BFoE82Mv.mjs → oauth-scopes-CxpRD6d7.mjs} +1 -1
- package/dist/{oauth-nsTDJ0dF.mjs → oauth-w0fWmrwU.mjs} +1 -1
- package/dist/{observability-smcOFbC1.mjs → observability-BxL2RqWZ.mjs} +44 -44
- package/dist/open-PCXX3ZDZ-C7gpxSsl.mjs +4 -0
- package/dist/{organization-Dyf_0mq4.mjs → organization-DNieJ1xJ.mjs} +7 -7
- package/dist/{organizations-D7zGPLVm.mjs → organizations-BIXPmTy5.mjs} +1 -1
- package/dist/{origin-ca-certificates-DJrp29gv.mjs → origin-ca-certificates-dVJvSIH8.mjs} +3 -3
- package/dist/{origin-post-quantum-encryption-BYj3kJiq.mjs → origin-post-quantum-encryption-CO6tDW1t.mjs} +3 -3
- package/dist/{origin-tls-client-auth-j0tGh6Fy.mjs → origin-tls-client-auth-DeTY8aN2.mjs} +14 -14
- package/dist/output-ClYel9WX.mjs +2 -0
- package/dist/{page-rules-CLzba_nr.mjs → page-rules-DA552Ra4.mjs} +7 -7
- package/dist/pages-B0x7tidm.mjs +54 -0
- package/dist/{pay-per-crawl-DbaTVI8V.mjs → pay-per-crawl-DoTg9VP7.mjs} +32 -32
- package/dist/{pay-per-use-BEvtoppJ.mjs → pay-per-use-yRO2QBfe.mjs} +3 -3
- package/dist/{pipelines-lps71uoA.mjs → pipelines-CQxrm9ao.mjs} +20 -20
- package/dist/precursor-FiGYDRV9.mjs +4 -0
- package/dist/previews-BthBa50j.mjs +4 -0
- package/dist/progress-TLUEIYE6.mjs +2 -0
- package/dist/prompt-Ck_1PCHm.mjs +3 -0
- package/dist/{queries-EJYlFw8m.mjs → queries-C0RRdol7.mjs} +4 -4
- package/dist/{queues-CozKGaA4.mjs → queues-sLgvjsRP.mjs} +29 -35
- package/dist/r2-C2PllL6i.mjs +125 -0
- package/dist/r2-data-catalog-Bg7zq1IB.mjs +2 -0
- package/dist/{radar-NmpdyMo5.mjs → radar-Bez6k9Dw.mjs} +1 -1
- package/dist/raw-fetch-DNxNCoeP.mjs +2 -0
- package/dist/{realtime-iWTz8WbH.mjs → realtime-D-HSXznX.mjs} +78 -78
- package/dist/{registrar-Cza1L8i_.mjs → registrar-DwHrG9QR.mjs} +9 -9
- package/dist/{registrar-sandbox-BP4GQg5s.mjs → registrar-sandbox-jNukmzQP.mjs} +6 -6
- package/dist/{registry-vreNkX6u.mjs → registry-CsSLAAOE.mjs} +1 -1
- package/dist/{reporting-gvXX2MxY.mjs → reporting-DolhAb10.mjs} +7 -7
- package/dist/request-headers-Lhj314mk.mjs +2 -0
- package/dist/{request-tracers-F8a_aj32.mjs → request-tracers-w72hKc33.mjs} +2 -2
- package/dist/resolve-Djf2xgBx.mjs +2 -0
- package/dist/{resource-sharing-D6XWIDmb.mjs → resource-sharing-DTrSkqI4.mjs} +18 -18
- package/dist/{resource-tagging-c_z4VZt0.mjs → resource-tagging-aURR4fIJ.mjs} +2 -2
- package/dist/{rules-_QDaG3U5.mjs → rules-C8a7cV-W.mjs} +8 -8
- package/dist/{rulesets-Bc4ZuPG_.mjs → rulesets-RJ6yBefy.mjs} +20 -20
- package/dist/{rum-ChPyfpM2.mjs → rum-Bk1dPW4p.mjs} +14 -14
- package/dist/run-BJOAPmsz.mjs +2 -0
- package/dist/run-iFM5TxtQ.mjs +2 -0
- package/dist/{schema-flags-C9lbLgE-.mjs → schema-flags-PagOq-G2.mjs} +2 -2
- package/dist/schema-v7mOxMdx.mjs +2 -0
- package/dist/{scim-BjiswXbC.mjs → scim-C0FmjkkV.mjs} +10 -10
- package/dist/{secrets-store-Cn3D5a0d.mjs → secrets-store-cG_5RMzK.mjs} +11 -11
- package/dist/security-insights-DVAqroY5.mjs +40 -0
- package/dist/{security-txt-CaR5Idmz.mjs → security-txt-rfrrdiZV.mjs} +4 -4
- package/dist/session-B6mFkaVZ.mjs +2 -0
- package/dist/shared-BqsWoApw.mjs +2 -0
- package/dist/{smart-shield-CphSzoh4.mjs → smart-shield-_HA814Im.mjs} +11 -11
- package/dist/{snippets-r-Mre0cE.mjs → snippets-mRelEw0p.mjs} +10 -10
- package/dist/source-38bULAR8.mjs +6 -0
- package/dist/spawn-BzPhcLJI.mjs +10 -0
- package/dist/{spectrum-BhjCVFZk.mjs → spectrum-BwtOiaDw.mjs} +11 -11
- package/dist/{speed-CPgypY7n.mjs → speed-DmqsZtiJ.mjs} +11 -11
- package/dist/src--KDGqL5N.mjs +109 -0
- package/dist/{ssl-DsMrXyqK.mjs → ssl-DCvfveJB.mjs} +16 -16
- package/dist/startup-profile-BCe9k9sR.mjs +17 -0
- package/dist/startup-profile-WrwRyMwH.mjs +2 -0
- package/dist/{state-BxCejn42.mjs → state-BPwdiNO_.mjs} +1 -1
- package/dist/state-a1tTOGjm.mjs +2 -0
- package/dist/{stream-L2NmGPby.mjs → stream-aroClJeD.mjs} +56 -56
- package/dist/{submit-KN0Ul5fV.mjs → submit-BBKhoKT8.mjs} +2 -2
- package/dist/{tags-CZMFKGdP.mjs → tags-Djw0e-4j.mjs} +2 -2
- package/dist/telemetry-DoBQOGRk.mjs +2 -0
- package/dist/telemetry-DrFNujdx.mjs +2 -0
- package/dist/{tenant-custom-nameservers-Nx59Buv0.mjs → tenant-custom-nameservers-XCbXryBZ.mjs} +1 -1
- package/dist/tenant-tc1wb_ym.mjs +10 -0
- package/dist/{theme-BiIYWOed.mjs → theme-BIWQFmZ0.mjs} +2 -2
- package/dist/tools-CB4NleeJ.mjs +2 -0
- package/dist/{tunnels-C-mMZy4v.mjs → tunnels-C2FTswb6.mjs} +15 -15
- package/dist/{turnstile-39JL9tMt.mjs → turnstile-BV4Mdd-j.mjs} +8 -8
- package/dist/ui-D1hhIDIs.mjs +5 -0
- package/dist/update-check-CFt6cMOi.mjs +2 -0
- package/dist/update-check-Dtj9fzNe.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-info-7ikewAnp.mjs → url-info-CeegsDK7.mjs} +2 -2
- package/dist/{url-normalization-B0D7Fhf3.mjs → url-normalization-Dbypc9wz.mjs} +4 -4
- package/dist/{url-scanner-DpKIqkin.mjs → url-scanner-BFXMrpJF.mjs} +8 -8
- package/dist/{user-BFq8UM1s.mjs → user-3uwLMH78.mjs} +1 -1
- package/dist/{values-DnBYV1ZD.mjs → values-BTncDc3U.mjs} +2 -2
- package/dist/{vectorize-BpZ4UsUj.mjs → vectorize-CtMAtx8r.mjs} +17 -17
- package/dist/version-oN1bmOgM.mjs +2 -0
- package/dist/{waiting-rooms-DJfqehy9.mjs → waiting-rooms-1xDvjF13.mjs} +25 -25
- package/dist/{web-assets-CCSSW_JH.mjs → web-assets-BfEprX1S.mjs} +29 -29
- package/dist/{web3-bbT1REPc.mjs → web3-DNbp5sZw.mjs} +13 -13
- package/dist/workers-DK_JgS4Y.mjs +38 -0
- package/dist/{workers-builds-TRF3K416.mjs → workers-builds-CdhwmmsQ.mjs} +7 -7
- package/dist/workers-for-platforms-CP6IqxrK.mjs +42 -0
- package/dist/{workers-vpc-kgryQ48l.mjs → workers-vpc-LVfayM2-.mjs} +6 -6
- package/dist/{workflows-CKdPlIkK.mjs → workflows-CA5K8FFb.mjs} +23 -23
- package/dist/wrangler-migration-B0mKHqGd.mjs +2 -0
- package/dist/{zaraz-BXFlEWSx.mjs → zaraz-BY60ZUQ4.mjs} +11 -11
- package/dist/{zero-trust-M08mBsYd.mjs → zero-trust-CQNohO7_.mjs} +460 -434
- package/dist/{zone-DHmrotGW.mjs → zone-BVDW2UGd.mjs} +2 -2
- package/dist/{zones-C0eKBTqG.mjs → zones-CcZL0YQp.mjs} +44 -44
- package/package.json +23 -15
- package/dist/abuse-reports-Dd6kJM7r.mjs +0 -26
- package/dist/access-C_2rEi0H.mjs +0 -27
- package/dist/account-CZ9SPVdz.mjs +0 -12
- package/dist/ai-ARwLeQ1O.mjs +0 -31
- package/dist/ai-gateway-DNY4FPF2.mjs +0 -147
- package/dist/auth-DJhSjNNL.mjs +0 -8
- package/dist/auth-sAorfdWU.mjs +0 -2
- package/dist/browser-extension-C48pKh3t.mjs +0 -15
- package/dist/build-1a8CiNIT.mjs +0 -2
- package/dist/build-Ca_drQY2.mjs +0 -2
- package/dist/cache-XxusQxXe.mjs +0 -45
- package/dist/cf-oadujOtC.mjs +0 -18
- package/dist/chunk-6EUZQHAF-QVTL_mC-.mjs +0 -2
- package/dist/chunk-DL5FNmn1.mjs +0 -2
- package/dist/chunk-Q72B4Q5Z-Cr1H_iK6.mjs +0 -2
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +0 -2
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +0 -2
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +0 -374
- package/dist/client-certificates-CgaIc3zN.mjs +0 -13
- package/dist/command-CF0giIIc.mjs +0 -3
- package/dist/command-CsZFRm3P.mjs +0 -2
- package/dist/command-DBz8QiFk.mjs +0 -2
- package/dist/command-RiZ_LYcm.mjs +0 -2
- package/dist/config-B4vIa0zp.mjs +0 -2
- package/dist/d1-C1GK7DsW.mjs +0 -45
- package/dist/data-security-DDhPnX8Z.mjs +0 -71
- package/dist/dev-CVD3BVUG.mjs +0 -4
- package/dist/dialog--iw0F2s-.mjs +0 -2
- package/dist/dist-CUUGKvjh.mjs +0 -48
- package/dist/dist-dc4E1u01.mjs +0 -272
- package/dist/dot-prop-6SRZBKHT-Dj7YOlwR.mjs +0 -2
- package/dist/dry-run-CLX6Pbtq.mjs +0 -2
- package/dist/durable-objects-8U8DpF9q.mjs +0 -8
- package/dist/email-security-keTqF0nJ.mjs +0 -160
- package/dist/error-sanitization-Cbd_oegl.mjs +0 -2
- package/dist/error-sanitization-DwOlM3R7.mjs +0 -2
- package/dist/firewall-67qoXiqD.mjs +0 -56
- package/dist/flagship-CjC3dF7L.mjs +0 -28
- package/dist/hyperdrive-DPWyiXpj.mjs +0 -37
- package/dist/interactive-B6woOLo-.mjs +0 -32
- package/dist/interactive-DnUvQHjc.mjs +0 -2
- package/dist/keyless-certificates-Dvib4jhw.mjs +0 -13
- package/dist/kv-CA4J7cCq.mjs +0 -21
- package/dist/local-BrfySqnx.mjs +0 -2
- package/dist/login-CLW108XX.mjs +0 -5
- package/dist/login-xgRjiyJa.mjs +0 -2
- package/dist/logs-CiDyrqEu.mjs +0 -48
- package/dist/mtls-certificates-LXlgdkf1.mjs +0 -13
- package/dist/oauth-Dzk6Gy-6.mjs +0 -14
- package/dist/open-PBXRGS4R-C4CKEADM.mjs +0 -4
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +0 -4
- package/dist/output-Bia1u2k5.mjs +0 -2
- package/dist/pages-pah6dZBJ.mjs +0 -60
- package/dist/precursor-DTTYLDEa.mjs +0 -4
- package/dist/previews-B89cUmpr.mjs +0 -4
- package/dist/progress-D_mL-Kcy.mjs +0 -2
- package/dist/prompt-sL_yMZbI.mjs +0 -3
- package/dist/r2-Chn_JQUM.mjs +0 -127
- package/dist/r2-data-catalog-Bfn3AWzn.mjs +0 -44
- package/dist/raw-fetch-lSVttVJF.mjs +0 -2
- package/dist/request-headers-POBKmu93.mjs +0 -2
- package/dist/resolve-BXemCSyA.mjs +0 -2
- package/dist/run-DtN51G2A.mjs +0 -2
- package/dist/run-oACgYK8I.mjs +0 -2
- package/dist/schema-DZSSJaY0.mjs +0 -2
- package/dist/sdk-CsWOex96.mjs +0 -3
- package/dist/security-center-DP4GC1cG.mjs +0 -30
- package/dist/shared-W9uoX1-W.mjs +0 -2
- package/dist/source-BR4_k2ad.mjs +0 -6
- package/dist/spawn-BWEuIO-w.mjs +0 -523
- package/dist/src-Hw-TlVAO.mjs +0 -108
- package/dist/startup-profile-CYEokTVe.mjs +0 -2
- package/dist/startup-profile-CgWHy4rE.mjs +0 -17
- package/dist/state-DSzkxXML.mjs +0 -2
- package/dist/telemetry-CSj_ezpk.mjs +0 -2
- package/dist/telemetry-DAf9gLyH.mjs +0 -2
- package/dist/telemetry-Dk1GcQ0u.mjs +0 -5
- package/dist/tenant-Cu4P-foo.mjs +0 -12
- package/dist/tools-BMKpYraQ.mjs +0 -2
- package/dist/ui-DH95w1Qk.mjs +0 -5
- package/dist/undici-DTSBJHNS.mjs +0 -96
- package/dist/update-check-BKQBD4MQ.mjs +0 -2
- package/dist/update-check-CE9XB6gf.mjs +0 -2
- package/dist/version-Bh3b9vTa.mjs +0 -2
- package/dist/workers-CXuyjZB8.mjs +0 -36
- package/dist/workers-for-platforms-B57iKiSN.mjs +0 -25
- /package/dist/{Page-C-JHZnIy.mjs → Page-DAgOEX17.mjs} +0 -0
- /package/dist/{alerts-CstOk8n0.mjs → alerts-D3iKtzoN.mjs} +0 -0
- /package/dist/{autorag-PRTwXGgn.mjs → autorag-pvRfDwne.mjs} +0 -0
- /package/dist/{body-parser-CUWbw_Tq.mjs → body-parser-NjzJZMOV.mjs} +0 -0
- /package/dist/{brands-BHRXlWDm.mjs → brands-DP5Ndir1.mjs} +0 -0
- /package/dist/{clear-UvKESVx3.mjs → clear-qLKPlJqb.mjs} +0 -0
- /package/dist/{cli-types-tt_LZMbn.mjs → cli-types-_Kmwfpnp.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-DwnFeZg0.mjs → connector-telemetry-events-latest-_aCmWeZx.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-Dv6rZlxs.mjs → connector-telemetry-snapshots-latest-CffEplpV.mjs} +0 -0
- /package/dist/{domain-info-BqTDXNBo.mjs → domain-info-BQh9XapD.mjs} +0 -0
- /package/dist/{health-CwPzzrV6.mjs → health--10IShMi.mjs} +0 -0
- /package/dist/{input-validation-Ch4Vllrm.mjs → input-validation-0CeePPHp.mjs} +0 -0
- /package/dist/{internal-WLHfxX64.mjs → internal-BUs583vv.mjs} +0 -0
- /package/dist/{lifecycle-Ichnb2x1.mjs → lifecycle-Cyc3fmyN.mjs} +0 -0
- /package/dist/{live-D_k7eHdv.mjs → live-VCSxA0N9.mjs} +0 -0
- /package/dist/{metadata-APBiectA.mjs → metadata-C33s4rc-.mjs} +0 -0
- /package/dist/{project-settings-DSXevRvj.mjs → project-settings-Bf6rReo1.mjs} +0 -0
- /package/dist/{rate-limit-analytics-CDTPxSET.mjs → rate-limit-analytics-D3q0mGv2.mjs} +0 -0
- /package/dist/{rate-limits-C3K9smdl.mjs → rate-limits-BIxlBuMn.mjs} +0 -0
- /package/dist/{ready-CvwvbdTX.mjs → ready-CAgelFmC.mjs} +0 -0
- /package/dist/{recent-submissions-CjzcT-iH.mjs → recent-submissions-B3TOjNmk.mjs} +0 -0
- /package/dist/{refute-CIAFMj00.mjs → refute-BZNkFpBB.mjs} +0 -0
- /package/dist/{resolve-CUDKxUrW.mjs → resolve-CGKqk7q8.mjs} +0 -0
- /package/dist/{scan-logo-zFkphtQ3.mjs → scan-logo-StecHiaf.mjs} +0 -0
- /package/dist/{scan-page-CLl2MAkZ.mjs → scan-page-B4adr-vD.mjs} +0 -0
- /package/dist/{search-12jA1b4l.mjs → search-Devngw4M.mjs} +0 -0
- /package/dist/{signed-url-U0T_PEMR.mjs → signed-url-ChR5eXXd.mjs} +0 -0
- /package/dist/{submission-info-CZ84a3Nb.mjs → submission-info-BGb81HZN.mjs} +0 -0
- /package/dist/{total-queries-CJTc9Pde.mjs → total-queries-_wa6KxEl.mjs} +0 -0
- /package/dist/{tracked-domains-BKLxnnSv.mjs → tracked-domains-BesKGqfI.mjs} +0 -0
- /package/dist/{verify-CZW5Fo1q.mjs → verify-CYM5GlPu.mjs} +0 -0
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-rYpzEQb-.mjs";import{n as t}from"./auth-Br-t8vL_.mjs";import{a as n,i as r,t as i}from"./context-CquYYyS3.mjs";import{t as a}from"./output-ClYel9WX.mjs";import{t as o}from"./dry-run-p9Q7nMZ5.mjs";import{t as s}from"./progress-TLUEIYE6.mjs";import{t as c}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as l,r as u,t as d}from"./body-parser-NjzJZMOV.mjs";import{n as f}from"./input-validation-0CeePPHp.mjs";import{n as p}from"./prompt-Ck_1PCHm.mjs";function m(e){return e.usage(`$0 rulesets account-rulesets create
|
|
3
3
|
|
|
4
|
-
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
4
|
+
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create an account or zone ruleset`,builder:m,handler:async p=>c({command:`rulesets account-rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>m.rulesets.accountRulesets.create({...e,account_or_zone:h,account_or_zone_id:g,...c})),{successLabel:`Created`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>m.rulesets.accountRulesets.create({..._,account_or_zone:h,account_or_zone_id:g,...c})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 rulesets account-rulesets delete <ruleset-id>
|
|
5
5
|
|
|
6
|
-
Deletes all versions of an existing account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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
|
|
7
|
-
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],...c})),{successLabel:`Deleted`})})};function
|
|
6
|
+
Deletes all versions of an existing account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <ruleset-id>`,describe:`Delete an account or zone ruleset`,builder:g,handler:async l=>c({command:`rulesets account-rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],...c})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 rulesets account-rulesets get <ruleset-id>
|
|
8
8
|
|
|
9
|
-
Fetches the latest version of an account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
9
|
+
Fetches the latest version of an account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <ruleset-id>`,describe:`Get an account or zone ruleset`,builder:v,handler:async l=>c({command:`rulesets account-rulesets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})};function b(e){return e.usage(`$0 rulesets account-rulesets list
|
|
10
10
|
|
|
11
|
-
Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
11
|
+
Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List account or zone rulesets`,builder:b,handler:async l=>c({command:`rulesets account-rulesets list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={cursor:l.cursor,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.rulesets.accountRulesets.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 rulesets account-rulesets phases get <ruleset-phase>
|
|
12
12
|
|
|
13
|
-
Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
13
|
+
Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <ruleset-phase>`,describe:`Get an account or zone entry point ruleset`,builder:S,handler:async l=>c({command:`rulesets account-rulesets phases get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets account-rulesets phases update <ruleset-phase>
|
|
14
14
|
|
|
15
|
-
Updates an account or zone entry point ruleset, creating a new version.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
15
|
+
Updates an account or zone entry point ruleset, creating a new version.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`update <ruleset-phase>`,describe:`Update an account or zone entry point ruleset`,builder:w,handler:async p=>c({command:`rulesets account-rulesets phases update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${p[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(p[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(p[`ruleset-phase`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`})})};function E(e){return e.usage(`$0 rulesets account-rulesets phases versions get <ruleset-version>
|
|
16
16
|
|
|
17
|
-
Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
17
|
+
Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:E,handler:async l=>c({command:`rulesets account-rulesets phases versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 rulesets account-rulesets phases versions list
|
|
18
18
|
|
|
19
|
-
Fetches the versions of an account or zone entry point ruleset.`).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
19
|
+
Fetches the versions of an account or zone entry point ruleset.`).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List an account or zone entry point ruleset's versions`,builder:O,handler:async l=>c({command:`rulesets account-rulesets phases versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})},A={command:`versions`,describe:`Operations for account-rulesets.phases.versions`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`phases`,describe:`Operations for account-rulesets.phases`,builder:e=>e.command(C).command(T).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 rulesets account-rulesets rules create <ruleset-id>
|
|
20
20
|
|
|
21
|
-
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const
|
|
21
|
+
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const N={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:M,handler:async u=>c({command:`rulesets account-rulesets rules create`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await t(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await i();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`})})};function P(e){return e.usage(`$0 rulesets account-rulesets rules delete <rule-id>
|
|
22
22
|
|
|
23
|
-
Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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
|
|
24
|
-
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c})),{successLabel:`Deleted`})})};function
|
|
23
|
+
Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 F={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:P,handler:async l=>c({command:`rulesets account-rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c})),{successLabel:`Deleted`})})};function I(e){return e.usage(`$0 rulesets account-rulesets rules update <rule-id>
|
|
25
25
|
|
|
26
|
-
Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const
|
|
26
|
+
Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const L={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:I,handler:async u=>c({command:`rulesets account-rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await t(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await i();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`})})},R={command:`rules`,describe:`Operations for account-rulesets.rules`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 rulesets account-rulesets update <ruleset-id>
|
|
27
27
|
|
|
28
|
-
Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
28
|
+
Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:z,handler:async p=>c({command:`rulesets account-rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`})})};function V(e){return e.usage(`$0 rulesets account-rulesets versions by-tag list
|
|
29
29
|
|
|
30
|
-
Fetches the rules of a managed account or zone ruleset version for a given tag.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
30
|
+
Fetches the rules of a managed account or zone ruleset version for a given tag.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List an account or zone ruleset version's rules by tag`,builder:V,handler:async l=>c({command:`rulesets account-rulesets versions by-tag list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions by-tag list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(l[`rule-tag`]))}`,pathParams:{"account-or-zone":String(t),"rule-tag":String(l[`rule-tag`]??``),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.byTag.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],rule_tag:l[`rule-tag`]})),{successLabel:`Loaded`})})},U={command:`by-tag`,describe:`Operations for account-rulesets.versions.by-tag`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 rulesets account-rulesets versions delete <ruleset-version>
|
|
31
31
|
|
|
32
|
-
Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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
|
|
33
|
-
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],...c})),{successLabel:`Deleted`})})};function
|
|
32
|
+
Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 <ruleset-version>`,describe:`Delete an account or zone ruleset version`,builder:W,handler:async l=>c({command:`rulesets account-rulesets versions delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
33
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],...c})),{successLabel:`Deleted`})})};function K(e){return e.usage(`$0 rulesets account-rulesets versions get <ruleset-version>
|
|
34
34
|
|
|
35
|
-
Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
35
|
+
Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <ruleset-version>`,describe:`Get an account or zone ruleset version`,builder:K,handler:async l=>c({command:`rulesets account-rulesets versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function J(e){return e.usage(`$0 rulesets account-rulesets versions list
|
|
36
36
|
|
|
37
|
-
Fetches the versions of an account or zone ruleset.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
37
|
+
Fetches the versions of an account or zone ruleset.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List an account or zone ruleset's versions`,builder:J,handler:async l=>c({command:`rulesets account-rulesets versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})},X={command:`versions`,describe:`Operations for account-rulesets.versions`,builder:e=>e.command(G).command(q).command(Y).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`account-rulesets`,describe:`Operations for account-rulesets`,builder:e=>e.command(h).command(_).command(y).command(x).command(B).command(j).command(R).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-rYpzEQb-.mjs";import{n as t}from"./auth-Br-t8vL_.mjs";import{a as n,t as r}from"./context-CquYYyS3.mjs";import{t as i}from"./output-ClYel9WX.mjs";import{t as a}from"./dry-run-p9Q7nMZ5.mjs";import{t as o}from"./progress-TLUEIYE6.mjs";import{t as s}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as c,r as l,t as u}from"./body-parser-NjzJZMOV.mjs";import{n as d}from"./input-validation-0CeePPHp.mjs";import{n as f}from"./prompt-Ck_1PCHm.mjs";import{t as p}from"./cli-types-_Kmwfpnp.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
|
|
3
3
|
|
|
4
|
-
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await
|
|
4
|
+
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`});return}let p=u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)});i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 rum rules create <ruleset-id>
|
|
5
5
|
|
|
6
|
-
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:g,handler:async l=>s({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await
|
|
6
|
+
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:g,handler:async l=>s({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rum.rules.create({body:e,account_id:f,ruleset_id:l[`ruleset-id`]})),{successLabel:`Created`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths});i(await o(`Creating`,async()=>s.rum.rules.create({body:p,account_id:f,ruleset_id:l[`ruleset-id`]})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 rum rules delete <rule-id>
|
|
7
7
|
|
|
8
|
-
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 y={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:v,handler:async c=>s({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``),"rule-id":String(c[`rule-id`]??``)},bodyKind:`none`});return}let s=await
|
|
8
|
+
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 y={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:v,handler:async c=>s({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``),"rule-id":String(c[`rule-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
9
9
|
`);return}i(await o(`Deleting`,async()=>s.rum.rules.delete({account_id:l,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`]})),{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 rum rules list
|
|
10
10
|
|
|
11
|
-
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:b,handler:async c=>s({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``)},bodyKind:`none`});return}let s=await
|
|
11
|
+
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:b,handler:async c=>s({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.rum.rules.list({account_id:l,ruleset_id:c[`ruleset-id`]})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 rum rules update <rule-id>
|
|
12
12
|
|
|
13
|
-
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:S,handler:async l=>s({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``),"rule-id":String(l[`rule-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await
|
|
13
|
+
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:S,handler:async l=>s({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``),"rule-id":String(l[`rule-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rum.rules.update({body:e,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]})),{successLabel:`Updated`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths});i(await o(`Updating`,async()=>s.rum.rules.update({body:p,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]})),{successLabel:`Updated`})})},w={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 rum site-info create
|
|
14
14
|
|
|
15
|
-
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a Web Analytics site`,builder:T,handler:async l=>s({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await
|
|
15
|
+
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a Web Analytics site`,builder:T,handler:async l=>s({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rum.siteInfo.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)});i(await o(`Creating`,async()=>s.rum.siteInfo.create({...p,account_id:f})),{successLabel:`Created`})})};function D(e){return e.usage(`$0 rum site-info delete <site-id>
|
|
16
16
|
|
|
17
|
-
Deletes an existing Web Analytics site.`).positional(`site-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 O={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:D,handler:async c=>s({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await
|
|
17
|
+
Deletes an existing Web Analytics site.`).positional(`site-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 O={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:D,handler:async c=>s({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
18
18
|
`);return}i(await o(`Deleting`,async()=>s.rum.siteInfo.delete({account_id:l,site_id:c[`site-id`]})),{successLabel:`Deleted`})})};function k(e){return e.usage(`$0 rum site-info get <site-id>
|
|
19
19
|
|
|
20
|
-
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:k,handler:async c=>s({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await
|
|
20
|
+
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:k,handler:async c=>s({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.get({account_id:l,site_id:c[`site-id`]})),{successLabel:`Loaded`})})};function j(e){return e.usage(`$0 rum site-info list-site-tags
|
|
21
21
|
|
|
22
|
-
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:j,handler:async c=>s({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},c,async()=>{let s={all:c.all};if(c.dryRun){a({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await
|
|
22
|
+
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:j,handler:async c=>s({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},c,async()=>{let s={all:c.all};if(c.dryRun){a({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.listSiteTags({account_id:u,...s})),{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 rum site-info list-zone-tags
|
|
23
23
|
|
|
24
|
-
Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:N,handler:async c=>s({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let s=await
|
|
24
|
+
Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:N,handler:async c=>s({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.listZoneTags({account_id:l})),{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 rum site-info list
|
|
25
25
|
|
|
26
|
-
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List Web Analytics sites`,builder:p(F),handler:async c=>s({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},c,async()=>{let s={per_page:c[`per-page`],page:c.page,order_by:c[`order-by`]};if(c.dryRun){a({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await
|
|
26
|
+
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List Web Analytics sites`,builder:p(F),handler:async c=>s({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},c,async()=>{let s={per_page:c[`per-page`],page:c.page,order_by:c[`order-by`]};if(c.dryRun){a({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.list({account_id:u,...s})),{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 rum site-info update <site-id>
|
|
27
27
|
|
|
28
|
-
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:L,handler:async l=>s({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${l[`site-id`]==null?`<site-id>`:encodeURIComponent(String(l[`site-id`]))}`,pathParams:{"site-id":String(l[`site-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await
|
|
28
|
+
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:L,handler:async l=>s({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${l[`site-id`]==null?`<site-id>`:encodeURIComponent(String(l[`site-id`]))}`,pathParams:{"site-id":String(l[`site-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rum.siteInfo.update({...e,account_id:f,site_id:l[`site-id`]})),{successLabel:`Updated`});return}let p=u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)});i(await o(`Updating`,async()=>s.rum.siteInfo.update({...p,account_id:f,site_id:l[`site-id`]})),{successLabel:`Updated`})})};function z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
|
|
29
29
|
|
|
30
|
-
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:z,handler:async c=>s({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/validate/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await
|
|
30
|
+
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:z,handler:async c=>s({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/validate/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.validateHostname({account_id:l,hostname:c.hostname})),{successLabel:`Loaded`})})},V={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(E).command(O).command(A).command(I).command(M).command(P).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(w).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./agent-context-GRiQ4zRU.mjs";import{t}from"./cli-exit-Dqoo6Jgb.mjs";import{Q as n}from"./dist-D1iG7guo.mjs";import{n as r}from"./version-oN1bmOgM.mjs";import{t as i}from"./delegate-CCGgla7X.mjs";import{i as a,r as o}from"./lifecycle-Cyc3fmyN.mjs";import{i as s,t as c}from"./interactive-D80kbTap.mjs";import{t as l}from"./request-headers-Lhj314mk.mjs";import{n as u,t as d}from"./state-BPwdiNO_.mjs";import{t as f}from"./error-sanitization-BbEw--0B.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:new Date().toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${p?`sending`:`would send`}: ${JSON.stringify(n)}`),p)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{r as e}from"./theme-BIWQFmZ0.mjs";import{n as t}from"./version-oN1bmOgM.mjs";import{i as n}from"./cf-DfQfIu3q.mjs";import{i as r}from"./body-parser-NjzJZMOV.mjs";import{n as i}from"./input-validation-0CeePPHp.mjs";import{o as a}from"./prompt-Ck_1PCHm.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
|
|
3
3
|
`)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=new Set(`$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>d(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>d(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0?!0:A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
|
|
4
|
-
`)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[...new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=new Map,i=new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(!(!_||g.length===0))for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(
|
|
4
|
+
`)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[...new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=new Map,i=new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(!(!_||g.length===0))for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
|
|
5
5
|
`)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>d(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>d(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`?!0:t===`false`?!1:r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:l,maximum:u,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!d(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>d(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(l!==void 0&&(f===!0?t<=l:t<l)&&n.push(f===!0?`--${r} must be greater than ${l}`:`--${r} must be at least ${l}`),u!==void 0&&(p===!0?t>=u:t>u)&&n.push(p===!0?`--${r} must be less than ${u}`:`--${r} must be at most ${u}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!d(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>d(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>d(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`))if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`))if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=new Set([...ve,...t]),r=new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{n as e}from"./metadata-C33s4rc-.mjs";import{t}from"./cli-exit-Dqoo6Jgb.mjs";import{t as n}from"./output-ClYel9WX.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const i={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async i=>{let a=e(import.meta.url,`schemas.json`,r);if(!a)throw console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),new t(1);if(i.list){n(Object.entries(a.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}if(i.command.length===0)throw console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),new t(1);let o=i.command.join(` `),s=a.schemas[o];if(!s){let e=Object.keys(a.schemas).filter(e=>e.includes(o)||o.includes(e));if(e.length>0){console.error(`Schema not found for "${o}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${o}". Use --list to see available schemas.`);throw new t(1)}n(s)}};export{i as default};
|