cf 0.9.0 → 0.10.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/README.md +5 -0
- package/dist/_meta/agent-context.json +34 -35
- package/dist/_meta/commands.json +6834 -10044
- package/dist/_meta/schemas.json +11228 -12752
- package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CGF4zcKf.mjs} +2 -2
- package/dist/{access-RbqBFrSC.mjs → access-lhLJo1v2.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-CYRm3yoN.mjs} +1 -1
- package/dist/account-tags-B88TotoH.mjs +9 -0
- package/dist/accounts-BSIAT_iP.mjs +28 -0
- package/dist/{acm-Szq4CoQN.mjs → acm-VULm1djv.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BHPBIkRY.mjs} +1 -1
- package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-KBy48G1b.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-DDv_Gxr7.mjs} +2 -2
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-BWZGvbca.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-jeB-sAgP.mjs} +1 -1
- package/dist/ai-search-BmdskMjR.mjs +7 -0
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-CsmfcaUx.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-viHB1tgI.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-Bl8OqViR.mjs} +4 -4
- package/dist/analytics-vOxw8Hy0.mjs +3 -0
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-DO4-C0wD.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-4FVrD4n8.mjs} +1 -1
- package/dist/argo-CQfCgazW.mjs +2 -0
- package/dist/args-DlUhyGU0.mjs +2 -0
- package/dist/artifacts-CVDGnr2V.mjs +4 -0
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-CzpwvQ6A.mjs} +1 -1
- package/dist/{auth-MeSu8lFz.mjs → auth-D0xZxAEa.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-MQEamPN9.mjs} +2 -2
- package/dist/{billing-0RNCYBJM.mjs → billing-aJgapeRm.mjs} +2 -2
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Y2q5d-pi.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-DANJqfmE.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CjpZWBjp.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-BtpCbh-2.mjs} +1 -1
- package/dist/browser-run-BFn9h2Tz.mjs +4 -0
- package/dist/{build-Nivzj54_.mjs → build-DcflwvqN.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-VyWK1SjY.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-BxoRYxs4.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-D7OAFxF_.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-C7DU4819.mjs} +2 -2
- package/dist/{chunk-LQW53VED-Xakf_rUn.mjs → chunk-LQW53VED-DLrXV-hE.mjs} +2 -2
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-DDUv8K0a.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-D4ysjwWT.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-Bhec6z2P.mjs} +1 -1
- package/dist/cloudforce-one-J_hn9ss9.mjs +36 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-Dycx8zFx.mjs +2 -0
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-BmxOSNtN.mjs} +1 -1
- package/dist/connector-telemetry-events-latest-BY2556uL.mjs +2 -0
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CdcqfKnH.mjs} +1 -1
- package/dist/connector-telemetry-snapshots-latest-BHYdxUEF.mjs +2 -0
- package/dist/{connectors-BRCQSsos.mjs → connectors-BqxYMMtQ.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-CKW081JA.mjs} +8 -8
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-Dgd7A8KF.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DYL37wLc.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-CkhSbfAs.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-BzAOnEoT.mjs} +1 -1
- package/dist/custom-csrs-CgzG3pd3.mjs +3 -0
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-q_nsnlye.mjs} +4 -4
- package/dist/custom-nameservers-BUBmfhUe.mjs +3 -0
- package/dist/custom-pages-M7jA2Hit.mjs +3 -0
- package/dist/{d1-FmAh7T7l.mjs → d1-BFvMd6-S.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-Bji4Or_j.mjs} +2 -2
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-BuoRQ1Yh.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-CZ7bgNDu.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-CrvuoDGJ.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-V10MG-Bg.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-BTH-8nJH.mjs} +2 -2
- package/dist/{directory-CGNWfVQc.mjs → directory-BlH6N6Qy.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-BCjH1JzB.mjs} +1 -1
- package/dist/{dist-COfwjT96.mjs → dist-CgrMkXFx.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BF5iN78p.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-CeCTNqRk.mjs} +11 -11
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-B54MaLGm.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-D8FQORrL.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DJK0Eb30.mjs} +1 -1
- package/dist/email-routing-NpmiKIrl.mjs +6 -0
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BLZ7WZ9Z.mjs} +2 -2
- package/dist/email-sending-dn-353Nx.mjs +7 -0
- package/dist/fieldExtractors-ahysj57J.mjs +3 -0
- package/dist/firewall-CBPGJ43p.mjs +11 -0
- package/dist/{flagship-CPkQMist.mjs → flagship-BusjRNIb.mjs} +3 -3
- package/dist/{fraud-BhX0QNUl.mjs → fraud-BIhS8pLf.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-TZZ3F1tV.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-FiXIk-KP.mjs} +2 -2
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-Bx0mykMR.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-C8qCabBF.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-Cj63Kjc6.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CBWXCDhy.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-B-9Z_sJs.mjs} +2 -2
- package/dist/{interactive-CM2G03lr.mjs → interactive-DtsCYfrK.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-qs9eGJnI.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-THHvoXX3.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-D7N0j4-x.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-BFDUCnft.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DUlUCOoJ.mjs} +1 -1
- package/dist/load-balancers-D2zbQ8fT.mjs +6 -0
- package/dist/{local-eEF0NF51.mjs → local-D-aVNu6A.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-Dh3keC5v.mjs} +1 -1
- package/dist/logexplorer-CUsfZ_bS.mjs +13 -0
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-CJcthPHf.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-BS65zN8q.mjs} +1 -1
- package/dist/logpush-BK34mMQs.mjs +4 -0
- package/dist/{logs-C07M9zn-.mjs → logs-CLAqX9h2.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-h_ozrC5S.mjs} +1 -1
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +4 -0
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-BtsFePMx.mjs} +5 -5
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-Cm_KVCMB.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-InA1hwII.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-mJ7bekNJ.mjs} +1 -1
- package/dist/mesh-BK4S1Ezy.mjs +4 -0
- package/dist/{moq-BBQVNGo1.mjs → moq-qmuVPAO0.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-CU4OAAXY.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D74cSy3t.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-BJ0Nc48J.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-B0ETkNcX.mjs} +2 -2
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-Br-smLxQ.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-D5bF11ju.mjs} +1 -1
- package/dist/observability-BWE0Gg3V.mjs +4 -0
- package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-R-qesf18.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-NX7yCZrq.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-DLhiRt8g.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-Ff4McZRQ.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-UuTr4_SW.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DOJ1zlH3.mjs} +1 -1
- package/dist/{output-DgW1hQGX.mjs → output-DrpYYfnB.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-BSz1gO-_.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-DVDogxPs.mjs} +4 -4
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-BrLXK7gT.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-BszRk4sM.mjs} +2 -2
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BPNjQr76.mjs} +1 -1
- package/dist/progress-CsHIt3Tp.mjs +2 -0
- package/dist/{prompt-DM4z101s.mjs → prompt-DdegNPpg.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-JL1H1Biz.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-DpkYdRUE.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CKozthw_.mjs} +4 -4
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-Du7hN9jA.mjs} +1 -1
- package/dist/radar-C-92vggG.mjs +2 -0
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-yBF3qoYD.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-CteyTOM2.mjs} +1 -1
- package/dist/realtimekit-CIP7lP-a.mjs +7 -0
- package/dist/{registrar-C0EsXf83.mjs → registrar-DKKN0M29.mjs} +3 -3
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-DiXg8p_1.mjs} +3 -3
- package/dist/{registry-CJvn75Bq.mjs → registry-Bck_zFkz.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-fg_GKXe1.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-CkMya96z.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-D1pSDvtf.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-z48JGHCq.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-BTmNjDN-.mjs} +1 -1
- package/dist/rulesets-CsoSM-17.mjs +5 -0
- package/dist/{rum-Dyno5zj3.mjs → rum-DB4iO2q5.mjs} +1 -1
- package/dist/{schema-BeXPWeK9.mjs → schema-B34Q9tLF.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-iGoOriJt.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-CcSyfKCH.mjs} +1 -1
- package/dist/sdk-ZctLa5jW.mjs +3 -0
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-DFmvtphu.mjs} +1 -1
- package/dist/security-center-DFKeHq5c.mjs +2 -0
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-DqnFpjMI.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-D6KHthHf.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-BuwYUzOL.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-VppSAQf4.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-D6X8L7p8.mjs} +2 -2
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-DIpc9pb_.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-O1RS01vr.mjs} +2 -2
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-b7N1ZRAm.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-cw31yFva.mjs} +1 -1
- package/dist/src-D_HETJNy.mjs +108 -0
- package/dist/{ssl-BsxTHasY.mjs → ssl-CsEhRVTO.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-Bb5Cbc_L.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-DFOao6Gu.mjs} +3 -3
- package/dist/{submit-BjdywxTq.mjs → submit--xTzyNPy.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-efICDkah.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-CerHuToJ.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-C4otMBm2.mjs} +1 -1
- package/dist/{tools-D2Xxfkrc.mjs → tools-BHfBOZOU.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-BEsiiKAf.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-DkMiNtVY.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-D0J8lJoI.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-CFmtY5bn.mjs} +2 -2
- package/dist/{ui-DjQ4AQww.mjs → ui-DE8CNn6c.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-DBCeRWwb.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-ClfFiruK.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-CNyvg65L.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-bifVEQq5.mjs} +2 -2
- package/dist/{values-Cmlw5wGZ.mjs → values-OxkdP1tV.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CVKu7lEt.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BVL-Ludh.mjs} +1 -1
- package/dist/waiting-rooms-CmRAl51T.mjs +11 -0
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-C2s9kzWf.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-y_cY91V_.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B55-oXOa.mjs} +4 -4
- package/dist/{workers-D8czeT64.mjs → workers-jDcq14GH.mjs} +6 -6
- package/dist/{workflows-BOi5MTEN.mjs → workflows-B-kGHxFu.mjs} +2 -2
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-27zwjLvv.mjs} +1 -1
- package/dist/zero-trust-DV3sIOvu.mjs +92 -0
- package/dist/{zone-Bx5ElO9U.mjs → zone-BJix2KQ9.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-Bkj5i92c.mjs} +1 -1
- package/package.json +2 -2
- package/dist/account-tags-CKRh1jra.mjs +0 -9
- package/dist/accounts-2pGhN4s8.mjs +0 -28
- package/dist/ai-search-2xP8FP_W.mjs +0 -7
- package/dist/analytics-UQrIx99t.mjs +0 -3
- package/dist/argo-Br60zF3y.mjs +0 -2
- package/dist/artifacts-D8HMRQmb.mjs +0 -4
- package/dist/browser-run-C5pYOwtf.mjs +0 -4
- package/dist/cloudforce-one-Cp4bQmrG.mjs +0 -30
- package/dist/connector-interrupts-BR47snkh.mjs +0 -2
- package/dist/custom-csrs-D0zBkQT5.mjs +0 -4
- package/dist/custom-nameservers-G2MWpRwY.mjs +0 -3
- package/dist/custom-pages-BINNZTds.mjs +0 -4
- package/dist/email-CGOC_evd.mjs +0 -2
- package/dist/email-routing-CRvIUSFm.mjs +0 -6
- package/dist/email-sending-BwRN8PMW.mjs +0 -7
- package/dist/filters-DczM8qpH.mjs +0 -4
- package/dist/firewall-BMiETRmM.mjs +0 -11
- package/dist/load-balancers-Ct5cyyF9.mjs +0 -7
- package/dist/logexplorer-BhsAWxCr.mjs +0 -24
- package/dist/logpush-CFQBi88z.mjs +0 -5
- package/dist/magic-network-monitoring-CY3CHSpX.mjs +0 -4
- package/dist/media-CnxgOViL.mjs +0 -2
- package/dist/mesh-DLNLi3UT.mjs +0 -4
- package/dist/observability-B5p3iwrq.mjs +0 -4
- package/dist/progress-C-oFUtvC.mjs +0 -2
- package/dist/radar-Cu9rsTw_.mjs +0 -2
- package/dist/realtimekit-msnGHBbf.mjs +0 -7
- package/dist/rulesets-BHvhAeG_.mjs +0 -8
- package/dist/sdk-m4xeaua4.mjs +0 -3
- package/dist/security-center-DRC4Mf3R.mjs +0 -2
- package/dist/src-CgAVPA4I.mjs +0 -108
- package/dist/waiting-rooms-ku9UsAr9.mjs +0 -11
- package/dist/zero-trust-BmA0VkgF.mjs +0 -102
- package/dist/zone-tags-izd3WWmy.mjs +0 -9
- /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
- /package/dist/{alerts-B85uj2Vx.mjs → alerts-CRmjqOZi.mjs} +0 -0
- /package/dist/{autorag-Do9l_LyY.mjs → autorag-BD7cu5NU.mjs} +0 -0
- /package/dist/{body-parser-CYD7PKFC.mjs → body-parser-C-c9gfH1.mjs} +0 -0
- /package/dist/{brands-DateHCdd.mjs → brands-BhALBkX2.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
- /package/dist/{clear-CB2kgcEB.mjs → clear-BgF8No7D.mjs} +0 -0
- /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-BsTty22w.mjs} +0 -0
- /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C50W5GhA.mjs} +0 -0
- /package/dist/{health-buY5f5pp.mjs → health-BFNZqiAm.mjs} +0 -0
- /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-Bav2M9F-.mjs} +0 -0
- /package/dist/{internal-CwyoJUHh.mjs → internal-BTeSewwB.mjs} +0 -0
- /package/dist/{live-wEpA5V_n.mjs → live-Dkiyu30_.mjs} +0 -0
- /package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BwQqexwo-CNW_dPly.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-Dz-Wv1T0.mjs} +0 -0
- /package/dist/{ready-CBSCPiHE.mjs → ready-TKOkKeRg.mjs} +0 -0
- /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-3Asm6eIi.mjs} +0 -0
- /package/dist/{refute-u7ZPQJZy.mjs → refute-BVz9nMyd.mjs} +0 -0
- /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-CeBbH6Pq.mjs} +0 -0
- /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-ZteA-PUV.mjs} +0 -0
- /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-DWDSyzQ7.mjs} +0 -0
- /package/dist/{search-D9WDwnV4.mjs → search-DGNc37HK.mjs} +0 -0
- /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-B5Qpn2mn.mjs} +0 -0
- /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-FjUolE6A.mjs} +0 -0
- /package/dist/{theme-BePJemMn.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-NHJj1HGq.mjs} +0 -0
- /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CniKVHIp.mjs} +0 -0
- /package/dist/{verify-2yi0H93r.mjs → verify-DS1PWAJe.mjs} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <tunnel-id>`,describe:`Gets the high-availability configuration for a WARP Connector tunnel.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.configurations.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-fnr-id`,{type:`string`,description:`Floating Network Resource ID — the secondary ENI that is moved between nodes on failover.`}).option(`ha-mode`,{type:`string`,description:"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",choices:[`none`,`disabled`,`aws`,`local`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`update <tunnel-id>`,describe:`Adds or updates the high-availability configuration for a WARP Connector tunnel.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)}):s(u.body)});return}let f=await r(u),p=u.local?e:await t();if(u.accountId=p,u.body){let e=s(u.body);i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...e,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}u[`ha-mode`]===void 0&&(u[`ha-mode`]=await d(`ha-mode`,"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",[`none`,`disabled`,`aws`,`local`]));let m=c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)});i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...m,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},v={command:`configurations`,describe:`Operations for nodes.configurations`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches connection details for a WARP Connector Tunnel.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},x={command:`connections`,describe:`Operations for nodes.connections`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <connector-id>`,describe:`Fetches connector and connection details for a WARP Connector Tunnel.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},w={command:`connectors`,describe:`Operations for nodes.connectors`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`ha`,{type:`boolean`,description:`Indicates that the tunnel will be created to be highly available. If omitted, defaults to false.`,default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Creates a new Warp Connector Tunnel in an account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ha:d.ha,name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mesh.nodes.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({ha:d.ha,name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.mesh.nodes.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <tunnel-id>`,describe:`Deletes a Warp Connector Tunnel from an account.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes a Mesh node (Warp Connector Tunnel).`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>c.mesh.nodes.delete({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <tunnel-id>`,describe:`Updates an existing Warp Connector Tunnel.`,builder:k,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.mesh.nodes.edit({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>d.mesh.nodes.edit({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).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 M={command:`failover <tunnel-id>`,describe:`Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel.`,builder:j,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes failover`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${d[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(d[`tunnel-id`]))}/failover`,pathParams:{"tunnel-id":String(d[`tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({client_id:l(d[`connector-id`],`connector-id`,`text`)}):s(d.body)});return}let p=await r(d),m=d.local?e:await t();if(d.accountId=m,!await f({force:!!d.force,message:`This operation triggers a manual failover, changing the active connector for a Mesh node.`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}if(d.body){let e=s(d.body);i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...e,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`});return}d[`connector-id`]===void 0&&(d[`connector-id`]=await u(`connector-id`,`UUID of the Cloudflare Tunnel connector.`));let h=c({client_id:l(d[`connector-id`],`connector-id`,`text`)});i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...h,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`})}};function N(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <tunnel-id>`,describe:`Fetches a single Warp Connector Tunnel.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for the tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists and filters Warp Connector Tunnels in an account.`,builder:p(F),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf mesh nodes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mesh.nodes.list({account_id:u,...c})),{successLabel:`Loaded`})}};function L(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <tunnel-id>`,describe:`Gets the token used to associate warp device with a specific Warp Connector tunnel.`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.token.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},z={command:`token`,describe:`Operations for nodes.token`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`nodes`,describe:`Operations for nodes`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(I).command(v).command(x).command(w).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`mesh`,describe:`mesh`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";function f(e){return e.option(`name`,{type:`string`,description:`Human-readable name for the relay.`}).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:"Provisions a new MoQ relay instance. Auto-creates a publish+subscribe token and a subscribe-only token. Token values are included in the response (shown once). Config is always set to defaults (upstreams off) and cannot be supplied here — sending a non-empty `config` is rejected (21014); `null` or `{}` is accepted as absent. Use PUT to configure the relay after it exists.",builder:f,handler:async d=>{if(d.dryRun){a({command:`cf moq relays create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.moq.relays.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Human-readable name for the relay.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.moq.relays.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,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 <relay-id>`,describe:"Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.",builder:m,handler:async s=>{if(s.dryRun){a({command:`cf moq relays delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Deleting this relay revokes every token issued for it, so publishers and subscribers can no longer connect. This cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.moq.relays.delete({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <relay-id>`,describe:`Retrieves a single MoQ relay including config and status. Tokens are NOT included.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf moq relays get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.moq.relays.get({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`created-before`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly before this
|
|
4
4
|
RFC 3339 timestamp (typically the \`created\` value of the first item
|
|
5
5
|
on the current page, to fetch the previous page).`}).option(`created-after`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly after this
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.positional(`mtls-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 m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async d=>{if(d.dryRun){a({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});i(await o(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-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 y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.mtlsCertificates.delete({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-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 x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async s=>{let c={type:s.type};if(s.dryRun){a({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mtlsCertificates.list({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`mtls-certificates`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the route.`,default:``}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Routes a private network through a Cloudflare Tunnel.`,builder:p,handler:async d=>{if(d.dryRun){a({command:`cf network routes cidr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({comment:l(d.comment,`comment`,`text`),network:l(d.network,`network`,`text`),virtual_network_id:l(d[`virtual-network-id`],`virtual-network-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.network.routes.cidr.create({...e,account_id:p})),{successLabel:`Created`});return}d.network===void 0&&(d.network=await u(`network`,`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`));let m=c({comment:l(d.comment,`comment`,`text`),network:l(d.network,`network`,`text`),virtual_network_id:l(d[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Creating`,async()=>f.network.routes.cidr.create({...m,account_id:p})),{successLabel:`Created`})}};function ee(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,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 <route-id>`,describe:`Deletes a private network route from an account.`,builder:ee,handler:async s=>{if(s.dryRun){a({command:`cf network routes cidr delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${s[`route-id`]==null?`<route-id>`:encodeURIComponent(String(s[`route-id`]))}`,pathParams:{"route-id":String(s[`route-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a private network route.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.network.routes.cidr.delete({account_id:l,route_id:s[`route-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Optional remark describing the route.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <route-id>`,describe:`Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf network routes cidr edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${u[`route-id`]==null?`<route-id>`:encodeURIComponent(String(u[`route-id`]))}`,pathParams:{"route-id":String(u[`route-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),network:l(u.network,`network`,`text`),virtual_network_id:l(u[`virtual-network-id`],`virtual-network-id`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.network.routes.cidr.edit({...e,account_id:f,route_id:u[`route-id`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),network:l(u.network,`network`,`text`),virtual_network_id:l(u[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Updating`,async()=>d.network.routes.cidr.edit({...p,account_id:f,route_id:u[`route-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <route-id>`,describe:`Get a private network route in an account.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf network routes cidr get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${s[`route-id`]==null?`<route-id>`:encodeURIComponent(String(s[`route-id`]))}`,pathParams:{"route-id":String(s[`route-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.network.routes.cidr.get({account_id:l,route_id:s[`route-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the route.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included."}).option(`network-subset`,{type:`string`,description:`If set, only list routes that are contained within this IP range.`}).option(`network-superset`,{type:`string`,description:`If set, only list routes that contain this IP range.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).option(`route-id`,{type:`string`,description:`UUID of the route.`}).option(`tun-types`,{type:`string`,description:`The types of tunnels to filter by, separated by commas.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists and filters private network routes in an account.`,builder:f(b),handler:async s=>{let c={comment:s.comment,is_deleted:s[`is-deleted`],network_subset:s[`network-subset`],network_superset:s[`network-superset`],existed_at:s[`existed-at`],tunnel_id:s[`tunnel-id`],route_id:s[`route-id`],tun_types:s[`tun-types`],virtual_network_id:s[`virtual-network-id`],per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf network routes cidr list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.network.routes.cidr.list({account_id:u,...c})),{successLabel:`Loaded`})}},S={command:`cidr`,describe:`Operations for routes.cidr`,builder:e=>e.command(m).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`comment`,{type:`string`,description:`An optional description of the hostname route.`}).option(`hostname`,{type:`string`,description:`The hostname of the route.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create a hostname route.`,builder:C,handler:async u=>{if(u.dryRun){a({command:`cf network routes hostname create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),hostname:l(u.hostname,`hostname`,`text`),tunnel_id:l(u[`tunnel-id`],`tunnel-id`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.network.routes.hostname.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({comment:l(u.comment,`comment`,`text`),hostname:l(u.hostname,`hostname`,`text`),tunnel_id:l(u[`tunnel-id`],`tunnel-id`,`text`)});i(await o(`Creating`,async()=>d.network.routes.hostname.create({...p,account_id:f})),{successLabel:`Created`})}};function T(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route 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 E={command:`delete <hostname-route-id>`,describe:`Delete a hostname route.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf network routes hostname delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${s[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(s[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(s[`hostname-route-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a hostname route.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.network.routes.hostname.delete({account_id:l,hostname_route_id:s[`hostname-route-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route ID.`,demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the hostname route.`}).option(`hostname`,{type:`string`,description:`The hostname of the route.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).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:`edit <hostname-route-id>`,describe:`Updates a hostname route.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf network routes hostname edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${u[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(u[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(u[`hostname-route-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),hostname:l(u.hostname,`hostname`,`text`),tunnel_id:l(u[`tunnel-id`],`tunnel-id`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.network.routes.hostname.edit({...e,account_id:f,hostname_route_id:u[`hostname-route-id`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),hostname:l(u.hostname,`hostname`,`text`),tunnel_id:l(u[`tunnel-id`],`tunnel-id`,`text`)});i(await o(`Updating`,async()=>d.network.routes.hostname.edit({...p,account_id:f,hostname_route_id:u[`hostname-route-id`]})),{successLabel:`Updated`})}};function k(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <hostname-route-id>`,describe:`Get a hostname route.`,builder:k,handler:async s=>{if(s.dryRun){a({command:`cf network routes hostname get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${s[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(s[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(s[`hostname-route-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.network.routes.hostname.get({account_id:l,hostname_route_id:s[`hostname-route-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`id`,{type:`string`,description:`The hostname route ID.`}).option(`hostname`,{type:`string`,description:`If set, only list hostname routes that contain a substring of the given value, the filter is case-insensitive.`}).option(`tunnel-id`,{type:`string`,description:`If set, only list hostname routes that point to a specific tunnel.`}).option(`comment`,{type:`string`,description:`If set, only list hostname routes with the given comment.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only return deleted hostname routes. If `false`, exclude deleted hostname routes."}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Lists and filters hostname routes in an account.`,builder:j,handler:async s=>{let c={id:s.id,hostname:s.hostname,tunnel_id:s[`tunnel-id`],comment:s.comment,existed_at:s[`existed-at`],is_deleted:s[`is-deleted`],per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf network routes hostname list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.network.routes.hostname.list({account_id:u,...c})),{successLabel:`Loaded`})}},N={command:`hostname`,describe:`Operations for routes.hostname`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`ip`,{type:`string`,description:`Ip`,demandOption:!0}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`default-virtual-network-fallback`,{type:`boolean`,description:`When the virtual_network_id parameter is not provided the request filter will default search routes that are in the default virtual network for the account. If this parameter is set to false, the search will include routes that do not have a virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`resolve <ip>`,describe:`Fetches routes that contain the given IP address.`,builder:P,handler:async s=>{let c={virtual_network_id:s[`virtual-network-id`],default_virtual_network_fallback:s[`default-virtual-network-fallback`]};if(s.dryRun){a({command:`cf network routes resolve`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/ip/${s.ip==null?`<ip>`:encodeURIComponent(String(s.ip))}`,pathParams:{ip:String(s.ip??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.network.routes.resolve({account_id:u,ip:s.ip,...c})),{successLabel:`Loaded`})}},I={command:`routes`,describe:`Operations for routes`,builder:e=>e.command(F).command(S).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`edit <address-family>`,describe:`Updates the Cloudflare Source subnet of the given address family`,builder:L,handler:async u=>{if(u.dryRun){a({command:`cf network subnets cloudflare-source edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/cloudflare_source/${u[`address-family`]==null?`<address-family>`:encodeURIComponent(String(u[`address-family`]))}`,pathParams:{"address-family":String(u[`address-family`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.network.subnets.cloudflareSource.edit({...e,account_id:f,address_family:u[`address-family`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)});i(await o(`Updating`,async()=>d.network.subnets.cloudflareSource.edit({...p,account_id:f,address_family:u[`address-family`]})),{successLabel:`Updated`})}},te={command:`cloudflare-source`,describe:`Operations for subnets.cloudflare-source`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).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:`edit <address-family>`,describe:`Updates the CIDR for the account's default Initial Resolved IP Subnet of the given address family. The new CIDR must not conflict with existing private routes in the account.`,builder:z,handler:async u=>{if(u.dryRun){a({command:`cf network subnets initial-resolved-ip edit`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/initial_resolved_ip/${u[`address-family`]==null?`<address-family>`:encodeURIComponent(String(u[`address-family`]))}`,pathParams:{"address-family":String(u[`address-family`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.network.subnets.initialResolvedIp.edit({...e,account_id:f,address_family:u[`address-family`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)});i(await o(`Updating`,async()=>d.network.subnets.initialResolvedIp.edit({...p,account_id:f,address_family:u[`address-family`]})),{successLabel:`Updated`})}};function V(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <address-family>`,describe:`Returns the account's default Initial Resolved IP Subnet for the given address family.`,builder:V,handler:async s=>{if(s.dryRun){a({command:`cf network subnets initial-resolved-ip get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/initial_resolved_ip/${s[`address-family`]==null?`<address-family>`:encodeURIComponent(String(s[`address-family`]))}`,pathParams:{"address-family":String(s[`address-family`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.network.subnets.initialResolvedIp.get({account_id:l,address_family:s[`address-family`]})),{successLabel:`Loaded`})}},U={command:`initial-resolved-ip`,describe:`Operations for subnets.initial-resolved-ip`,builder:e=>e.command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`name`,{type:`string`,description:`If set, only list subnets with the given name`}).option(`comment`,{type:`string`,description:`If set, only list subnets with the given comment.`}).option(`network`,{type:`string`,description:`If set, only list the subnet whose network exactly matches the given CIDR.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`address-family`,{type:`string`,description:"If set, only include subnets in the given address family - `v4` or `v6`",choices:[`v4`,`v6`]}).option(`is-default-network`,{type:`boolean`,description:"If `true`, only include default subnets. If `false`, exclude default subnets subnets. If not set, all subnets will be included."}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted subnets. If `false`, exclude deleted subnets. If not set, all subnets will be included."}).option(`sort-order`,{type:`string`,description:"Sort order of the results. `asc` means oldest to newest, `desc` means newest to oldest. If not set, they will not be in any particular order.",choices:[`asc`,`desc`]}).option(`subnet-types`,{type:`string`,description:`If set, the types of subnets to include, separated by comma.`,choices:[`cloudflare_source`,`initial_resolved_ip`,`warp`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Lists and filters subnets in an account.`,builder:f(W),handler:async s=>{let c={name:s.name,comment:s.comment,network:s.network,existed_at:s[`existed-at`],address_family:s[`address-family`],is_default_network:s[`is-default-network`],is_deleted:s[`is-deleted`],sort_order:s[`sort-order`],subnet_types:s[`subnet-types`],per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf network subnets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.network.subnets.list({account_id:u,...c})),{successLabel:`Loaded`})}};function K(e){return e.option(`comment`,{type:`string`,description:`An optional description of the subnet.`,default:``}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this is the default subnet for the account. There can only be one default subnet per account.",default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:"Create a WARP IP assignment subnet. Currently, only IPv4 subnets can be created. **Network constraints:** - The network must be within one of the following private IP ranges: - `10.0.0.0/8` (RFC 1918) - `172.16.0.0/12` (RFC 1918) - `192.168.0.0/16` (RFC 1918) - `100.64.0.0/10` (RFC 6598 - CGNAT) - The subnet must have a prefix length of `/24` or larger (e.g., `/16`, `/20`, `/24` are valid; `/25`, `/28` are not)",builder:K,handler:async d=>{if(d.dryRun){a({command:`cf network subnets warp create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({comment:l(d.comment,`comment`,`text`),is_default_network:d[`is-default-network`],name:l(d.name,`name`,`text`),network:l(d.network,`network`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.network.subnets.warp.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for the subnet.`)),d.network===void 0&&(d.network=await u(`network`,`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`));let m=c({comment:l(d.comment,`comment`,`text`),is_default_network:d[`is-default-network`],name:l(d.name,`name`,`text`),network:l(d.network,`network`,`text`)});i(await o(`Creating`,async()=>f.network.subnets.warp.create({...m,account_id:p})),{successLabel:`Created`})}};function J(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,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 <subnet-id>`,describe:`Delete a WARP IP assignment subnet. This operation is idempotent - deleting an already-deleted or non-existent subnet will return success with a null result.`,builder:J,handler:async s=>{if(s.dryRun){a({command:`cf network subnets warp delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${s[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(s[`subnet-id`]))}`,pathParams:{"subnet-id":String(s[`subnet-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a WARP IP subnet.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.network.subnets.warp.delete({account_id:l,subnet_id:s[`subnet-id`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this is the default subnet for the account. There can only be one default subnet per account."}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`edit <subnet-id>`,describe:"Updates a WARP IP assignment subnet. **Update constraints:** - The `network` field cannot be modified for WARP subnets. Only `name`, `comment`, and `is_default_network` can be updated. - IPv6 subnets cannot be updated",builder:X,handler:async u=>{if(u.dryRun){a({command:`cf network subnets warp edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${u[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(u[`subnet-id`]))}`,pathParams:{"subnet-id":String(u[`subnet-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({comment:l(u.comment,`comment`,`text`),is_default_network:u[`is-default-network`],name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.network.subnets.warp.edit({...e,account_id:f,subnet_id:u[`subnet-id`]})),{successLabel:`Updated`});return}let p=c({comment:l(u.comment,`comment`,`text`),is_default_network:u[`is-default-network`],name:l(u.name,`name`,`text`),network:l(u.network,`network`,`text`)});i(await o(`Updating`,async()=>d.network.subnets.warp.edit({...p,account_id:f,subnet_id:u[`subnet-id`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <subnet-id>`,describe:`Get a WARP IP assignment subnet.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf network subnets warp get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${s[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(s[`subnet-id`]))}`,pathParams:{"subnet-id":String(s[`subnet-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.network.subnets.warp.get({account_id:l,subnet_id:s[`subnet-id`]})),{successLabel:`Loaded`})}},re={command:`warp`,describe:`Operations for subnets.warp`,builder:e=>e.command(q).command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`subnets`,describe:`Operations for subnets`,builder:e=>e.command(G).command(te).command(U).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the virtual network.`,default:``}).option(`is-default`,{type:`boolean`,description:"If `true`, this virtual network is the default for the account."}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this virtual network is the default for the account.",default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for the virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`create`,describe:`Adds a new virtual network to an account.`,builder:ae,handler:async d=>{if(d.dryRun){a({command:`cf network virtual-networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/virtual_networks`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({comment:l(d.comment,`comment`,`text`),is_default:d[`is-default`],is_default_network:d[`is-default-network`],name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.network.virtualNetworks.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for the virtual network.`));let m=c({comment:l(d.comment,`comment`,`text`),is_default:d[`is-default`],is_default_network:d[`is-default-network`],name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.network.virtualNetworks.create({...m,account_id:p})),{successLabel:`Created`})}};function $(e){return e.positional(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`,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 se={command:`delete <virtual-network-id>`,describe:`Deletes an existing virtual network.`,builder:$,handler:async s=>{if(s.dryRun){a({command:`cf network virtual-networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/virtual_networks/${s[`virtual-network-id`]==null?`<virtual-network-id>`:encodeURIComponent(String(s[`virtual-network-id`]))}`,pathParams:{"virtual-network-id":String(s[`virtual-network-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a virtual network.`})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";function f(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
3
3
|
|
|
4
4
|
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
5
5
|
key is not treated as a secret value. This is *only* supported for preventing
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./chunk-vbHwaUoU.mjs";import{a as t,i as n,t as r}from"./session-
|
|
2
|
+
import{n as e}from"./chunk-vbHwaUoU.mjs";import{a as t,i as n,t as r}from"./session-D6KHthHf.mjs";import{t as i}from"./resolve-CeBbH6Pq.mjs";import{f as a,n as o,u as s,v as c}from"./interactive-DtsCYfrK.mjs";import{a as l,n as u,t as d}from"./cf-C7DU4819.mjs";import{statSync as f}from"node:fs";import{dirname as p,join as m,resolve as h}from"node:path";const g=`cloudflare.config.ts`;let _;function v(e=process.cwd()){let t=h(e);for(;;){let e=m(t,g);try{if(f(e).isFile())return e}catch{}let n=p(t);if(n===t)return null;t=n}}async function y(e=process.cwd()){let t=h(e);_=void 0;let n=v(t);if(!n)return _={startDir:t,result:null},null;let{loadAndValidateConfig:r}=await import(`./dist-CgrMkXFx.mjs`).then(e=>e.a),i=await r(n,{mode:void 0},{include:[`settings`]});if(!i.result.success){let e=i.result.error.issues.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
|
|
3
3
|
`);throw Error(`Invalid ${g}:\n${e}`)}let a=i.result.data.settings,o={path:n,settings:a?.type===`settings`?a:void 0};return _={startDir:t,result:o},o}function b(e=process.cwd()){let t=h(e);return _?.startDir===t?_.result:void 0}function x(e,t){if(t)return{value:t,source:`flag`};let n=process.env[e];if(n)return{value:n,source:`env`}}async function S(){let e=process.env.CLOUDFLARE_ACCOUNT_ID;if(e)return{value:e,source:`env`};let t=b(),n=t===void 0?await y():t;if(n?.settings?.accountId)return{value:n.settings.accountId,source:`settings`,path:n.path}}async function C(){let e=await S();if(e)return e.value;let{getActiveAccountId:t}=await Promise.resolve().then(()=>F);try{return t()}catch{return}}async function w(){let e=await S();e&&T(e.value,P(e,`accountId`));let{getOrSelectAccountId:t}=await Promise.resolve().then(()=>F);return t(e?.value)}function T(e,t){if(!process.env.DEBUG)return;let n=e.length>12?e.slice(0,12)+`…`:e;process.stderr.write(`Using account: ${n} (${t})\n`)}async function E(e,t,n){if(e?.zoneId)return D(e.zoneId,t);let r=x(`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=P(r);console.error(`Using zone: ${r.value} (from ${e})`)}return D(r.value,t)}throw Error(`No zone specified.
|
|
4
4
|
|
|
5
5
|
Please provide one of the following:
|
|
6
6
|
1. Zone as a positional argument: cf dns records list <zone>
|
|
7
7
|
2. --zone flag (or -z): cf dns records list --zone example.com
|
|
8
|
-
3. CLOUDFLARE_ZONE_ID environment variable`)}async function D(e,t){if(i(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-
|
|
8
|
+
3. CLOUDFLARE_ZONE_ID environment variable`)}async function D(e,t){if(i(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-CeBbH6Pq.mjs`).then(e=>e.n);return n(t,await w(),e)}function O(e){if(e?.scriptName)return e.scriptName;throw Error("Required Worker name missing. Please specify the Worker name with `--worker <name>`.")}const k=[`public`,`fedramp_high`];let A=!1;async function j(){let e=b(),t=(e===void 0?await y():e)?.settings?.complianceRegion,n=N(t,`cloudflare.config.ts`),r=process.env.CLOUDFLARE_COMPLIANCE_REGION,i=N(r,`CLOUDFLARE_COMPLIANCE_REGION`);return i?(n&&n!==i&&!A&&(A=!0,console.warn(`The compliance region was resolved to "${r}" from the \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable, which takes precedence over the configured value "${t}" in \`cloudflare.config.ts\`.`)),i):n}async function M(){return await j()??`public`}function N(e,t){switch(e){case`fedramp-high`:return`fedramp_high`;case`fedramp_high`:case`public`:case void 0:return e;default:throw Error(`Invalid compliance region "${e}" from ${t}. Valid values are: ${k.join(`, `)}`)}}function P(e,t=`zone`){switch(e.source){case`flag`:return t===`zone`?`--zone flag`:`(flag)`;case`env`:return{accountId:`CLOUDFLARE_ACCOUNT_ID`,zone:`CLOUDFLARE_ZONE_ID`,complianceRegion:`CLOUDFLARE_COMPLIANCE_REGION`}[t];case`settings`:return`cloudflare.config.ts`}}var F=e({fetchAuthorizedAccounts:()=>U,getActiveAccountId:()=>H,getActiveProfile:()=>q,getConfigPath:()=>$,getOrSelectAccountId:()=>V,getProfileStore:()=>J,getValidToken:()=>X,isOAuthLoggedIn:()=>Z,login:()=>W,logout:()=>G,readAuthCredentials:()=>Q,resolveProfile:()=>Y,setProfile:()=>K});const I={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var L=class extends Error{};async function R(e){if(o())throw new L;r(t);let n=await a({message:e});return(c(n)||typeof n!=`string`)&&process.exit(130),n}async function z(e,n){if(o())throw new L;r(t);let i=await s({message:e,options:n.choices.map(({title:e,value:t})=>({label:e,value:t}))});return(c(i)||typeof i!=`string`)&&process.exit(130),I.log(`To have cf automatically use this account for future commands in this project, you can update your \`cloudflare.config.ts\`:
|
|
9
9
|
|
|
10
10
|
import { defineSettings } from "cf/config";
|
|
11
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d,n as f}from"./prompt-DdegNPpg.mjs";function p(e){return e.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 m={command:`create`,describe:`Create a new OAuth client for an account.`,builder:p,handler:async f=>{if(f.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:f.body===void 0?c({allowed_cors_origins:f[`allowed-cors-origins`],client_name:l(f[`client-name`],`client-name`,`text`),client_uri:l(f[`client-uri`],`client-uri`,`text`),grant_types:f[`grant-types`],logo_uri:l(f[`logo-uri`],`logo-uri`,`text`),optional_scopes:f[`optional-scopes`],policy_uri:l(f[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:f[`post-logout-redirect-uris`],redirect_uris:f[`redirect-uris`],response_types:f[`response-types`],scopes:f.scopes,token_endpoint_auth_method:l(f[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:l(f[`tos-uri`],`tos-uri`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.oauthClients.create({...e,account_id:m})),{successLabel:`Created`});return}if(f[`client-name`]===void 0&&(f[`client-name`]=await u(`client-name`,`Human-readable name of the OAuth client.`)),f[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(f[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(f[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(f.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);f[`token-endpoint-auth-method`]===void 0&&(f[`token-endpoint-auth-method`]=await d(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let h=c({allowed_cors_origins:f[`allowed-cors-origins`],client_name:l(f[`client-name`],`client-name`,`text`),client_uri:l(f[`client-uri`],`client-uri`,`text`),grant_types:f[`grant-types`],logo_uri:l(f[`logo-uri`],`logo-uri`,`text`),optional_scopes:f[`optional-scopes`],policy_uri:l(f[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:f[`post-logout-redirect-uris`],redirect_uris:f[`redirect-uris`],response_types:f[`response-types`],scopes:f.scopes,token_endpoint_auth_method:l(f[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:l(f[`tos-uri`],`tos-uri`,`text`)});i(await o(`Creating`,async()=>p.oauthClients.create({...h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.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 g={command:`delete-rotated-secret <oauth-client-id>`,describe:"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.",builder:h,handler:async s=>{if(s.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/${s[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(s[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(s[`oauth-client-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.oauthClients.deleteRotatedSecret({account_id:l,oauth_client_id:s[`oauth-client-id`]})),{successLabel:`Deleted`})}};function _(e){return e.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 v={command:`delete <oauth-client-id>`,describe:`Delete an OAuth client.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf oauth-clients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${s[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(s[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(s[`oauth-client-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.oauthClients.delete({account_id:l,oauth_client_id:s[`oauth-client-id`]})),{successLabel:`Deleted`})}};function y(e){return e.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 b={command:`get <oauth-client-id>`,describe:`Get details of a specific OAuth client.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf oauth-clients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${s[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(s[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(s[`oauth-client-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.oauthClients.get({account_id:l,oauth_client_id:s[`oauth-client-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List all OAuth clients for an account.`,builder:x,handler:async s=>{if(s.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 c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.oauthClients.list({account_id:l})),{successLabel:`Loaded`})}};function C(e){return e.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 w={command:`rotate-secret <oauth-client-id>`,describe:"Creates 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`.",builder:C,handler:async s=>{if(s.dryRun){a({command:`cf oauth-clients rotate-secret`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${s[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(s[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(s[`oauth-client-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.oauthClients.rotateSecret({account_id:l,oauth_client_id:s[`oauth-client-id`]})),{successLabel:`Created`})}};function T(e){return e.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 E={command:`update <oauth-client-id>`,describe:`Update an existing OAuth client. Only include fields you want to update.`,builder:T,handler:async u=>{if(u.dryRun){a({command:`cf oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${u[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(u[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(u[`oauth-client-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({allowed_cors_origins:u[`allowed-cors-origins`],client_name:l(u[`client-name`],`client-name`,`text`),client_uri:l(u[`client-uri`],`client-uri`,`text`),grant_types:u[`grant-types`],logo_uri:l(u[`logo-uri`],`logo-uri`,`text`),optional_scopes:u[`optional-scopes`],policy_uri:l(u[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:u[`post-logout-redirect-uris`],redirect_uris:u[`redirect-uris`],response_types:u[`response-types`],scopes:u.scopes,token_endpoint_auth_method:l(u[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:l(u[`tos-uri`],`tos-uri`,`text`),visibility:l(u.visibility,`visibility`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.oauthClients.update({...e,account_id:f,oauth_client_id:u[`oauth-client-id`]})),{successLabel:`Updated`});return}let p=c({allowed_cors_origins:u[`allowed-cors-origins`],client_name:l(u[`client-name`],`client-name`,`text`),client_uri:l(u[`client-uri`],`client-uri`,`text`),grant_types:u[`grant-types`],logo_uri:l(u[`logo-uri`],`logo-uri`,`text`),optional_scopes:u[`optional-scopes`],policy_uri:l(u[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:u[`post-logout-redirect-uris`],redirect_uris:u[`redirect-uris`],response_types:u[`response-types`],scopes:u.scopes,token_endpoint_auth_method:l(u[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:l(u[`tos-uri`],`tos-uri`,`text`),visibility:l(u.visibility,`visibility`,`text`)});i(await o(`Updating`,async()=>d.oauthClients.update({...p,account_id:f,oauth_client_id:u[`oauth-client-id`]})),{successLabel:`Updated`})}},D={command:`oauth-clients`,describe:`oauth-clients`,builder:e=>e.command(m).command(v).command(g).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-MQEamPN9.mjs";import{t}from"./output-DrpYYfnB.mjs";import{n,t as r}from"./progress-CsHIt3Tp.mjs";function i(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`,builder:i,handler:async i=>{if(i.dryRun){n({command:`cf oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.oauthScopes.list()),{successLabel:`Loaded`})}},o={command:`oauth-scopes`,describe:`oauth-scopes`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d}from"./input-validation-Bav2M9F-.mjs";import{a as f,i as p,n as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";function g(e){return e.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 _={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]}):l(r.body)});return}let i=await a(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`configuration-type`]===void 0&&(r[`configuration-type`]=await p(`configuration-type`,`The configuration.type field`,[`logpush`])),r[`configuration-url`]===void 0&&(r[`configuration-url`]=await f(`configuration-url`,`The configuration.url field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await f(`name`,`The name field`));let h=u({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]});o(await c(`Creating`,async()=>i.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function v(e){return e.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 y={command:`delete <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations/${r.slug==null?`<slug>`:encodeURIComponent(String(r.slug))}`,pathParams:{slug:String(r.slug??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force,message:`This operation deletes the destination.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.observability.destinations.delete({account_id:l,slug:r.slug})),{successLabel:`Deleted`})}};function b(e){return e.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 x={command:`list`,describe:`List your Workers Observability Telemetry Destinations.`,builder:h(b),handler:async r=>{let i={page:r.page,perPage:r[`per-page`],order:r.order,orderBy:r[`order-by`]};if(r.dryRun){s({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.observability.destinations.list({account_id:u,...i})),{successLabel:`Loaded`})}};function S(e){return e.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 C={command:`update <slug>`,describe:`Update an existing Workers Observability Telemetry Destination.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations/${r.slug==null?`<slug>`:encodeURIComponent(String(r.slug))}`,pathParams:{slug:String(r.slug??``)},bodyKind:`json`,body:r.body===void 0?u({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled}):l(r.body)});return}let i=await a(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.observability.destinations.update({...e,account_id:m,slug:r.slug})),{successLabel:`Updated`});return}if(r[`configuration-type`]===void 0&&(r[`configuration-type`]=await p(`configuration-type`,`The configuration.type field`,[`logpush`])),r[`configuration-url`]===void 0&&(r[`configuration-url`]=await f(`configuration-url`,`The configuration.url field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=u({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled});o(await c(`Updating`,async()=>i.observability.destinations.update({...h,account_id:m,slug:r.slug})),{successLabel:`Updated`})}},w={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.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 E={command:`create`,describe:`Persist query for later use.`,builder:T,handler:async r=>{if(r.dryRun){s({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await f(`description`,`The description field`)),r.name===void 0&&(r.name=await f(`name`,`Query name`)),r[`parameters-order-by-value`]===void 0&&(r[`parameters-order-by-value`]=await f(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});o(await c(`Creating`,async()=>i.observability.queries.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.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 O={command:`delete <queryId>`,describe:`Delete a saved query.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${r[`query-id`]==null?`<query-id>`:encodeURIComponent(String(r[`query-id`]))}`,pathParams:{"query-id":String(r[`query-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force,message:`This operation deletes the saved query.`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}o(await c(`Deleting`,async()=>i.observability.queries.delete({account_id:l,queryId:r[`query-id`]})),{successLabel:`Deleted`})}};function k(e){return e.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 A={command:`edit <queryId>`,describe:`Update saved query.`,builder:k,handler:async r=>{if(r.dryRun){s({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${r[`query-id`]==null?`<query-id>`:encodeURIComponent(String(r[`query-id`]))}`,pathParams:{"query-id":String(r[`query-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.observability.queries.edit({...e,account_id:p,queryId:r[`query-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await f(`description`,`The description field`)),r.name===void 0&&(r.name=await f(`name`,`Query name`)),r[`parameters-order-by-value`]===void 0&&(r[`parameters-order-by-value`]=await f(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});o(await c(`Updating`,async()=>i.observability.queries.edit({...m,account_id:p,queryId:r[`query-id`]})),{successLabel:`Updated`})}};function j(e){return e.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 M={command:`get <queryId>`,describe:`Retrieve a saved query.`,builder:j,handler:async r=>{if(r.dryRun){s({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${r[`query-id`]==null?`<query-id>`:encodeURIComponent(String(r[`query-id`]))}`,pathParams:{"query-id":String(r[`query-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.observability.queries.get({account_id:l,queryId:r[`query-id`]})),{successLabel:`Loaded`})}};function N(e){return e.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 P={command:`list`,describe:`List saved queries.`,builder:h(N),handler:async r=>{let i={page:r.page,perPage:r[`per-page`],order:r.order,orderBy:r[`order-by`]};if(r.dryRun){s({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.observability.queries.list({account_id:u,...i})),{successLabel:`Loaded`})}},F={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.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 ee={command:`create`,describe:`Shared queries store the results of a previously run query, allowing you to share the results with others.`,builder:I,handler:async r=>{if(r.dryRun){s({command:`cf observability shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({chart:r.chart,chartType:d(r[`chart-type`],`chart-type`,`text`),compare:r.compare,distributionScale:d(r[`distribution-scale`],`distribution-scale`,`text`),dry:r.dry,granularity:r.granularity,ignoreSeries:r[`ignore-series`],limit:r.limit,offset:d(r.offset,`offset`,`text`),offsetBy:r[`offset-by`],offsetDirection:d(r[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(r[`query-id`],`query-id`,`text`),timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},view:d(r.view,`view`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.observability.sharedQueries.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`query-id`]===void 0&&(r[`query-id`]=await f(`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).`)),r[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(r[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=u({chart:r.chart,chartType:d(r[`chart-type`],`chart-type`,`text`),compare:r.compare,distributionScale:d(r[`distribution-scale`],`distribution-scale`,`text`),dry:r.dry,granularity:r.granularity,ignoreSeries:r[`ignore-series`],limit:r.limit,offset:d(r.offset,`offset`,`text`),offsetBy:r[`offset-by`],offsetDirection:d(r[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(r[`query-id`],`query-id`,`text`),timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},view:d(r.view,`view`,`text`)});o(await c(`Creating`,async()=>i.observability.sharedQueries.create({...m,account_id:p})),{successLabel:`Created`})}};function L(e){return e.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 R={command:`get <id>`,describe:`Shared queries store the results of a previously run query, allowing you to share the results with others.`,builder:h(L),handler:async r=>{let i={view:r.view};if(r.dryRun){s({command:`cf observability shared-queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/shared/query/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.observability.sharedQueries.get({account_id:u,id:r.id,...i})),{successLabel:`Loaded`})}},z={command:`shared-queries`,describe:`Operations for shared-queries`,builder:e=>e.command(ee).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).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 V={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:B,handler:async r=>{if(r.dryRun){s({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({datasets:r.datasets,from:r.from,keyNeedle:{isRegex:r[`key-needle-is-regex`],matchCase:r[`key-needle-match-case`]},limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},to:r.to}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.observability.telemetry.keys({...e,account_id:d})),{successLabel:`Created`});return}let f=u({datasets:r.datasets,from:r.from,keyNeedle:{isRegex:r[`key-needle-is-regex`],matchCase:r[`key-needle-match-case`]},limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},to:r.to});o(await c(`Creating`,async()=>i.observability.telemetry.keys({...f,account_id:d})),{successLabel:`Created`})}};function H(e){return e.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 U={command:`query`,describe:`Run a temporary or saved query.`,builder:H,handler:async r=>{if(r.dryRun){s({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({chart:r.chart,chartType:d(r[`chart-type`],`chart-type`,`text`),compare:r.compare,distributionScale:d(r[`distribution-scale`],`distribution-scale`,`text`),dry:r.dry,granularity:r.granularity,ignoreSeries:r[`ignore-series`],limit:r.limit,offset:d(r.offset,`offset`,`text`),offsetBy:r[`offset-by`],offsetDirection:d(r[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(r[`query-id`],`query-id`,`text`),timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},view:d(r.view,`view`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Loading`,async()=>i.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(r[`query-id`]===void 0&&(r[`query-id`]=await f(`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).`)),r[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(r[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=u({chart:r.chart,chartType:d(r[`chart-type`],`chart-type`,`text`),compare:r.compare,distributionScale:d(r[`distribution-scale`],`distribution-scale`,`text`),dry:r.dry,granularity:r.granularity,ignoreSeries:r[`ignore-series`],limit:r.limit,offset:d(r.offset,`offset`,`text`),offsetBy:r[`offset-by`],offsetDirection:d(r[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:r[`parameters-datasets`],filterCombination:d(r[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:r[`parameters-limit`],needle:{isRegex:r[`parameters-needle-is-regex`],matchCase:r[`parameters-needle-match-case`]},orderBy:{order:d(r[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(r[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(r[`query-id`],`query-id`,`text`),timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},view:d(r.view,`view`,`text`)});o(await c(`Loading`,async()=>i.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function W(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).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 G={command:`values`,describe:`List unique values found in your events.`,builder:W,handler:async r=>{if(r.dryRun){s({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({datasets:r.datasets,key:d(r.key,`key`,`text`),limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},type:d(r.type,`type`,`text`)}):l(r.body)});return}let i=await a(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(r.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await f(`key`,`The key field`)),r[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(r[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await p(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=u({datasets:r.datasets,key:d(r.key,`key`,`text`),limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},type:d(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},K={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get`,describe:`Retrieve the ordered sampling overrides for a zone's managed Cloudflare Traces ruleset.`,builder:q,handler:async i=>{if(i.dryRun){s({command:`cf observability tracing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/zones/${i.zone??i.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Loading`,async()=>l.observability.tracing.rules.get({account_id:u,zone_id:d})),{successLabel:`Loaded`})}};function Y(e){return e.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 X={command:`update`,describe:`Replace all sampling overrides in a zone's managed Cloudflare Traces ruleset. Rules are evaluated in the supplied order.`,builder:Y,handler:async u=>{if(u.dryRun){s({command:`cf observability tracing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/zones/${u.zone??u.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?void 0:l(u.body)});return}let d=await a(u),f=u.local?e:await t();u.accountId=f;let p=await r({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=p,u.body){let e=l(u.body);o(await c(`Updating`,async()=>d.observability.tracing.rules.update({...e,account_id:f,zone_id:p})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i(d,`PUT`,`/accounts/${f}/workers/observability/zones/${u.zoneId}/observability/tracing/rules`)),{successLabel:`Updated`})}},Z={command:`rules`,describe:`Operations for tracing.rules`,builder:e=>e.command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Retrieve the zone-level Cloudflare Traces settings.`,builder:Q,handler:async i=>{if(i.dryRun){s({command:`cf observability tracing settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/zones/${i.zone??i.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Loading`,async()=>l.observability.tracing.settings.get({account_id:u,zone_id:d})),{successLabel:`Loaded`})}};function te(e){return e.option(`destinations`,{type:`string`,array:!0,description:`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.`,choices:[`authenticated`,`unauthenticated`]}).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 ne={command:`update`,describe:`Update the zone-level Cloudflare Traces settings.`,builder:te,handler:async i=>{if(i.dryRun){s({command:`cf observability tracing settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/zones/${i.zone??i.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`json`,body:i.body===void 0?u({destinations:i.destinations,enabled:i.enabled,forward_context:i[`forward-context`],persist:i.persist,propagation_policy:d(i[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:i[`sampling-ratio`]}):l(i.body)});return}let f=await a(i),p=i.local?e:await t();i.accountId=p;let m=await r({zone:i.zone},f,{quiet:i.quiet});if(i.zoneId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>f.observability.tracing.settings.update({...e,account_id:p,zone_id:m})),{successLabel:`Updated`});return}let h=u({destinations:i.destinations,enabled:i.enabled,forward_context:i[`forward-context`],persist:i.persist,propagation_policy:d(i[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:i[`sampling-ratio`]});o(await c(`Updating`,async()=>f.observability.tracing.settings.update({...h,account_id:p,zone_id:m})),{successLabel:`Updated`})}},re={command:`settings`,describe:`Operations for tracing.settings`,builder:e=>e.command($).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`tracing`,describe:`Operations for tracing`,builder:e=>e.command(Z).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ae={command:`observability`,describe:`observability`,builder:e=>e.command(w).command(F).command(z).command(K).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ae 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-DVMMVVEs.mjs";import t from"node:fs";import{promisify as n}from"node:util";import r from"node:path";import i from"node:os";import a from"node:process";import o,{execFile as s}from"node:child_process";import{Buffer as c}from"node:buffer";import{fileURLToPath as l}from"node:url";import u,{constants as d}from"node:fs/promises";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(i.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=n(o.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=>c.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=n(o.execFile),ne=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await u.access(n,d.F_OK),r=!0}catch{}if(!r)return e;let i=C(await u.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 u.access(e,d.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=n(s);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=n(s);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=n(s),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=n(s),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?r.dirname(l(import.meta.url)):``,K=r.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,s=[],c={},l=!1;if(b&&!v()&&!U&&!n&&(l=await E()),q===`darwin`)i=`open`,e.wait&&s.push(`--wait-apps`),e.background&&s.push(`--background`),e.newInstance&&s.push(`--new`),n&&s.push(`-a`,n);else if(q===`win32`||l){i=await w(),s.push(...S.argumentsPrefix),b||(c.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||(c.stdio=`ignore`)}else{if(n)i=n;else{let e=!G||G===`/`,t=!1;try{await u.access(K,d.X_OK),t=!0}catch{}i=a.versions.electron??(q===`android`||e||!t)?`xdg-open`:K}r.length>0&&s.push(...r),e.wait||(c.stdio=`ignore`,c.detached=!0)}q===`darwin`&&r.length>0&&s.push(`--args`,...r),e.target&&s.push(e.target);let f=o.spawn(i,s,c);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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-MQEamPN9.mjs";import{t}from"./output-DrpYYfnB.mjs";import{n,t as r}from"./progress-CsHIt3Tp.mjs";import{n as i,t as a}from"./body-parser-C-c9gfH1.mjs";import{n as o}from"./input-validation-Bav2M9F-.mjs";import{a as s,n as c}from"./prompt-DdegNPpg.mjs";import{t as l}from"./cli-types-BsTty22w.mjs";function u(e){return e.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
|
|
3
3
|
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
|
|
4
4
|
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
|
|
5
5
|
a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-C6MhC9EZ.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-C-oFUtvC.mjs";import{t as i}from"./cli-types-BWdZbsFE.mjs";function a(e){return e.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 o={command:`get <organization-id>`,describe:"Returns 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.",builder:a,handler:async i=>{let a={from:i.from,to:i.to};if(i.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},s={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},c={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function l(e){return e.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 u={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:i(l),handler:async i=>{let a={action_result:i[`action-result`],action_type:i[`action-type`],actor_context:i[`actor-context`],actor_email:i[`actor-email`],actor_id:i[`actor-id`],actor_ip_address:i[`actor-ip-address`],actor_token_id:i[`actor-token-id`],actor_token_name:i[`actor-token-name`],actor_type:i[`actor-type`],id:i.id,raw_cf_ray_id:i[`raw-cf-ray-id`],raw_method:i[`raw-method`],raw_status_code:i[`raw-status-code`],raw_uri:i[`raw-uri`],resource_id:i[`resource-id`],resource_product:i[`resource-product`],resource_type:i[`resource-type`],resource_scope:i[`resource-scope`],"action_result.not":i[`action-result-not`],"action_type.not":i[`action-type-not`],"actor_context.not":i[`actor-context-not`],"actor_email.not":i[`actor-email-not`],"actor_id.not":i[`actor-id-not`],"actor_ip_address.not":i[`actor-ip-address-not`],"actor_token_id.not":i[`actor-token-id-not`],"actor_token_name.not":i[`actor-token-name-not`],"actor_type.not":i[`actor-type-not`],"id.not":i[`id-not`],"raw_cf_ray_id.not":i[`raw-cf-ray-id-not`],"raw_method.not":i[`raw-method-not`],"raw_status_code.not":i[`raw-status-code-not`],"raw_uri.not":i[`raw-uri-not`],"resource_id.not":i[`resource-id-not`],"resource_product.not":i[`resource-product-not`],"resource_type.not":i[`resource-type-not`],"resource_scope.not":i[`resource-scope-not`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}};function d(e){return e.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 f={command:`history <id>`,describe:"Returns 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.",builder:i(d),handler:async i=>{let a={action_time:i[`action-time`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}/history`,pathParams:{"organization-id":String(i[`organization-id`]??``),id:String(i.id??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.history({organization_id:i[`organization-id`],id:i.id,...a})),{successLabel:`Loaded`})}},p={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
2
|
+
import{r as e}from"./auth-MQEamPN9.mjs";import{t}from"./output-DrpYYfnB.mjs";import{n,t as r}from"./progress-CsHIt3Tp.mjs";import{t as i}from"./cli-types-BsTty22w.mjs";function a(e){return e.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 o={command:`get <organization-id>`,describe:"Returns 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.",builder:a,handler:async i=>{let a={from:i.from,to:i.to};if(i.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},s={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},c={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function l(e){return e.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 u={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:i(l),handler:async i=>{let a={action_result:i[`action-result`],action_type:i[`action-type`],actor_context:i[`actor-context`],actor_email:i[`actor-email`],actor_id:i[`actor-id`],actor_ip_address:i[`actor-ip-address`],actor_token_id:i[`actor-token-id`],actor_token_name:i[`actor-token-name`],actor_type:i[`actor-type`],id:i.id,raw_cf_ray_id:i[`raw-cf-ray-id`],raw_method:i[`raw-method`],raw_status_code:i[`raw-status-code`],raw_uri:i[`raw-uri`],resource_id:i[`resource-id`],resource_product:i[`resource-product`],resource_type:i[`resource-type`],resource_scope:i[`resource-scope`],"action_result.not":i[`action-result-not`],"action_type.not":i[`action-type-not`],"actor_context.not":i[`actor-context-not`],"actor_email.not":i[`actor-email-not`],"actor_id.not":i[`actor-id-not`],"actor_ip_address.not":i[`actor-ip-address-not`],"actor_token_id.not":i[`actor-token-id-not`],"actor_token_name.not":i[`actor-token-name-not`],"actor_type.not":i[`actor-type-not`],"id.not":i[`id-not`],"raw_cf_ray_id.not":i[`raw-cf-ray-id-not`],"raw_method.not":i[`raw-method-not`],"raw_status_code.not":i[`raw-status-code-not`],"raw_uri.not":i[`raw-uri-not`],"resource_id.not":i[`resource-id-not`],"resource_product.not":i[`resource-product-not`],"resource_type.not":i[`resource-type-not`],"resource_scope.not":i[`resource-scope-not`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}};function d(e){return e.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 f={command:`history <id>`,describe:"Returns 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.",builder:i(d),handler:async i=>{let a={action_time:i[`action-time`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}/history`,pathParams:{"organization-id":String(i[`organization-id`]??``),id:String(i.id??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.history({organization_id:i[`organization-id`],id:i.id,...a})),{successLabel:`Loaded`})}},p={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-MQEamPN9.mjs";import{t}from"./output-DrpYYfnB.mjs";import{n,t as r}from"./progress-CsHIt3Tp.mjs";import{n as i,t as a}from"./body-parser-C-c9gfH1.mjs";import{n as o}from"./input-validation-Bav2M9F-.mjs";import{a as s,i as c,n as l}from"./prompt-DdegNPpg.mjs";import{t as u}from"./cli-types-BsTty22w.mjs";function d(e){return e.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 f={command:`create`,describe:`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)).`,builder:d,handler:async l=>{if(l.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):i(l.body)});return}let u=await e(l);if(l.body){let e=i(l.body);t(await r(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await s(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await c(`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=a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});t(await r(`Creating`,async()=>u.originCaCertificates.create({...d})),{successLabel:`Created`})}};function p(e){return e.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 m={command:`delete <certificate-id>`,describe:`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)).`,builder:p,handler:async i=>{if(i.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}t(await r(`Deleting`,async()=>a.originCaCertificates.delete({certificate_id:i[`certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.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 g={command:`get <certificate-id>`,describe:`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)).`,builder:h,handler:async i=>{if(i.dryRun){n({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.originCaCertificates.get({certificate_id:i[`certificate-id`]})),{successLabel:`Loaded`})}};function _(e){return e.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 v={command:`list`,describe:`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)).`,builder:u(_),handler:async i=>{let a={zone_id:i[`zone-id`],page:i.page,per_page:i[`per-page`],limit:i.limit,offset:i.offset};if(i.dryRun){n({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.originCaCertificates.list(a)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`origin-ca-certificates`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|