cf 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/commands.json +4040 -1629
- package/dist/_meta/hand-written-commands.json +16 -43
- package/dist/_meta/schemas.json +445 -756
- package/dist/abuse-reports-BAQR1w79.mjs +26 -0
- package/dist/access-C8KMplzp.mjs +27 -0
- package/dist/account-B-KQSR0L.mjs +12 -0
- package/dist/account-tags-EncLJpLc.mjs +15 -0
- package/dist/accounts-BA4Mp3A_.mjs +132 -0
- package/dist/acm-ByxUJcqF.mjs +15 -0
- package/dist/addressing-C-ym0h0G.mjs +93 -0
- package/dist/agent-memory-CkPSiZDI.mjs +34 -0
- package/dist/ai-DkE_Q64s.mjs +31 -0
- package/dist/ai-audit-pPcjYWI5.mjs +6 -0
- package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
- package/dist/ai-search-DLD_kDS1.mjs +79 -0
- package/dist/ai-security-jyZcBl9g.mjs +10 -0
- package/dist/alerting-DOROjm8E.mjs +56 -0
- package/dist/analytics-rQ-h-plT.mjs +21 -0
- package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
- package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-B8p8vp8u.mjs +154 -0
- package/dist/argo-g8SjUb_t.mjs +10 -0
- package/dist/artifacts-B1PaeF5h.mjs +43 -0
- package/dist/audit-logs-DmU_PHy_.mjs +4 -0
- package/dist/auth-CZqics6E.mjs +2 -0
- package/dist/auth-Cp7gT-AF.mjs +8 -0
- package/dist/billing-CvTbUg-H.mjs +23 -0
- package/dist/bot-management-z53tbcbH.mjs +9 -0
- package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
- package/dist/brand-protection-DzV211IQ.mjs +27 -0
- package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
- package/dist/browser-run-DYQvMAyo.mjs +46 -0
- package/dist/build-BPIp8J5F.mjs +2 -0
- package/dist/build-OC77a1zq.mjs +2 -0
- package/dist/builds-CwKRqjQ5.mjs +71 -0
- package/dist/cache-CugNPPsJ.mjs +45 -0
- package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
- package/dist/cf-oadujOtC.mjs +18 -0
- package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
- package/dist/chunk-DL5FNmn1.mjs +2 -0
- package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
- package/dist/client-certificates-DZUIqBTB.mjs +13 -0
- package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
- package/dist/cloud-connector-avpf86kG.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
- package/dist/command-B2Qe-WUa.mjs +2 -0
- package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
- package/dist/command-D45NW-R3.mjs +2 -0
- package/dist/command-DIvPLK8x.mjs +2 -0
- package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
- package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
- package/dist/connectors-BSmhzNB7.mjs +15 -0
- package/dist/containers-B5vDcFzo.mjs +78 -0
- package/dist/{dist-CFQREIRi.mjs → containers-CFzvhmyz.mjs} +84 -83
- package/dist/content-scan-CeLZAcbT.mjs +14 -0
- package/dist/cps-BlI_Od72.mjs +6 -0
- package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
- package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
- package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
- package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
- package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
- package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
- package/dist/custom-pages-BgfhGksj.mjs +21 -0
- package/dist/d1-P2kWbdID.mjs +45 -0
- package/dist/data-security-pBIozmRL.mjs +71 -0
- package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BtETDvDA.mjs → deploy-CVYdt3NK.mjs} +1 -1
- package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-DpOgndz4.mjs} +1 -1
- package/dist/{dev-B5WcIpEr.mjs → dev-PPUBjWcm.mjs} +1 -1
- package/dist/diagnostics-C62habGQ.mjs +15 -0
- package/dist/{dialog-Bud0hiYv.mjs → dialog-C_ccBiZp.mjs} +1 -1
- package/dist/dist-B4pQ4CXK.mjs +48 -0
- package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-CpkcyQ8C.mjs +17 -0
- package/dist/dns-DG1X4Wap.mjs +135 -0
- package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
- package/dist/dry-run-CLX6Pbtq.mjs +2 -0
- package/dist/durable-objects-D214VhxH.mjs +8 -0
- package/dist/email-auth-Ba4ONan2.mjs +6 -0
- package/dist/email-routing-BlqKnqNM.mjs +45 -0
- package/dist/email-security-Dl1E1Dko.mjs +160 -0
- package/dist/email-sending-DIRSSRIz.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
- package/dist/firewall-DdsDh8GD.mjs +56 -0
- package/dist/flagship-CkUIVW7c.mjs +28 -0
- package/dist/fraud-BUpZgvQT.mjs +22 -0
- package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
- package/dist/healthchecks-DjQWb3EM.mjs +22 -0
- package/dist/hostnames-ClBLPbct.mjs +11 -0
- package/dist/hyperdrive-U54xZsWU.mjs +37 -0
- package/dist/iam-T-wWmOep.mjs +52 -0
- package/dist/images-ia5UG1GW.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BhswZLMI.mjs +76 -0
- package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-Dad_EvhM.mjs +4 -0
- package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
- package/dist/keys-DjIPvqj4.mjs +4 -0
- package/dist/kv-DzXVnK94.mjs +21 -0
- package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-3wGHPsYz.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CEQbOgBM.mjs +5 -0
- package/dist/login-DEWvGuaU.mjs +2 -0
- package/dist/logo-matches-YGRPstPi.mjs +6 -0
- package/dist/logos-BirufUgo.mjs +7 -0
- package/dist/logpush-BlNbUHyV.mjs +46 -0
- package/dist/logs-DmFlVF9q.mjs +48 -0
- package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
- package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
- package/dist/magic-transit-CBVOK2aa.mjs +387 -0
- package/dist/managed-defense-BdW6s483.mjs +18 -0
- package/dist/managed-transforms-BIeiofIS.mjs +9 -0
- package/dist/matches-CAnwci0P.mjs +6 -0
- package/dist/mcp-BfhOMGFE.mjs +32 -0
- package/dist/mesh-CxUL2Wf-.mjs +26 -0
- package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
- package/dist/network-C68psMbz.mjs +50 -0
- package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
- package/dist/oauth-D4bkeMAw.mjs +14 -0
- package/dist/oauth-DouM-qz0.mjs +2 -0
- package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
- package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
- package/dist/observability-DpYxkFeZ.mjs +80 -0
- package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-Dg55Xfz7.mjs +75 -0
- package/dist/organizations-QnyzGjB2.mjs +4 -0
- package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
- package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
- package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules--D3eXrCf.mjs +39 -0
- package/dist/pages-Ce8DDgNr.mjs +60 -0
- package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
- package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
- package/dist/pipelines-CAqCgBLh.mjs +44 -0
- package/dist/precursor-DBnn4Q35.mjs +4 -0
- package/dist/previews-y_nSqWK5.mjs +4 -0
- package/dist/progress-Bi02B6v4.mjs +2 -0
- package/dist/{prompt-BP8XrQSj.mjs → prompt-Bx2PB-tt.mjs} +1 -1
- package/dist/queries-dg-CVXjf.mjs +9 -0
- package/dist/queues-C_ilLbRI.mjs +63 -0
- package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
- package/dist/r2-hZAkra-l.mjs +127 -0
- package/dist/radar-BO9b0aZy.mjs +300 -0
- package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
- package/dist/realtime-eSavuSeE.mjs +172 -0
- package/dist/registrar-Ct30kOXZ.mjs +43 -0
- package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
- package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-B-F5aWUJ.mjs +14 -0
- package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
- package/dist/request-tracers-CaubpUFV.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-6Snv-b69.mjs +40 -0
- package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
- package/dist/rules-C26eyeA5.mjs +18 -0
- package/dist/rulesets-BKzIwVtJ.mjs +37 -0
- package/dist/rum-Xdw5hyWY.mjs +30 -0
- package/dist/run-BBBMrSrs.mjs +2 -0
- package/dist/run-BRucX7Rz.mjs +2 -0
- package/dist/{schema-DmuJtMN5.mjs → schema-DqtYndhB.mjs} +1 -1
- package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags-CebDI0f1.mjs} +1 -1
- package/dist/scim-odJTXiIe.mjs +18 -0
- package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-RYpWWzaw.mjs +24 -0
- package/dist/security-center-B3D95vCa.mjs +30 -0
- package/dist/security-txt-BSytVv-9.mjs +9 -0
- package/dist/shared-D67owd9x.mjs +2 -0
- package/dist/smart-shield-C83Sfnf4.mjs +24 -0
- package/dist/snippets-B6oE9WIa.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-CKqJ9J4_.mjs +523 -0
- package/dist/spectrum-CfxY--X_.mjs +83 -0
- package/dist/speed-DzK-kiWt.mjs +24 -0
- package/dist/src-B3h6tKMt.mjs +108 -0
- package/dist/ssl-dnjzPcSB.mjs +45 -0
- package/dist/startup-profile-CYEokTVe.mjs +2 -0
- package/dist/startup-profile-CgWHy4rE.mjs +17 -0
- package/dist/state-BxCejn42.mjs +2 -0
- package/dist/state-DSzkxXML.mjs +2 -0
- package/dist/stream-oFyhS4Wi.mjs +102 -0
- package/dist/submit-4f-ravmC.mjs +4 -0
- package/dist/tags-DrIP6Uiq.mjs +4 -0
- package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-Ds4epd3D.mjs +2 -0
- package/dist/telemetry-mKEb8lYB.mjs +2 -0
- package/dist/tenant-C-gc3NWv.mjs +12 -0
- package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
- package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D0QYsskp.mjs +29 -0
- package/dist/turnstile-C6Q3spRB.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-BBS1K1jt.mjs +2 -0
- package/dist/update-check-CTLoakFV.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-Cs0V89qq.mjs +4 -0
- package/dist/url-normalization-DaEQYy5h.mjs +9 -0
- package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
- package/dist/user-BV1VY3Kl.mjs +112 -0
- package/dist/values-qDS63E43.mjs +4 -0
- package/dist/vectorize-NFzD3mP5.mjs +32 -0
- package/dist/version-W6_TN_kN.mjs +2 -0
- package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
- package/dist/web-assets-Gd6z8dbt.mjs +64 -0
- package/dist/web3-DCJx4NRp.mjs +28 -0
- package/dist/workers-B-j-1ygi.mjs +36 -0
- package/dist/workers-builds-DPrNKjZW.mjs +14 -0
- package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
- package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
- package/dist/workflows-C2KKIJjl.mjs +43 -0
- package/dist/zaraz-CVLCs1IX.mjs +22 -0
- package/dist/zero-trust-BtJi4OXF.mjs +795 -0
- package/dist/zone-hKgt0WzO.mjs +4 -0
- package/dist/zones-CCNyaD3J.mjs +124 -0
- package/package.json +12 -9
- package/dist/_meta/agent-context.json +0 -195
- package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
- package/dist/access-BoT1waG4.mjs +0 -11
- package/dist/account-agnMUKWj.mjs +0 -2
- package/dist/account-tags-BRMMHCee.mjs +0 -9
- package/dist/accounts-Cut77dAt.mjs +0 -30
- package/dist/acm-C8WgXNCl.mjs +0 -3
- package/dist/addressing-CR8EV42x.mjs +0 -13
- package/dist/agent-context-Wj5TRRbW.mjs +0 -8
- package/dist/agent-memory-CVJpKKZy.mjs +0 -6
- package/dist/ai-BbNYt-yI.mjs +0 -5
- package/dist/ai-audit-mVajM-2i.mjs +0 -2
- package/dist/ai-gateway-BsepSA_v.mjs +0 -13
- package/dist/ai-search-DbEJqm5-.mjs +0 -7
- package/dist/ai-security-DmyB5EYk.mjs +0 -4
- package/dist/alerting-dmy3hd8O.mjs +0 -6
- package/dist/analytics-B1xBMla0.mjs +0 -5
- package/dist/analytics_engine-DazCn3iC.mjs +0 -2
- package/dist/api-security-0HXCzfHk.mjs +0 -50
- package/dist/argo-DSHsE8zv.mjs +0 -2
- package/dist/artifacts-CwiU9Mxu.mjs +0 -5
- package/dist/audit-logs-DwFtMDwH.mjs +0 -2
- package/dist/auth-B0ZyXc3y.mjs +0 -5
- package/dist/auth-DWxtJ918.mjs +0 -8
- package/dist/billing-Cbpadkgu.mjs +0 -3
- package/dist/bot-management-B6M2Vyyn.mjs +0 -5
- package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
- package/dist/brand-protection-B5R0b3pu.mjs +0 -3
- package/dist/browser-extension-D55pYZf_.mjs +0 -3
- package/dist/browser-run-C1b2VkGB.mjs +0 -4
- package/dist/build-CP2JUfV1.mjs +0 -2
- package/dist/builds-CVEXO_4a.mjs +0 -9
- package/dist/cache-BU5xX82E.mjs +0 -9
- package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
- package/dist/cf-BV2HLCQm.mjs +0 -18
- package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
- package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-DX84qeYG.mjs +0 -3
- package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
- package/dist/cloud-connector-cf8qlxap.mjs +0 -2
- package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
- package/dist/command-DYrspBc0.mjs +0 -2
- package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
- package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
- package/dist/connectors-aPQspZdg.mjs +0 -3
- package/dist/containers-D0Kjl8h-.mjs +0 -58
- package/dist/content-scan-BVx18XmS.mjs +0 -4
- package/dist/cps-ByazyM0x.mjs +0 -2
- package/dist/csamScanner-OG5lQxBC.mjs +0 -6
- package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
- package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
- package/dist/custom-csrs-CR_5qbST.mjs +0 -3
- package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
- package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
- package/dist/custom-pages-BmGXoTIo.mjs +0 -3
- package/dist/d1-DedC8N0N.mjs +0 -21
- package/dist/data-security-B2UB26ry.mjs +0 -7
- package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
- package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
- package/dist/dist-CyisSore.mjs +0 -371
- package/dist/dist-Dr4Hg_Up.mjs +0 -48
- package/dist/dls-R6PvHbhj.mjs +0 -3
- package/dist/dns-Cl8se64c.mjs +0 -29
- package/dist/dns-firewall-WtmKilDT.mjs +0 -57
- package/dist/dry-run-YSQndLvt.mjs +0 -2
- package/dist/durable-objects-jfVU6yp_.mjs +0 -2
- package/dist/email-auth-DPmZ85eW.mjs +0 -2
- package/dist/email-routing-Bf6DbNTr.mjs +0 -6
- package/dist/email-security-DTifjSxM.mjs +0 -18
- package/dist/email-sending-Dm3WkFHV.mjs +0 -7
- package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
- package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
- package/dist/firewall-D5N2APXO.mjs +0 -8
- package/dist/flagship-sUOy9jei.mjs +0 -4
- package/dist/fraud-WLW2Ep1Z.mjs +0 -20
- package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
- package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
- package/dist/hostnames-Ba6FuL8K.mjs +0 -3
- package/dist/hyperdrive-DMqcU639.mjs +0 -21
- package/dist/iam-CXlYm0uC.mjs +0 -6
- package/dist/images-D_g1oli6.mjs +0 -8
- package/dist/intel-B8bS0ARd.mjs +0 -8
- package/dist/ips-68fzniN4.mjs +0 -2
- package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
- package/dist/keys-DkVdS2lF.mjs +0 -2
- package/dist/kv-gDAN50BQ.mjs +0 -5
- package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
- package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
- package/dist/local-BwL_gesw.mjs +0 -2
- package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
- package/dist/logos-DFBJFAYJ.mjs +0 -3
- package/dist/logpush-gzmlZayc.mjs +0 -4
- package/dist/logs-BuzwQgt5.mjs +0 -18
- package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
- package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
- package/dist/magic-transit-ClSmJDKw.mjs +0 -111
- package/dist/managed-defense-EOihg1UR.mjs +0 -2
- package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
- package/dist/matches-B6sG0_fr.mjs +0 -2
- package/dist/mcp--kK0vS5i.mjs +0 -4
- package/dist/mesh-DfXYUHOO.mjs +0 -4
- package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
- package/dist/network-U6f_5ihp.mjs +0 -6
- package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
- package/dist/oauth-BdVr2hJp.mjs +0 -14
- package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
- package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
- package/dist/observability-Bsp-LdmJ.mjs +0 -10
- package/dist/organization-BSeMdj-7.mjs +0 -45
- package/dist/organizations-BroR48Nv.mjs +0 -2
- package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
- package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
- package/dist/page-rules-ZcdjPohY.mjs +0 -27
- package/dist/pages-W4tKa7xk.mjs +0 -14
- package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
- package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
- package/dist/pipelines-Dug0BR-c.mjs +0 -6
- package/dist/precursor-D-11DkRU.mjs +0 -4
- package/dist/previews-D_Nv4dR6.mjs +0 -4
- package/dist/progress-a5IKeKni.mjs +0 -2
- package/dist/queries-BdA2vJoe.mjs +0 -3
- package/dist/queues-Bu06ZqUE.mjs +0 -7
- package/dist/r2-COC9wMKb.mjs +0 -25
- package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
- package/dist/radar-L-yoLIHF.mjs +0 -2
- package/dist/realtime-JKIiXfzi.mjs +0 -20
- package/dist/registrar-_dYUZrK0.mjs +0 -43
- package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
- package/dist/reporting-3fyoMcmb.mjs +0 -2
- package/dist/request-headers-BhQQAfJt.mjs +0 -2
- package/dist/request-tracers-TisEth2p.mjs +0 -2
- package/dist/resolve-CYUp6YgC.mjs +0 -2
- package/dist/resource-sharing-C4-dnohU.mjs +0 -6
- package/dist/resource-tagging-BRDifKqM.mjs +0 -2
- package/dist/rules-BCF3gIkw.mjs +0 -4
- package/dist/rulesets-wp6rllt3.mjs +0 -5
- package/dist/rum-B77awgoB.mjs +0 -4
- package/dist/run-BS8otL3u.mjs +0 -2
- package/dist/scim-C9BmUYil.mjs +0 -4
- package/dist/secrets-store-ckkZR2dM.mjs +0 -7
- package/dist/security-center-BCahKT57.mjs +0 -2
- package/dist/security-txt-0SI5du7I.mjs +0 -3
- package/dist/shared-D0B-7q-D.mjs +0 -2
- package/dist/smart-shield-BDPbrZa4.mjs +0 -4
- package/dist/snippets-CVRR_h0i.mjs +0 -4
- package/dist/spawn-DP4T92ss.mjs +0 -519
- package/dist/spectrum-CjNXQIQE.mjs +0 -63
- package/dist/speed-CrXCHk3h.mjs +0 -4
- package/dist/src-BbnV77C4.mjs +0 -108
- package/dist/ssl-DKORhHkh.mjs +0 -15
- package/dist/startup-profile-CBIH6yZy.mjs +0 -17
- package/dist/state-QUu6HfxC.mjs +0 -2
- package/dist/stream-wY3zi3FK.mjs +0 -16
- package/dist/submit-B-4oCBSk.mjs +0 -2
- package/dist/tags-5uJEkYJZ.mjs +0 -2
- package/dist/telemetry-n3NJourL.mjs +0 -2
- package/dist/tenant-BkFvv2o3.mjs +0 -2
- package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
- package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
- package/dist/tunnels-9Zg3ePwD.mjs +0 -5
- package/dist/turnstile-BTwKYpzD.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-D7Y61BFd.mjs +0 -2
- package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
- package/dist/url-scanner-CiCIltSQ.mjs +0 -2
- package/dist/user-DDFDGJ0Y.mjs +0 -12
- package/dist/values-DRznB_Cl.mjs +0 -2
- package/dist/vectorize-CbznPhzq.mjs +0 -4
- package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
- package/dist/web-assets-C-ZoSkkh.mjs +0 -8
- package/dist/web3-DwlN4dOw.mjs +0 -4
- package/dist/workers-builds-ECw_x_kp.mjs +0 -2
- package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
- package/dist/workers-vpc-CCosFcxz.mjs +0 -3
- package/dist/workers-zFMrbUkg.mjs +0 -6
- package/dist/workflows-C8GXGDRW.mjs +0 -5
- package/dist/zaraz-B5UIREaz.mjs +0 -2
- package/dist/zero-trust-DUp0XoIo.mjs +0 -91
- package/dist/zone-BGLkk-mL.mjs +0 -2
- package/dist/zones-CwYjNXMH.mjs +0 -44
- /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
- /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{r}from"./auth-Cp7gT-AF.mjs";import{t as i}from"./output-Bia1u2k5.mjs";import{t as a}from"./dry-run-CLX6Pbtq.mjs";import{t as o}from"./progress-Bi02B6v4.mjs";import{t as s}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as c,t as l}from"./body-parser-CUWbw_Tq.mjs";import{n as u}from"./input-validation-Ch4Vllrm.mjs";import{a as d,i as f,n as p}from"./prompt-Bx2PB-tt.mjs";function m(e){return e.usage(`$0 oauth-clients create
|
|
3
|
+
|
|
4
|
+
Create a new OAuth client for an account.`).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).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 OAuth Client`,builder:m,handler:async p=>s({command:`oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}):c(p.body)});return}let s=await r(p),m=p.local?e:await t();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.oauthClients.create({...e,account_id:m})),{successLabel:`Created`});return}if(p[`client-name`]===void 0&&(p[`client-name`]=await d(`client-name`,`Human-readable name of the OAuth client.`)),p[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(p[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(p[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(p.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);p[`token-endpoint-auth-method`]===void 0&&(p[`token-endpoint-auth-method`]=await f(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let h=l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)});i(await o(`Creating`,async()=>s.oauthClients.create({...h,account_id:m})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 oauth-clients delete-rotated-secret <oauth-client-id>
|
|
5
|
+
|
|
6
|
+
Removes the old client secret after a rotation, keeping only the new one. Use this after you have updated your client configuration to use the new secret. The \`has_rotated_secret\` field on the client indicates whether there is an old secret to delete.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,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 _={command:`delete-rotated-secret <oauth-client-id>`,describe:`Delete Rotated OAuth Client Secret`,builder:g,handler:async c=>s({command:`oauth-clients delete-rotated-secret`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients delete-rotated-secret`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}i(await o(`Deleting`,async()=>s.oauthClients.deleteRotatedSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 oauth-clients delete <oauth-client-id>
|
|
8
|
+
|
|
9
|
+
Delete an OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,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 <oauth-client-id>`,describe:`Delete OAuth Client`,builder:v,handler:async c=>s({command:`oauth-clients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}i(await o(`Deleting`,async()=>s.oauthClients.delete({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 oauth-clients get <oauth-client-id>
|
|
11
|
+
|
|
12
|
+
Get details of a specific OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <oauth-client-id>`,describe:`OAuth Client Details`,builder:b,handler:async c=>s({command:`oauth-clients get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.oauthClients.get({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 oauth-clients list
|
|
13
|
+
|
|
14
|
+
List all OAuth clients for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List OAuth Clients`,builder:S,handler:async c=>s({command:`oauth-clients list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.oauthClients.list({account_id:l})),{successLabel:`Loaded`})})};function w(e){return e.usage("$0 oauth-clients rotate-secret <oauth-client-id>\n\nCreates a second client secret so you can update your client configuration before deleting the old one. The `has_rotated_secret` field on the client will be set to `true`.").positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`rotate-secret <oauth-client-id>`,describe:`Rotate OAuth Client Secret`,builder:w,handler:async c=>s({command:`oauth-clients rotate-secret`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients rotate-secret`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.oauthClients.rotateSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Created`})})};function E(e){return e.usage(`$0 oauth-clients update <oauth-client-id>
|
|
15
|
+
|
|
16
|
+
Update an existing OAuth client. Only include fields you want to update.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const D={command:`update <oauth-client-id>`,describe:`Update OAuth Client`,builder:E,handler:async d=>s({command:`oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${d[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(d[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(d[`oauth-client-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.oauthClients.update({...e,account_id:f,oauth_client_id:d[`oauth-client-id`]})),{successLabel:`Updated`});return}let p=l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)});i(await o(`Updating`,async()=>s.oauthClients.update({...p,account_id:f,oauth_client_id:d[`oauth-client-id`]})),{successLabel:`Updated`})})},O={command:`oauth-clients`,describe:`oauth-clients`,builder:e=>e.command(h).command(y).command(_).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{O as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";function a(e){return e.usage(`$0 oauth-scopes list
|
|
3
|
+
|
|
4
|
+
List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`list`,describe:`List OAuth Scopes`,builder:a,handler:async a=>i({command:`oauth-scopes list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.oauthScopes.list()),{successLabel:`Loaded`})})},s={command:`oauth-scopes`,describe:`oauth-scopes`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,r as u,t as d}from"./body-parser-CUWbw_Tq.mjs";import{n as f}from"./input-validation-Ch4Vllrm.mjs";import{a as p,i as m,n as h}from"./prompt-Bx2PB-tt.mjs";import{t as g}from"./cli-types-tt_LZMbn.mjs";function ee(e){return e.usage(`$0 observability destinations create
|
|
3
|
+
|
|
4
|
+
Create a new Workers Observability Telemetry Destination.`).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck 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 te={command:`create`,describe:`Create Destination`,builder:ee,handler:async t=>c({command:`observability destinations create`,classification:{safeFlags:[`configuration-type`,`enabled`,`skip-preflight-check`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({configuration:{type:f(t[`configuration-type`],`configuration-type`,`text`),url:f(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:f(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.destinations.create({...e,account_id:u})),{successLabel:`Created`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await m(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await p(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await p(`name`,`The name field`));let h=d({configuration:{type:f(t[`configuration-type`],`configuration-type`,`text`),url:f(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:f(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]});a(await s(`Creating`,async()=>c.observability.destinations.create({...h,account_id:u})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 observability destinations delete <slug>
|
|
5
|
+
|
|
6
|
+
Delete a Workers Observability Telemetry Destination.`).positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <slug>`,describe:`Delete Destination`,builder:_,handler:async t=>c({command:`observability destinations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await h({force:!!t.force,message:`This operation deletes the destination.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.observability.destinations.delete({account_id:l,slug:t.slug})),{successLabel:`Deleted`})})};function y(e){return e.usage(`$0 observability destinations list
|
|
8
|
+
|
|
9
|
+
List your Workers Observability Telemetry Destinations.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Get Destinations`,builder:g(y),handler:async t=>c({command:`observability destinations list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},t,async()=>{let c={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){o({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.destinations.list({account_id:u,...c})),{successLabel:`Loaded`})})};function x(e){return e.usage(`$0 observability destinations update <slug>
|
|
10
|
+
|
|
11
|
+
Update an existing Workers Observability Telemetry Destination.`).positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled 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 S={command:`update <slug>`,describe:`Update Destination`,builder:x,handler:async t=>c({command:`observability destinations update`,classification:{safeFlags:[`configuration-type`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},bodyKind:`json`,body:t.body===void 0?d({configuration:{type:f(t[`configuration-type`],`configuration-type`,`text`),url:f(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.observability.destinations.update({...e,account_id:u,slug:t.slug})),{successLabel:`Updated`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await m(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await p(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=d({configuration:{type:f(t[`configuration-type`],`configuration-type`,`text`),url:f(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled});a(await s(`Updating`,async()=>c.observability.destinations.update({...h,account_id:u,slug:t.slug})),{successLabel:`Updated`})})},C={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(te).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.usage(`$0 observability issues add <groupId>
|
|
12
|
+
|
|
13
|
+
Add one or more ungrouped issues to an existing issue group.`).positional(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`issue-ids`,{type:`string`,array:!0,description:`The issueIds 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 T={command:`add <groupId>`,describe:`Add issue group members`,builder:w,handler:async t=>c({command:`observability issues add`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues add`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}/members`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({issueIds:t[`issue-ids`]}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.issues.add({...e,account_id:u,groupId:t[`group-id`]})),{successLabel:`Created`});return}if(t[`issue-ids`]===void 0)throw Error(`--issue-ids is required (or pass --body with this field set).`);let f=d({issueIds:t[`issue-ids`]});a(await s(`Creating`,async()=>c.observability.issues.add({...f,account_id:u,groupId:t[`group-id`]})),{successLabel:`Created`})})};function E(e){return e.usage(`$0 observability issues automations create
|
|
14
|
+
|
|
15
|
+
Create an account or service issue automation.`).option(`after-inactivity-seconds`,{type:`number`,description:`The afterInactivitySeconds field`}).option(`after-occurrences`,{type:`number`,description:`The afterOccurrences field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`service`,{type:`string`,description:`The service 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 D={command:`create`,describe:`Create an issue automation`,builder:E,handler:async t=>c({command:`observability issues automations create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues automations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/automations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({afterInactivitySeconds:t[`after-inactivity-seconds`],afterOccurrences:t[`after-occurrences`],enabled:t.enabled,name:f(t.name,`name`,`text`),policyId:f(t[`policy-id`],`policy-id`,`text`),service:f(t.service,`service`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.issues.automations.create({...e,account_id:u})),{successLabel:`Created`});return}t[`policy-id`]===void 0&&(t[`policy-id`]=await p(`policy-id`,`The policyId field`));let m=d({afterInactivitySeconds:t[`after-inactivity-seconds`],afterOccurrences:t[`after-occurrences`],enabled:t.enabled,name:f(t.name,`name`,`text`),policyId:f(t[`policy-id`],`policy-id`,`text`),service:f(t.service,`service`,`text`)});a(await s(`Creating`,async()=>c.observability.issues.automations.create({...m,account_id:u})),{successLabel:`Created`})})};function O(e){return e.usage(`$0 observability issues automations delete <automationId>
|
|
16
|
+
|
|
17
|
+
Delete an issue automation while preserving its historical runs.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,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 k={command:`delete <automationId>`,describe:`Delete an issue automation`,builder:O,handler:async t=>c({command:`observability issues automations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability issues automations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/automations/${t[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(t[`automation-id`]))}`,pathParams:{"automation-id":String(t[`automation-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await h({force:!!t.force,message:`This operation deletes the issue automation.`})){process.stderr.write(`Aborted.
|
|
18
|
+
`);return}a(await s(`Deleting`,async()=>c.observability.issues.automations.delete({account_id:l,automationId:t[`automation-id`]})),{successLabel:`Deleted`})})};function A(e){return e.usage(`$0 observability issues automations get <automationId>
|
|
19
|
+
|
|
20
|
+
Retrieve an issue automation.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <automationId>`,describe:`Get an issue automation`,builder:A,handler:async t=>c({command:`observability issues automations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues automations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/automations/${t[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(t[`automation-id`]))}`,pathParams:{"automation-id":String(t[`automation-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.observability.issues.automations.get({account_id:l,automationId:t[`automation-id`]})),{successLabel:`Loaded`})})};function M(e){return e.usage(`$0 observability issues automations list
|
|
21
|
+
|
|
22
|
+
List account and service issue automations.`).option(`service`,{type:`string`,description:`Service`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List issue automations`,builder:M,handler:async t=>c({command:`observability issues automations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={service:t.service};if(t.dryRun){o({command:`cf observability issues automations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/automations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.issues.automations.list({account_id:u,...c})),{successLabel:`Loaded`})})};function P(e){return e.usage(`$0 observability issues automations update <automationId>
|
|
23
|
+
|
|
24
|
+
Replace an issue automation configuration.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,demandOption:!0}).option(`after-inactivity-seconds`,{type:`number`,description:`The afterInactivitySeconds field`}).option(`after-occurrences`,{type:`number`,description:`The afterOccurrences field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`service`,{type:`string`,description:`The service 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 F={command:`update <automationId>`,describe:`Update an issue automation`,builder:P,handler:async t=>c({command:`observability issues automations update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues automations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/automations/${t[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(t[`automation-id`]))}`,pathParams:{"automation-id":String(t[`automation-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({afterInactivitySeconds:t[`after-inactivity-seconds`],afterOccurrences:t[`after-occurrences`],enabled:t.enabled,name:f(t.name,`name`,`text`),policyId:f(t[`policy-id`],`policy-id`,`text`),service:f(t.service,`service`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.observability.issues.automations.update({...e,account_id:u,automationId:t[`automation-id`]})),{successLabel:`Updated`});return}t[`policy-id`]===void 0&&(t[`policy-id`]=await p(`policy-id`,`The policyId field`));let m=d({afterInactivitySeconds:t[`after-inactivity-seconds`],afterOccurrences:t[`after-occurrences`],enabled:t.enabled,name:f(t.name,`name`,`text`),policyId:f(t[`policy-id`],`policy-id`,`text`),service:f(t.service,`service`,`text`)});a(await s(`Updating`,async()=>c.observability.issues.automations.update({...m,account_id:u,automationId:t[`automation-id`]})),{successLabel:`Updated`})})},I={command:`automations`,describe:`Operations for issues.automations`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.usage(`$0 observability issues get <issueId>
|
|
25
|
+
|
|
26
|
+
Retrieve an issue.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <issueId>`,describe:`Get an issue`,builder:L,handler:async t=>c({command:`observability issues get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.observability.issues.get({account_id:l,issueId:t[`issue-id`]})),{successLabel:`Loaded`})})};function z(e){return e.usage(`$0 observability issues group
|
|
27
|
+
|
|
28
|
+
Group two or more issues under a new customer-defined identity.`).option(`issue-ids`,{type:`string`,array:!0,description:`The issueIds field`}).option(`title`,{type:`string`,description:`The title 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 B={command:`group`,describe:`Create an issue group`,builder:z,handler:async t=>c({command:`observability issues group`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues group`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/groups`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({issueIds:t[`issue-ids`],title:f(t.title,`title`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.issues.group({...e,account_id:u})),{successLabel:`Created`});return}if(t[`issue-ids`]===void 0)throw Error(`--issue-ids is required (or pass --body with this field set).`);t.title===void 0&&(t.title=await p(`title`,`The title field`));let m=d({issueIds:t[`issue-ids`],title:f(t.title,`title`,`text`)});a(await s(`Creating`,async()=>c.observability.issues.group({...m,account_id:u})),{successLabel:`Created`})})};function V(e){return e.usage(`$0 observability issues list
|
|
29
|
+
|
|
30
|
+
List detected issues.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`id`,`service`,`title`,`type`,`status`,`statusUpdated`,`count`,`firstObserved`,`lastObserved`,`created`,`updated`]}).option(`search`,{type:`string`,description:`Search`}).option(`service`,{type:`string`,description:`Service`}).option(`type`,{type:`string`,description:`Type`}).option(`status`,{type:`string`,description:`Status`,choices:[`active`,`resolved`,`ignored`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List detected issues`,builder:g(V),handler:async t=>c({command:`observability issues list`,classification:{safeFlags:[`order`,`order-by`,`status`,`dry-run`]}},t,async()=>{let c={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`],search:t.search,service:t.service,type:t.type,status:t.status};if(t.dryRun){o({command:`cf observability issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.issues.list({account_id:u,...c})),{successLabel:`Loaded`})})};function U(e){return e.usage(`$0 observability issues notify <issueId>
|
|
31
|
+
|
|
32
|
+
Send the issue to one ANS policy, or every matching Real-Time Issue policy when no policy ID is provided.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`notify <issueId>`,describe:`Notify about an issue`,builder:U,handler:async t=>c({command:`observability issues notify`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability issues notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/notification-runs`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({policyId:f(t[`policy-id`],`policy-id`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,!await h({force:!!t.force,message:`This operation sends an issue notification.`})){process.stderr.write(`Aborted.
|
|
33
|
+
`);return}if(t.body){let e=l(t.body);a(await s(`Deleting`,async()=>c.observability.issues.notify({...e,account_id:u,issueId:t[`issue-id`]})),{successLabel:`Deleted`});return}let p=d({policyId:f(t[`policy-id`],`policy-id`,`text`)});a(await s(`Deleting`,async()=>c.observability.issues.notify({...p,account_id:u,issueId:t[`issue-id`]})),{successLabel:`Deleted`})})};function G(e){return e.usage(`$0 observability issues occurrences <issueId>
|
|
34
|
+
|
|
35
|
+
List the retained error occurrences grouped into an issue, newest first.`).positional(`issue-id`,{type:`string`,description:`Issue ID returned by the issues API.`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Opaque cursor returned in result_info.cursors.after.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`occurrences <issueId>`,describe:`List issue occurrences`,builder:G,handler:async t=>c({command:`observability issues occurrences`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={cursor:t.cursor,per_page:t[`per-page`]};if(t.dryRun){o({command:`cf observability issues occurrences`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/occurrences`,pathParams:{"issue-id":String(t[`issue-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.issues.occurrences({account_id:u,issueId:t[`issue-id`],...c})),{successLabel:`Loaded`})})};function q(e){return e.usage(`$0 observability issues remove <issueId>
|
|
36
|
+
|
|
37
|
+
Remove an issue from a group, dissolving the group when fewer than two members remain.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`remove <issueId>`,describe:`Remove an issue group member`,builder:q,handler:async t=>c({command:`observability issues remove`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability issues remove`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}/members/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``),"issue-id":String(t[`issue-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await h({force:!!t.force})){process.stderr.write(`Aborted.
|
|
38
|
+
`);return}a(await s(`Deleting`,async()=>c.observability.issues.remove({account_id:l,groupId:t[`group-id`],issueId:t[`issue-id`]})),{successLabel:`Deleted`})})};function Y(e){return e.usage(`$0 observability issues summary
|
|
39
|
+
|
|
40
|
+
Retrieve aggregate issue counts for the account.`).option(`service`,{type:`string`,description:`Service`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`summary`,describe:`Summarize detected issues`,builder:Y,handler:async t=>c({command:`observability issues summary`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={service:t.service};if(t.dryRun){o({command:`cf observability issues summary`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/summary`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.issues.summary({account_id:u,...c})),{successLabel:`Loaded`})})};function Z(e){return e.usage(`$0 observability issues ungroup <groupId>
|
|
41
|
+
|
|
42
|
+
Dissolve an issue group and restore its members as standalone issues.`).positional(`group-id`,{type:`string`,description:`GroupId`,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 Q={command:`ungroup <groupId>`,describe:`Dissolve an issue group`,builder:Z,handler:async t=>c({command:`observability issues ungroup`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability issues ungroup`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await h({force:!!t.force})){process.stderr.write(`Aborted.
|
|
43
|
+
`);return}a(await s(`Deleting`,async()=>c.observability.issues.ungroup({account_id:l,groupId:t[`group-id`]})),{successLabel:`Deleted`})})};function ne(e){return e.usage(`$0 observability issues update <issueId>
|
|
44
|
+
|
|
45
|
+
Modify an issue status or group title.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`active`,`resolved`,`ignored`]}).option(`title`,{type:`string`,description:`The title field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Modify an issue status or group title.`})}const re={command:`update <issueId>`,describe:`Modify an issue`,builder:ne,handler:async t=>c({command:`observability issues update`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability issues update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({status:f(t.status,`status`,`text`),title:f(t.title,`title`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.observability.issues.update({...e,account_id:u,issueId:t[`issue-id`]})),{successLabel:`Updated`});return}let p=d({status:f(t.status,`status`,`text`),title:f(t.title,`title`,`text`)});a(await s(`Updating`,async()=>c.observability.issues.update({...p,account_id:u,issueId:t[`issue-id`]})),{successLabel:`Updated`})})},ie={command:`issues`,describe:`Operations for issues`,builder:e=>e.command(T).command(R).command(B).command(H).command(W).command(K).command(J).command(X).command(Q).command(re).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 observability queries create
|
|
46
|
+
|
|
47
|
+
Persist query for later use.`).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const oe={command:`create`,describe:`Save query`,builder:ae,handler:async t=>c({command:`observability queries create`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.queries.create({...e,account_id:u})),{successLabel:`Created`});return}t.description===void 0&&(t.description=await p(`description`,`The description field`)),t.name===void 0&&(t.name=await p(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await p(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=d({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});a(await s(`Creating`,async()=>c.observability.queries.create({...m,account_id:u})),{successLabel:`Created`})})};function se(e){return e.usage(`$0 observability queries delete <queryId>
|
|
48
|
+
|
|
49
|
+
Delete a saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ce={command:`delete <queryId>`,describe:`Delete query`,builder:se,handler:async t=>c({command:`observability queries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await h({force:!!t.force,message:`This operation deletes the saved query.`})){process.stderr.write(`Aborted.
|
|
50
|
+
`);return}a(await s(`Deleting`,async()=>c.observability.queries.delete({account_id:l,queryId:t[`query-id`]})),{successLabel:`Deleted`})})};function le(e){return e.usage(`$0 observability queries edit <queryId>
|
|
51
|
+
|
|
52
|
+
Update saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const ue={command:`edit <queryId>`,describe:`Update query`,builder:le,handler:async t=>c({command:`observability queries edit`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Updating`,async()=>c.observability.queries.edit({...e,account_id:u,queryId:t[`query-id`]})),{successLabel:`Updated`});return}t.description===void 0&&(t.description=await p(`description`,`The description field`)),t.name===void 0&&(t.name=await p(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await p(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=d({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});a(await s(`Updating`,async()=>c.observability.queries.edit({...m,account_id:u,queryId:t[`query-id`]})),{successLabel:`Updated`})})};function de(e){return e.usage(`$0 observability queries get <queryId>
|
|
53
|
+
|
|
54
|
+
Retrieve a saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get <queryId>`,describe:`Get query`,builder:de,handler:async t=>c({command:`observability queries get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();t.accountId=l,a(await s(`Loading`,async()=>c.observability.queries.get({account_id:l,queryId:t[`query-id`]})),{successLabel:`Loaded`})})};function pe(e){return e.usage(`$0 observability queries list
|
|
55
|
+
|
|
56
|
+
List saved queries.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`List queries`,builder:g(pe),handler:async t=>c({command:`observability queries list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},t,async()=>{let c={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){o({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.queries.list({account_id:u,...c})),{successLabel:`Loaded`})})},he={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(oe).command(ce).command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.usage(`$0 observability shared-queries create
|
|
57
|
+
|
|
58
|
+
Shared queries store the results of a previously run query, allowing you to share the results with others.`).option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a sharable link to a query result.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-* flag is set`)}return!0})}const _e={command:`create`,describe:`Create a sharable link to a query result`,builder:ge,handler:async t=>c({command:`observability shared-queries create`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`dry`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({chart:t.chart,chartType:f(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:f(t[`distribution-scale`],`distribution-scale`,`text`),dry:t.dry,granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:f(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:f(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:f(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:f(t.view,`view`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.sharedQueries.create({...e,account_id:u})),{successLabel:`Created`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await p(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=d({chart:t.chart,chartType:f(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:f(t[`distribution-scale`],`distribution-scale`,`text`),dry:t.dry,granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:f(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:f(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:f(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:f(t.view,`view`,`text`)});a(await s(`Creating`,async()=>c.observability.sharedQueries.create({...m,account_id:u})),{successLabel:`Created`})})};function ve(e){return e.usage(`$0 observability shared-queries get <id>
|
|
59
|
+
|
|
60
|
+
Shared queries store the results of a previously run query, allowing you to share the results with others.`).positional(`id`,{type:`string`,description:`Specify the ID of the shared query.`,demandOption:!0}).option(`view`,{type:`string`,description:`Select the view of the query result to return, defaults to events.`,choices:[`events`,`invocations`,`calculations`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get <id>`,describe:`View a query that has been shared`,builder:g(ve),handler:async t=>c({command:`observability shared-queries get`,classification:{safeFlags:[`view`,`dry-run`]}},t,async()=>{let c={view:t.view};if(t.dryRun){o({command:`cf observability shared-queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/shared/query/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.observability.sharedQueries.get({account_id:u,id:t.id,...c})),{successLabel:`Loaded`})})},be={command:`shared-queries`,describe:`Operations for shared-queries`,builder:e=>e.command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.usage(`$0 observability telemetry keys
|
|
61
|
+
|
|
62
|
+
List all the keys in your telemetry events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const Se={command:`keys`,describe:`List keys`,builder:xe,handler:async t=>c({command:`observability telemetry keys`,classification:{safeFlags:[`key-needle-is-regex`,`key-needle-match-case`,`needle-is-regex`,`needle-match-case`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({datasets:t.datasets,filters:u(t.filters,`filters`),from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to}):l(t.body)});return}let c=await i(t),f=t.local?e:await n();if(t.accountId=f,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.telemetry.keys({...e,account_id:f})),{successLabel:`Created`});return}let p=d({datasets:t.datasets,filters:u(t.filters,`filters`),from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to});a(await s(`Creating`,async()=>c.observability.telemetry.keys({...p,account_id:f})),{successLabel:`Created`})})};function Ce(e){return e.usage(`$0 observability telemetry query
|
|
63
|
+
|
|
64
|
+
Run a temporary or saved query.`).option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-* flag is set`)}return!0})}const we={command:`query`,describe:`Run a query`,builder:Ce,handler:async t=>c({command:`observability telemetry query`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`dry`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({chart:t.chart,chartType:f(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:f(t[`distribution-scale`],`distribution-scale`,`text`),dry:t.dry,granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:f(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:f(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:f(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:f(t.view,`view`,`text`)}):l(t.body)});return}let c=await i(t),u=t.local?e:await n();if(t.accountId=u,t.body){let e=l(t.body);a(await s(`Loading`,async()=>c.observability.telemetry.query({...e,account_id:u})),{successLabel:`Loaded`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await p(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=d({chart:t.chart,chartType:f(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:f(t[`distribution-scale`],`distribution-scale`,`text`),dry:t.dry,granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:f(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:f(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:f(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:f(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:f(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:f(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:f(t.view,`view`,`text`)});a(await s(`Loading`,async()=>c.observability.telemetry.query({...m,account_id:u})),{successLabel:`Loaded`})})};function Te(e){return e.usage(`$0 observability telemetry values
|
|
65
|
+
|
|
66
|
+
List unique values found in your events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json.`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const Ee={command:`values`,describe:`List values`,builder:Te,handler:async t=>c({command:`observability telemetry values`,classification:{safeFlags:[`needle-is-regex`,`needle-match-case`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({datasets:t.datasets,filters:u(t.filters,`filters`),key:f(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:f(t.type,`type`,`text`)}):l(t.body)});return}let c=await i(t),h=t.local?e:await n();if(t.accountId=h,t.body){let e=l(t.body);a(await s(`Creating`,async()=>c.observability.telemetry.values({...e,account_id:h})),{successLabel:`Created`});return}if(t.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(t.key===void 0&&(t.key=await p(`key`,`The key field`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);t.type===void 0&&(t.type=await m(`type`,`The type field`,[`string`,`boolean`,`number`]));let g=d({datasets:t.datasets,filters:u(t.filters,`filters`),key:f(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:f(t.type,`type`,`text`)});a(await s(`Creating`,async()=>c.observability.telemetry.values({...g,account_id:h})),{successLabel:`Created`})})},De={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.usage(`$0 observability tracing rules delete
|
|
67
|
+
|
|
68
|
+
Delete every sampling override from a zone's managed Cloudflare Traces ruleset.`).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 ke={command:`delete`,describe:`Delete zone trace rules`,builder:Oe,handler:async e=>c({command:`observability tracing rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
69
|
+
`);return}a(await s(`Deleting`,async()=>n.observability.tracing.rules.delete({zone_id:r})),{successLabel:`Deleted`})})};function Ae(e){return e.usage(`$0 observability tracing rules get
|
|
70
|
+
|
|
71
|
+
Retrieve the ordered sampling overrides for a zone's managed Cloudflare Traces ruleset.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`get`,describe:`View zone trace rules`,builder:Ae,handler:async e=>c({command:`observability tracing rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,a(await s(`Loading`,async()=>n.observability.tracing.rules.get({zone_id:r})),{successLabel:`Loaded`})})};function Me(e){return e.usage(`$0 observability tracing rules update
|
|
72
|
+
|
|
73
|
+
Replace all sampling overrides in a zone's managed Cloudflare Traces ruleset. Rules are evaluated in the supplied order.`).option(`rules`,{type:`string`,description:`Trace rules in evaluation order. 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:`Replace the ordered trace rules`})}const Ne={command:`update`,describe:`Replace zone trace rules`,builder:Me,handler:async e=>c({command:`observability tracing rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({rules:u(e.rules,`rules`)}):l(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=l(e.body);a(await s(`Updating`,async()=>n.observability.tracing.rules.update({...t,zone_id:r})),{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let c=d({rules:u(e.rules,`rules`)});a(await s(`Updating`,async()=>n.observability.tracing.rules.update({...c,zone_id:r})),{successLabel:`Updated`})})},Pe={command:`rules`,describe:`Operations for tracing.rules`,builder:e=>e.command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.usage(`$0 observability tracing settings delete
|
|
74
|
+
|
|
75
|
+
Reset the zone-level Cloudflare Traces settings to their defaults while preserving the sampling rules.`).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 Fe={command:`delete`,describe:`Reset zone tracing settings`,builder:$,handler:async e=>c({command:`observability tracing settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
76
|
+
`);return}a(await s(`Deleting`,async()=>n.observability.tracing.settings.delete({zone_id:r})),{successLabel:`Deleted`})})};function Ie(e){return e.usage(`$0 observability tracing settings get
|
|
77
|
+
|
|
78
|
+
Retrieve the zone-level Cloudflare Traces settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get`,describe:`View zone tracing settings`,builder:Ie,handler:async e=>c({command:`observability tracing settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,a(await s(`Loading`,async()=>n.observability.tracing.settings.get({zone_id:r})),{successLabel:`Loaded`})})};function Re(e){return e.usage(`$0 observability tracing settings update
|
|
79
|
+
|
|
80
|
+
Update the zone-level Cloudflare Traces settings.`).option(`destinations`,{type:`string`,array:!0,description:`Up to 100 OpenTelemetry destination identifiers that receive traces.`}).option(`enabled`,{type:`boolean`,description:`Whether Cloudflare Traces is enabled for the zone.`}).option(`forward-context`,{type:`boolean`,description:`Whether trace context is sent externally or across a zone boundary.`}).option(`persist`,{type:`boolean`,description:`Whether traces are persisted in Cloudflare.`}).option(`propagation-policy`,{type:`string`,description:`When inbound trace context may be continued. Authenticated propagation is not supported yet.`,choices:[`accept`,`authenticated`,`reject`]}).option(`sampling-ratio`,{type:`number`,description:`The ratio of requests sampled for tracing, from 0 to 1.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update zone tracing settings`})}const ze={command:`update`,describe:`Update zone tracing settings`,builder:Re,handler:async e=>c({command:`observability tracing settings update`,classification:{safeFlags:[`enabled`,`forward-context`,`persist`,`propagation-policy`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf observability tracing settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:f(e[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:e[`sampling-ratio`]}):l(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=l(e.body);a(await s(`Updating`,async()=>n.observability.tracing.settings.update({...t,zone_id:r})),{successLabel:`Updated`});return}let c=d({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:f(e[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:e[`sampling-ratio`]});a(await s(`Updating`,async()=>n.observability.tracing.settings.update({...c,zone_id:r})),{successLabel:`Updated`})})},Be={command:`settings`,describe:`Operations for tracing.settings`,builder:e=>e.command(Fe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ve={command:`tracing`,describe:`Operations for tracing`,builder:e=>e.command(Pe).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`observability`,describe:`observability`,builder:e=>e.command(C).command(ie).command(he).command(be).command(De).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./chunk-Q72B4Q5Z-
|
|
2
|
+
import{r as e}from"./chunk-Q72B4Q5Z-DKhx_4ok.mjs";import t from"node:fs";import n from"node:path";import r from"node:os";import{promisify as i}from"node:util";import a from"node:process";import{fileURLToPath as o}from"node:url";import{Buffer as s}from"node:buffer";import c,{constants as l}from"node:fs/promises";import u,{execFile as d}from"node:child_process";var f;function p(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}e(p,`hasDockerEnv`);function m(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}e(m,`hasDockerCGroup`);function h(){return f===void 0&&(f=p()||m()),f}e(h,`isDocker`);var g,_=e(()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}},`hasContainerEnv`);function v(){return g===void 0&&(g=_()||h()),g}e(v,`isInsideContainer`);var y=e(()=>{if(a.platform!==`linux`)return!1;if(r.release().toLowerCase().includes(`microsoft`))return!v();try{return t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!v():!1}catch{return!1}},`isWsl`),b=a.env.__IS_WSL_TEST__?y:y(),ee=i(u.execFile),x=e(()=>`${a.env.SYSTEMROOT||a.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,`powerShellPath`),S=e(async(e,t={})=>{let{powerShellPath:n,...r}=t,i=S.encodeCommand(e);return ee(n??x(),[...S.argumentsPrefix,i],{encoding:`utf8`,...r})},`executePowerShell`);S.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],S.encodeCommand=e=>s.from(e,`utf16le`).toString(`base64`),S.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function C(e){for(let t of e.split(`
|
|
3
3
|
`)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}e(C,`parseMountPointFromConfig`);var te=i(u.execFile),ne=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await c.access(n,l.F_OK),r=!0}catch{}if(!r)return e;let i=C(await c.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),w=b?e(async()=>`${await ne()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,`powerShellPathFromWsl`):x,T,E=e(async()=>(T??=(async()=>{try{let e=await w();return await c.access(e,l.X_OK),!0}catch{return!1}})(),T),`canAccessPowerShell`),D=e(async()=>{let e=await w(),{stdout:t}=await S(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},`wslDefaultBrowser`),O=e(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await te(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}},`convertWslPathToWindows`);function k(t,n,r){let i=e(e=>Object.defineProperty(t,n,{value:e,enumerable:!0,writable:!0}),`define`);return Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let e=r();return i(e),e},set(e){i(e)}}),t}e(k,`defineLazyProperty`);var A=i(d);async function j(){if(a.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await A(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}e(j,`defaultBrowserId`);var M=i(d);async function N(e,{humanReadableOutput:t=!0,signal:n}={}){if(a.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:o}=await M(`osascript`,[`-e`,e,r],i);return o.trim()}e(N,`runAppleScript`);async function P(e){return N(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
4
4
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}e(P,`bundleName`);var F=i(d),I={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},L=new Map(Object.entries(I)),R=class extends Error{static{e(this,`UnknownBrowserError`)}};async function z(e=F){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new R(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=I[r];if(!i)throw new R(`Unknown browser ID: ${r}`);return i}e(z,`defaultBrowser`);var B=i(d),V=e(e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),`titleize`);async function H(){if(a.platform===`darwin`){let e=await j();return{name:await P(e),id:e}}if(a.platform===`linux`){let{stdout:e}=await B(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:V(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(a.platform===`win32`)return z();throw Error(`Only macOS, Linux, and Windows are supported`)}e(H,`defaultBrowser`);var U=!!(a.env.SSH_CONNECTION||a.env.SSH_CLIENT||a.env.SSH_TTY),W=Symbol(`fallbackAttempt`),G=import.meta.url?n.dirname(o(import.meta.url)):``,K=n.join(G,`xdg-open`),{platform:q,arch:J}=a,Y=e(async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},`tryEachApp`),X=e(async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[W]===!0;if(delete e[W],Array.isArray(e.app))return Y(e.app,t=>X({...e,app:t,[W]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Y(n,t=>X({...e,app:{name:t,arguments:r},[W]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(b){let e=await D();a=L.get(e)??{}}else a=await H();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return X({...e,app:{name:$[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let i,o=[],s={},d=!1;if(b&&!v()&&!U&&!n&&(d=await E()),q===`darwin`)i=`open`,e.wait&&o.push(`--wait-apps`),e.background&&o.push(`--background`),e.newInstance&&o.push(`--new`),n&&o.push(`-a`,n);else if(q===`win32`||d){i=await w(),o.push(...S.argumentsPrefix),b||(s.windowsVerbatimArguments=!0),b&&e.target&&(e.target=await O(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(S.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(S.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>S.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=S.encodeCommand(t.join(` `)),e.wait||(s.stdio=`ignore`)}else{if(n)i=n;else{let e=!G||G===`/`,t=!1;try{await c.access(K,l.X_OK),t=!0}catch{}i=a.versions.electron??(q===`android`||e||!t)?`xdg-open`:K}r.length>0&&o.push(...r),e.wait||(s.stdio=`ignore`,s.detached=!0)}q===`darwin`&&r.length>0&&o.push(`--args`,...r),e.target&&o.push(e.target);let f=u.spawn(i,o,s);return e.wait?new Promise((t,n)=>{f.once(`error`,n),f.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(f)})}):t?new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.once(`close`,n=>{if(f.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}f.unref(),e(f)})})}):(f.unref(),new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.off(`error`,t),e(f)})}))},`baseOpen`),re=e((e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return X({...t,target:e})},`open`);function Z(e){if(typeof e==`string`||Array.isArray(e))return e;let{[J]:t}=e;if(!t)throw Error(`${J} is not supported`);return t}e(Z,`detectArchBinary`);function Q({[q]:e},{wsl:t}={}){if(t&&b)return Z(t);if(!e)throw Error(`${q} is not supported`);return Z(e)}e(Q,`detectPlatformBinary`);var $={browser:`browser`,browserPrivate:`browserPrivate`};k($,`chrome`,()=>Q({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),k($,`brave`,()=>Q({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),k($,`firefox`,()=>Q({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),k($,`edge`,()=>Q({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),k($,`safari`,()=>Q({darwin:`Safari`}));var ie=re;export{ie as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./chunk-Q72B4Q5Z-Cr1H_iK6.mjs";import t from"node:fs";import n from"node:path";import r from"node:os";import{promisify as i}from"node:util";import a from"node:process";import{fileURLToPath as o}from"node:url";import{Buffer as s}from"node:buffer";import c,{constants as l}from"node:fs/promises";import u,{execFile as d}from"node:child_process";var f;function p(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}e(p,`hasDockerEnv`);function m(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}e(m,`hasDockerCGroup`);function h(){return f===void 0&&(f=p()||m()),f}e(h,`isDocker`);var g,_=e(()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}},`hasContainerEnv`);function v(){return g===void 0&&(g=_()||h()),g}e(v,`isInsideContainer`);var y=e(()=>{if(a.platform!==`linux`)return!1;if(r.release().toLowerCase().includes(`microsoft`))return!v();try{return t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!v():!1}catch{return!1}},`isWsl`),b=a.env.__IS_WSL_TEST__?y:y(),ee=i(u.execFile),x=e(()=>`${a.env.SYSTEMROOT||a.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,`powerShellPath`),S=e(async(e,t={})=>{let{powerShellPath:n,...r}=t,i=S.encodeCommand(e);return ee(n??x(),[...S.argumentsPrefix,i],{encoding:`utf8`,...r})},`executePowerShell`);S.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],S.encodeCommand=e=>s.from(e,`utf16le`).toString(`base64`),S.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function C(e){for(let t of e.split(`
|
|
3
|
+
`)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}e(C,`parseMountPointFromConfig`);var te=i(u.execFile),ne=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await c.access(n,l.F_OK),r=!0}catch{}if(!r)return e;let i=C(await c.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),w=b?e(async()=>`${await ne()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,`powerShellPathFromWsl`):x,T,E=e(async()=>(T??=(async()=>{try{let e=await w();return await c.access(e,l.X_OK),!0}catch{return!1}})(),T),`canAccessPowerShell`),D=e(async()=>{let e=await w(),{stdout:t}=await S(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},`wslDefaultBrowser`),O=e(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await te(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}},`convertWslPathToWindows`);function k(t,n,r){let i=e(e=>Object.defineProperty(t,n,{value:e,enumerable:!0,writable:!0}),`define`);return Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let e=r();return i(e),e},set(e){i(e)}}),t}e(k,`defineLazyProperty`);var A=i(d);async function j(){if(a.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await A(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}e(j,`defaultBrowserId`);var M=i(d);async function N(e,{humanReadableOutput:t=!0,signal:n}={}){if(a.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:o}=await M(`osascript`,[`-e`,e,r],i);return o.trim()}e(N,`runAppleScript`);async function P(e){return N(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
4
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}e(P,`bundleName`);var F=i(d),I={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},L=new Map(Object.entries(I)),R=class extends Error{static{e(this,`UnknownBrowserError`)}};async function z(e=F){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new R(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=I[r];if(!i)throw new R(`Unknown browser ID: ${r}`);return i}e(z,`defaultBrowser`);var B=i(d),V=e(e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),`titleize`);async function H(){if(a.platform===`darwin`){let e=await j();return{name:await P(e),id:e}}if(a.platform===`linux`){let{stdout:e}=await B(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:V(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(a.platform===`win32`)return z();throw Error(`Only macOS, Linux, and Windows are supported`)}e(H,`defaultBrowser`);var U=!!(a.env.SSH_CONNECTION||a.env.SSH_CLIENT||a.env.SSH_TTY),W=Symbol(`fallbackAttempt`),G=import.meta.url?n.dirname(o(import.meta.url)):``,K=n.join(G,`xdg-open`),{platform:q,arch:J}=a,Y=e(async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},`tryEachApp`),X=e(async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[W]===!0;if(delete e[W],Array.isArray(e.app))return Y(e.app,t=>X({...e,app:t,[W]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Y(n,t=>X({...e,app:{name:t,arguments:r},[W]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(b){let e=await D();a=L.get(e)??{}}else a=await H();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return X({...e,app:{name:$[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let i,o=[],s={},d=!1;if(b&&!v()&&!U&&!n&&(d=await E()),q===`darwin`)i=`open`,e.wait&&o.push(`--wait-apps`),e.background&&o.push(`--background`),e.newInstance&&o.push(`--new`),n&&o.push(`-a`,n);else if(q===`win32`||d){i=await w(),o.push(...S.argumentsPrefix),b||(s.windowsVerbatimArguments=!0),b&&e.target&&(e.target=await O(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(S.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(S.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>S.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=S.encodeCommand(t.join(` `)),e.wait||(s.stdio=`ignore`)}else{if(n)i=n;else{let e=!G||G===`/`,t=!1;try{await c.access(K,l.X_OK),t=!0}catch{}i=a.versions.electron??(q===`android`||e||!t)?`xdg-open`:K}r.length>0&&o.push(...r),e.wait||(s.stdio=`ignore`,s.detached=!0)}q===`darwin`&&r.length>0&&o.push(`--args`,...r),e.target&&o.push(e.target);let f=u.spawn(i,o,s);return e.wait?new Promise((t,n)=>{f.once(`error`,n),f.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(f)})}):t?new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.once(`close`,n=>{if(f.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}f.unref(),e(f)})})}):(f.unref(),new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.off(`error`,t),e(f)})}))},`baseOpen`),re=e((e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return X({...t,target:e})},`open`);function Z(e){if(typeof e==`string`||Array.isArray(e))return e;let{[J]:t}=e;if(!t)throw Error(`${J} is not supported`);return t}e(Z,`detectArchBinary`);function Q({[q]:e},{wsl:t}={}){if(t&&b)return Z(t);if(!e)throw Error(`${q} is not supported`);return Z(e)}e(Q,`detectPlatformBinary`);var $={browser:`browser`,browserPrivate:`browserPrivate`};k($,`chrome`,()=>Q({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),k($,`brave`,()=>Q({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),k($,`firefox`,()=>Q({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),k($,`edge`,()=>Q({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),k($,`safari`,()=>Q({darwin:`Safari`}));var ie=re;export{ie as default};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as a,r as o,t as s}from"./body-parser-CUWbw_Tq.mjs";import{n as c}from"./input-validation-Ch4Vllrm.mjs";import{a as l,i as u,n as d}from"./prompt-Bx2PB-tt.mjs";import{t as f}from"./cli-types-tt_LZMbn.mjs";function p(e){return e.usage(`$0 organization account list
|
|
3
|
+
|
|
4
|
+
Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
|
|
5
|
+
a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
|
|
6
|
+
a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
|
|
7
|
+
a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
|
|
8
|
+
a particular string.`}).option(`name`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name is equal to a
|
|
9
|
+
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
|
|
10
|
+
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
|
|
11
|
+
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
|
|
12
|
+
string.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.\nWhen not specified, results are ordered by internal account ID.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`include-tags`,{type:`boolean`,description:`Include Account tags from the resource tag mirror. Omit this parameter to preserve the existing Account response shape.`}).option(`include-total`,{type:`boolean`,description:`Whether to calculate and return the exact result_info.total_size for cursor
|
|
13
|
+
pagination. Defaults to true. When false, total_size is omitted. page_size and
|
|
14
|
+
include_total may change between pages; next_page_token remains the authoritative
|
|
15
|
+
continuation signal.
|
|
16
|
+
Legacy page/per_page requests always calculate total_count.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
17
|
+
provided will retrieve the next page.
|
|
18
|
+
|
|
19
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
20
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`Get organization accounts`,builder:f(p),handler:async a=>i({command:`organization account list`,classification:{safeFlags:[`order-by`,`direction`,`include-tags`,`include-total`,`dry-run`]}},a,async()=>{let i={account_pubname:a[`account-pubname`],"account_pubname.startsWith":a[`account-pubname-starts-with`],"account_pubname.endsWith":a[`account-pubname-ends-with`],"account_pubname.contains":a[`account-pubname-contains`],name:a.name,"name.startsWith":a[`name-starts-with`],"name.endsWith":a[`name-ends-with`],"name.contains":a[`name-contains`],order_by:a[`order-by`],direction:a.direction,include_tags:a[`include-tags`],include_total:a[`include-total`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organization.account.list({organization_id:a[`organization-id`],...i})),{successLabel:`Loaded`})})},h={command:`account`,describe:`Operations for account`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.usage(`$0 organization create
|
|
21
|
+
|
|
22
|
+
Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create organization`,builder:g,handler:async o=>i({command:`organization create`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:o.body===void 0?s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body);t(await r(`Creating`,async()=>i.organization.create({...e})),{successLabel:`Created`});return}o.name===void 0&&(o.name=await l(`name`,`The name field`));let u=s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Creating`,async()=>i.organization.create({...u})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 organization delete <organization-id>
|
|
23
|
+
|
|
24
|
+
Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,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 <organization-id>`,describe:`Delete organization.`,builder:v,handler:async a=>i({command:`organization delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf organization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await d({force:!!a.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
25
|
+
`);return}t(await r(`Deleting`,async()=>i.organization.delete({organization_id:a[`organization-id`]})),{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 organization get <organization-id>
|
|
26
|
+
|
|
27
|
+
Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <organization-id>`,describe:`Get organization`,builder:b,handler:async a=>i({command:`organization get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.organization.get({organization_id:a[`organization-id`]})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 organization invite update <member-code>
|
|
28
|
+
|
|
29
|
+
Accept or reject an invitation to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`member-code`,{type:`string`,description:`The invitation code to accept or reject.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The ID of the organization associated with the invitation.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`accept`,`reject`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The invitation action. Use `accept` to join the organization or `reject` to decline the invitation."})}const C={command:`update <member-code>`,describe:`Handle organization invite`,builder:S,handler:async o=>i({command:`organization invite update`,classification:{safeFlags:[`status`,`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization invite update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/invites/${o[`member-code`]==null?`<member-code>`:encodeURIComponent(String(o[`member-code`]))}`,pathParams:{"organization-id":String(o[`organization-id`]??``),"member-code":String(o[`member-code`]??``)},bodyKind:`json`,body:o.body===void 0?s({status:c(o.status,`status`,`text`)}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body);t(await r(`Updating`,async()=>i.organization.invite.update({...e,organization_id:o[`organization-id`],member_code:o[`member-code`]})),{successLabel:`Updated`});return}o.status===void 0&&(o.status=await u(`status`,`The status field`,[`accept`,`reject`]));let l=s({status:c(o.status,`status`,`text`)});t(await r(`Updating`,async()=>i.organization.invite.update({...l,organization_id:o[`organization-id`],member_code:o[`member-code`]})),{successLabel:`Updated`})})},w={command:`invite`,describe:`Operations for invite`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 organization list
|
|
30
|
+
|
|
31
|
+
Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
|
|
32
|
+
by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
|
|
33
|
+
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
|
|
34
|
+
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
|
|
35
|
+
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
|
|
36
|
+
string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
37
|
+
account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
38
|
+
user.
|
|
39
|
+
|
|
40
|
+
IMPORTANT: Just because an organization "contains" a user is not a
|
|
41
|
+
representation of any authorization or privilege to manage any resources
|
|
42
|
+
therein. An organization "containing" a user simply means the user is managed by
|
|
43
|
+
that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
44
|
+
organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
|
|
45
|
+
of the specified organization.
|
|
46
|
+
|
|
47
|
+
"null" is a valid value to provide for this parameter. It means "where
|
|
48
|
+
an organization has no parent (i.e. it is a 'root' organization)."`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
49
|
+
provided will retrieve the next page.
|
|
50
|
+
|
|
51
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
52
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List organizations the user has access to`,builder:f(T),handler:async a=>i({command:`organization list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={id:a.id,name:a.name,"name.startsWith":a[`name-starts-with`],"name.endsWith":a[`name-ends-with`],"name.contains":a[`name-contains`],"containing.account":a[`containing-account`],"containing.user":a[`containing-user`],"containing.organization":a[`containing-organization`],"parent.id":a[`parent-id`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organization.list(i)),{successLabel:`Loaded`})})};function D(e){return e.usage(`$0 organization member batch create <organization-id>
|
|
53
|
+
|
|
54
|
+
Batch create multiple memberships that grant access to a specific Organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`members`,{type:`string`,description:`The members field. 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 O={command:`create <organization-id>`,describe:`Batch create organization members`,builder:D,handler:async c=>i({command:`organization member batch create`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){n({command:`cf organization member batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${c[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(c[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(c[`organization-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({members:o(c.members,`members`)}):a(c.body)});return}let i=await e(c);if(c.body){let e=a(c.body);t(await r(`Creating`,async()=>i.organization.member.batch.create({...e,organization_id:c[`organization-id`]})),{successLabel:`Created`});return}if(c.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let l=s({members:o(c.members,`members`)});t(await r(`Creating`,async()=>i.organization.member.batch.create({...l,organization_id:c[`organization-id`]})),{successLabel:`Created`})})},k={command:`batch`,describe:`Operations for member.batch`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.usage(`$0 organization member create <organization-id>
|
|
55
|
+
|
|
56
|
+
Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).option(`member-user-email`,{type:`string`,description:`The member.user.email 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 j={command:`create <organization-id>`,describe:`Create organization member`,builder:A,handler:async o=>i({command:`organization member create`,classification:{safeFlags:[`member-status`,`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization member create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/members`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({member:{status:c(o[`member-status`],`member-status`,`text`),user:{email:c(o[`member-user-email`],`member-user-email`,`text`)}}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body);t(await r(`Creating`,async()=>i.organization.member.create({...e,organization_id:o[`organization-id`]})),{successLabel:`Created`});return}o[`member-user-email`]===void 0&&(o[`member-user-email`]=await l(`member-user-email`,`The member.user.email field`));let u=s({member:{status:c(o[`member-status`],`member-status`,`text`),user:{email:c(o[`member-user-email`],`member-user-email`,`text`)}}});t(await r(`Creating`,async()=>i.organization.member.create({...u,organization_id:o[`organization-id`]})),{successLabel:`Created`})})};function M(e){return e.usage(`$0 organization member delete <member-id>
|
|
57
|
+
|
|
58
|
+
Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <member-id>`,describe:`Delete organization member`,builder:M,handler:async a=>i({command:`organization member delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf organization member delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await d({force:!!a.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
59
|
+
`);return}t(await r(`Deleting`,async()=>i.organization.member.delete({organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Deleted`})})};function P(e){return e.usage(`$0 organization member get <member-id>
|
|
60
|
+
|
|
61
|
+
Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <member-id>`,describe:`Get organization member`,builder:P,handler:async a=>i({command:`organization member get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization member get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.organization.member.get({organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Loaded`})})};function I(e){return e.usage(`$0 organization member list
|
|
62
|
+
|
|
63
|
+
List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
64
|
+
provided will retrieve the next page.
|
|
65
|
+
|
|
66
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
67
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List organization members`,builder:f(I),handler:async a=>i({command:`organization member list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={status:a.status,"user.email":a[`user-email`],"user.email.contains":a[`user-email-contains`],"user.email.startsWith":a[`user-email-starts-with`],"user.email.endsWith":a[`user-email-ends-with`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization member list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organization.member.list({organization_id:a[`organization-id`],...i})),{successLabel:`Loaded`})})},R={command:`member`,describe:`Operations for member`,builder:e=>e.command(j).command(N).command(F).command(L).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 organization profile get <organization-id>
|
|
68
|
+
|
|
69
|
+
Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <organization-id>`,describe:`Get organization profile`,builder:z,handler:async a=>i({command:`organization profile get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/profile`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.organization.profile.get({organization_id:a[`organization-id`]})),{successLabel:`Loaded`})})};function V(e){return e.usage(`$0 organization profile update <organization-id>
|
|
70
|
+
|
|
71
|
+
Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 H={command:`update <organization-id>`,describe:`Modify organization profile.`,builder:V,handler:async o=>i({command:`organization profile update`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/profile`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({business_address:c(o[`business-address`],`business-address`,`text`),business_email:c(o[`business-email`],`business-email`,`text`),business_name:c(o[`business-name`],`business-name`,`text`),business_phone:c(o[`business-phone`],`business-phone`,`text`),external_metadata:c(o[`external-metadata`],`external-metadata`,`text`)}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body);t(await r(`Updating`,async()=>i.organization.profile.update({...e,organization_id:o[`organization-id`]})),{successLabel:`Updated`});return}o[`business-address`]===void 0&&(o[`business-address`]=await l(`business-address`,`The business_address field`)),o[`business-email`]===void 0&&(o[`business-email`]=await l(`business-email`,`The business_email field`)),o[`business-name`]===void 0&&(o[`business-name`]=await l(`business-name`,`The business_name field`)),o[`business-phone`]===void 0&&(o[`business-phone`]=await l(`business-phone`,`The business_phone field`)),o[`external-metadata`]===void 0&&(o[`external-metadata`]=await l(`external-metadata`,`The external_metadata field`));let u=s({business_address:c(o[`business-address`],`business-address`,`text`),business_email:c(o[`business-email`],`business-email`,`text`),business_name:c(o[`business-name`],`business-name`,`text`),business_phone:c(o[`business-phone`],`business-phone`,`text`),external_metadata:c(o[`external-metadata`],`external-metadata`,`text`)});t(await r(`Updating`,async()=>i.organization.profile.update({...u,organization_id:o[`organization-id`]})),{successLabel:`Updated`})})},U={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 organization share list
|
|
72
|
+
|
|
73
|
+
Lists all organization shares.`).option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List organization shares`,builder:f(W),handler:async a=>i({command:`organization share list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`dry-run`]}},a,async()=>{let i={status:a.status,kind:a.kind,target_type:a[`target-type`],resource_types:a[`resource-types`],order:a.order,direction:a.direction,page:a.page,per_page:a[`per-page`]};if(a.dryRun){n({command:`cf organization share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/shares`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organization.share.list({organization_id:a[`organization-id`],...i})),{successLabel:`Loaded`})})},K={command:`share`,describe:`Operations for share`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.usage(`$0 organization update <organization-id>
|
|
74
|
+
|
|
75
|
+
Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const J={command:`update <organization-id>`,describe:`Modify organization.`,builder:q,handler:async o=>i({command:`organization update`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body);t(await r(`Updating`,async()=>i.organization.update({body:e,organization_id:o[`organization-id`]})),{successLabel:`Updated`});return}o.name===void 0&&(o.name=await l(`name`,`The name field`));let u=s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Updating`,async()=>i.organization.update({body:u,organization_id:o[`organization-id`]})),{successLabel:`Updated`})})},Y={command:`organization`,describe:`organization`,builder:e=>e.command(_).command(y).command(x).command(E).command(J).command(h).command(w).command(R).command(U).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Y as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{t as a}from"./cli-types-tt_LZMbn.mjs";function o(e){return e.usage("$0 organizations billing usage get <organization-id>\n\nReturns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days. An organization with no accounts, or an organization ID that does not exist, returns a successful response with an empty result set rather than an error.").positional(`organization-id`,{type:`string`,description:`Identifies the Cloudflare organization.`,demandOption:!0}).option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`get <organization-id>`,describe:`Get Organization Usage (Version 2, Alpha, Restricted)`,builder:o,handler:async a=>i({command:`organizations billing usage get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={from:a.from,to:a.to};if(a.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:a[`organization-id`],...i})),{successLabel:`Loaded`})})},c={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},l={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.usage(`$0 organizations logs audit get <organization-id>
|
|
3
|
+
|
|
4
|
+
Gets a list of audit logs for an organization.`).positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get <organization-id>`,describe:`Get organization audit logs (Version 2)`,builder:a(u),handler:async a=>i({command:`organizations logs audit get`,classification:{safeFlags:[`direction`,`dry-run`]}},a,async()=>{let i={action_result:a[`action-result`],action_type:a[`action-type`],actor_context:a[`actor-context`],actor_email:a[`actor-email`],actor_id:a[`actor-id`],actor_ip_address:a[`actor-ip-address`],actor_token_id:a[`actor-token-id`],actor_token_name:a[`actor-token-name`],actor_type:a[`actor-type`],id:a.id,raw_cf_ray_id:a[`raw-cf-ray-id`],raw_method:a[`raw-method`],raw_status_code:a[`raw-status-code`],raw_uri:a[`raw-uri`],resource_id:a[`resource-id`],resource_product:a[`resource-product`],resource_type:a[`resource-type`],resource_scope:a[`resource-scope`],"action_result.not":a[`action-result-not`],"action_type.not":a[`action-type-not`],"actor_context.not":a[`actor-context-not`],"actor_email.not":a[`actor-email-not`],"actor_id.not":a[`actor-id-not`],"actor_ip_address.not":a[`actor-ip-address-not`],"actor_token_id.not":a[`actor-token-id-not`],"actor_token_name.not":a[`actor-token-name-not`],"actor_type.not":a[`actor-type-not`],"id.not":a[`id-not`],"raw_cf_ray_id.not":a[`raw-cf-ray-id-not`],"raw_method.not":a[`raw-method-not`],"raw_status_code.not":a[`raw-status-code-not`],"raw_uri.not":a[`raw-uri-not`],"resource_id.not":a[`resource-id-not`],"resource_product.not":a[`resource-product-not`],"resource_type.not":a[`resource-type-not`],"resource_scope.not":a[`resource-scope-not`],since:a.since,before:a.before,direction:a.direction,limit:a.limit,cursor:a.cursor};if(a.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:a[`organization-id`],...i})),{successLabel:`Loaded`})})};function f(e){return e.usage("$0 organizations logs audit history <id>\n\nReturns the chronological change history for the resource identified by the given organization-scoped audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.").positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The unique ID that identifies the organization.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`history <id>`,describe:`Get resource change history from an organization audit log entry (Version 2)`,builder:a(f),handler:async a=>i({command:`organizations logs audit history`,classification:{safeFlags:[`direction`,`dry-run`]}},a,async()=>{let i={action_time:a[`action-time`],since:a.since,before:a.before,direction:a.direction,limit:a.limit,cursor:a.cursor};if(a.dryRun){n({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/logs/audit/${a.id==null?`<id>`:encodeURIComponent(String(a.id))}/history`,pathParams:{"organization-id":String(a[`organization-id`]??``),id:String(a.id??``)},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.organizations.logs.audit.history({organization_id:a[`organization-id`],id:a.id,...i})),{successLabel:`Loaded`})})},m={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(l).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as a,t as o}from"./body-parser-CUWbw_Tq.mjs";import{n as s}from"./input-validation-Ch4Vllrm.mjs";import{a as c,i as l,n as u}from"./prompt-Bx2PB-tt.mjs";import{t as d}from"./cli-types-tt_LZMbn.mjs";function f(e){return e.usage(`$0 origin-ca-certificates create
|
|
3
|
+
|
|
4
|
+
Create an Origin CA certificate. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`).option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`hostnames`,{type:`string`,array:!0,description:"Array of hostnames or wildcard names bound to the certificate.\nHostnames must be fully qualified domain names (FQDNs) belonging to zones on your account (e.g., `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` prefix for a single level (e.g., `*.example.com`). Double wildcards (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically converted to punycode."}).option(`request-type`,{type:`string`,description:`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,choices:[`origin-rsa`,`origin-ecc`,`keyless-certificate`]}).option(`requested-validity`,{type:`number`,description:`The number of days for which the certificate should be valid.`,default:5475}).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 p={command:`create`,describe:`Create Certificate`,builder:f,handler:async u=>i({command:`origin-ca-certificates create`,classification:{safeFlags:[`request-type`,`dry-run`]}},u,async()=>{if(u.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:u.body===void 0?o({csr:s(u.csr,`csr`,`text`),hostnames:u.hostnames,request_type:s(u[`request-type`],`request-type`,`text`),requested_validity:u[`requested-validity`]}):a(u.body)});return}let i=await e(u);if(u.body){let e=a(u.body);t(await r(`Creating`,async()=>i.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(u.csr===void 0&&(u.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),u.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);u[`request-type`]===void 0&&(u[`request-type`]=await l(`request-type`,`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,[`origin-rsa`,`origin-ecc`,`keyless-certificate`]));let d=o({csr:s(u.csr,`csr`,`text`),hostnames:u.hostnames,request_type:s(u[`request-type`],`request-type`,`text`),requested_validity:u[`requested-validity`]});t(await r(`Creating`,async()=>i.originCaCertificates.create({...d})),{successLabel:`Created`})})};function m(e){return e.usage(`$0 origin-ca-certificates delete <certificate-id>
|
|
5
|
+
|
|
6
|
+
Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`).positional(`certificate-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 h={command:`delete <certificate-id>`,describe:`Revoke Certificate`,builder:m,handler:async a=>i({command:`origin-ca-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}t(await r(`Deleting`,async()=>i.originCaCertificates.delete({certificate_id:a[`certificate-id`]})),{successLabel:`Deleted`})})};function g(e){return e.usage(`$0 origin-ca-certificates get <certificate-id>
|
|
8
|
+
|
|
9
|
+
Get an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`).positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <certificate-id>`,describe:`Get Certificate`,builder:g,handler:async a=>i({command:`origin-ca-certificates get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.originCaCertificates.get({certificate_id:a[`certificate-id`]})),{successLabel:`Loaded`})})};function v(e){return e.usage(`$0 origin-ca-certificates list
|
|
10
|
+
|
|
11
|
+
List all existing Origin CA certificates for a given zone. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`).option(`zone-id`,{type:`string`,description:`Identifier.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List Certificates`,builder:d(v),handler:async a=>i({command:`origin-ca-certificates list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={zone_id:a[`zone-id`],page:a.page,per_page:a[`per-page`],limit:a.limit,offset:a.offset};if(a.dryRun){n({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:i,bodyKind:`none`});return}let o=await e(a);t(await r(`Loading`,async()=>o.originCaCertificates.list(i)),{successLabel:`Loaded`})})},b={command:`origin-ca-certificates`,describe:`origin-ca-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|