cf 1.0.0-beta.27 → 1.0.0-beta.29
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 +10 -3
- package/dist/_meta/commands.json +7966 -5034
- package/dist/_meta/hand-written-commands.json +40 -10
- package/dist/_meta/schemas.json +3153 -3736
- package/dist/{abuse-reports-RxXqfDEW.mjs → abuse-reports-DqXYX_6F.mjs} +10 -10
- package/dist/{access-BxEprr2f.mjs → access-Cte4yyIz.mjs} +1 -1
- package/dist/{accounts-DU2ZNYqP.mjs → accounts-G-x-_cEx.mjs} +58 -57
- package/dist/{acm-CBCIKBJ4.mjs → acm-Bg3HqMGG.mjs} +7 -7
- package/dist/{addressing-BKxiLRHk.mjs → addressing-BwEofGEm.mjs} +46 -46
- package/dist/{agent-memory-DkBpQYUL.mjs → agent-memory-DhwZ2KRw.mjs} +15 -15
- package/dist/ai-DWWRIQIt.mjs +30 -0
- package/dist/ai-audit-CMEBz6ZP.mjs +6 -0
- package/dist/ai-gateway-D2s0isU-.mjs +76 -0
- package/dist/ai-search-a0uqr9yJ.mjs +74 -0
- package/dist/{ai-security-CvZfP2JC.mjs → ai-security-H_RqjRoL.mjs} +4 -4
- package/dist/alerting-Bgp9rE4I.mjs +52 -0
- package/dist/analytics-CFYM82FD.mjs +17 -0
- package/dist/analytics-engine-BLiEaLxb.mjs +4 -0
- package/dist/api-Dnt6lRJG.mjs +3 -0
- package/dist/{api-security-BbcvDtff.mjs → api-security-B0YtHglt.mjs} +63 -63
- package/dist/argo-BPwbzHY7.mjs +14 -0
- package/dist/{artifacts-2R2sxIKO.mjs → artifacts-B6UwC2PH.mjs} +20 -20
- package/dist/{audit-logs-LoBB1OO_.mjs → audit-logs-kG97iEnI.mjs} +2 -2
- package/dist/auth-Czr8ChBB.mjs +2 -0
- package/dist/auth-DA1PHaHi.mjs +2 -0
- package/dist/auth-Dwfa4S3h.mjs +7 -0
- package/dist/{auth-token-BwpERbnG.mjs → auth-token-CE3Wa5-b.mjs} +1 -1
- package/dist/{autoconfig-B2w-woU0.mjs → autoconfig-B4tFR6ua.mjs} +118 -114
- package/dist/{basin-catalog-AgOHGiPI.mjs → basin-catalog-DzVEPupy.mjs} +17 -17
- package/dist/billing-TERxOuLR.mjs +22 -0
- package/dist/{blocks-C8vyXIAT.mjs → blocks-C3Im7AT0.mjs} +1 -1
- package/dist/body-parser-HN91kAf0.mjs +2 -0
- package/dist/{body-unions-CjpNjwSW.mjs → body-unions-D9OSaf4M.mjs} +1 -1
- package/dist/{bot-management-fwxKIbaB.mjs → bot-management-SZw9jTOC.mjs} +4 -4
- package/dist/{botnet-feed-DCYB5kYZ.mjs → botnet-feed-DjdAeUtb.mjs} +5 -5
- package/dist/brand-protection-BpA7Gmf1.mjs +18 -0
- package/dist/browser-run-BvjfMK3f.mjs +40 -0
- package/dist/build-CCwo_ydV.mjs +2 -0
- package/dist/build-yQOzZg6Z.mjs +2 -0
- package/dist/builds-tMa3sbQU.mjs +62 -0
- package/dist/cache-b_EPh6Is.mjs +36 -0
- package/dist/cf-DmvZ2L51.mjs +18 -0
- package/dist/{chunk-DSGVRFIS-DQwKND2c.mjs → chunk-DSGVRFIS-Cj7pO-YQ.mjs} +1 -1
- package/dist/chunk-Q5KVZMHK-WOCEMyET.mjs +363 -0
- package/dist/cli-Cc7ujzAy.mjs +4 -0
- package/dist/{client-side-security-VmZzMy-m.mjs → client-side-security-DVkeCzcC.mjs} +14 -14
- package/dist/{cloud-connector-bMlFnqP0.mjs → cloud-connector-MVf4acRR.mjs} +3 -3
- package/dist/{cloudflared-Ba4KWdTO.mjs → cloudflared-BOkMl8Gm.mjs} +1 -1
- package/dist/cloudforce-one-KrCfQbRx.mjs +318 -0
- package/dist/{command-BxZBNPxG.mjs → command-BQbZw4Kx.mjs} +1 -1
- package/dist/command-BVct0Dvr.mjs +2 -0
- package/dist/{command-BiIVclNA.mjs → command-C4_lMRkw.mjs} +1 -1
- package/dist/command-CJ3ldWrA.mjs +2 -0
- package/dist/command-CyOdBNur.mjs +2 -0
- package/dist/command-D2XkyO1e.mjs +2 -0
- package/dist/command-DHODgfFZ.mjs +2 -0
- package/dist/command-DIIaZx_f.mjs +2 -0
- package/dist/command-DONwHpqZ.mjs +2 -0
- package/dist/command-DdYnSf-8.mjs +2 -0
- package/dist/command-DqOU7Ql2.mjs +2 -0
- package/dist/{command-pMoNdd22.mjs → command-HW7k43qu.mjs} +1 -1
- package/dist/command-NqM0lo4a.mjs +2 -0
- package/dist/command-bwVDyMv4.mjs +2 -0
- package/dist/command-yzqs4m83.mjs +2 -0
- package/dist/{completions-DRzBiqpv.mjs → completions-0YKvIyBT.mjs} +2 -2
- package/dist/connector-interrupts-CsunbRsr.mjs +6 -0
- package/dist/{connector-telemetry-events-BbAOUt9h.mjs → connector-telemetry-events-DmQPD7xC.mjs} +3 -3
- package/dist/{connector-telemetry-snapshots-DcpBx7Qx.mjs → connector-telemetry-snapshots-C62iHjC9.mjs} +3 -3
- package/dist/{connectors-D1WFLJoE.mjs → connectors-Bg0MU6ZT.mjs} +7 -7
- package/dist/containers-BiA_bpPR.mjs +76 -0
- package/dist/{content-scan-D1GfPSL0.mjs → content-scan-4SA2nacB.mjs} +6 -6
- package/dist/{context-Dp4CXG22.mjs → context-BGm5_wTT.mjs} +1 -1
- package/dist/{cps-D4uhzg3k.mjs → cps-WDmD3V5I.mjs} +3 -3
- package/dist/create-DmLDMvrj.mjs +2 -0
- package/dist/csam-scanner-Rmy-hBEA.mjs +8 -0
- package/dist/custom-csrs-D-lvkyRV.mjs +18 -0
- package/dist/custom-hostnames-B5BQX5m6.mjs +24 -0
- package/dist/custom-nameservers-CZrRjcjx.mjs +12 -0
- package/dist/custom-pages-CWwjtfbj.mjs +38 -0
- package/dist/d1-N81q-FAr.mjs +50 -0
- package/dist/{delegate-B4bKqF7i.mjs → delegate-livNdiwK.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-Ok4ncy06.mjs +2 -0
- package/dist/deploy-context-B_lLfxt7.mjs +55 -0
- package/dist/deploy-input-JZlEJwKB.mjs +2 -0
- package/dist/dev-DxbkJkzc.mjs +4 -0
- package/dist/{diagnostics-D1CUs2o9.mjs → diagnostics-DlJzpO8b.mjs} +7 -7
- package/dist/dialog-CD94-Kzw.mjs +2 -0
- package/dist/discover-D9FNaCDK.mjs +2 -0
- package/dist/discover-DGsMj9ZN.mjs +2 -0
- package/dist/{dist-D5qkmHhC.mjs → dist-BxhwE-W1.mjs} +202 -193
- package/dist/{dls-DWBiYzY1.mjs → dls-5OXuxLAB.mjs} +8 -8
- package/dist/dns-Burep9O7.mjs +142 -0
- package/dist/{dns-firewall-DH9xIT5H.mjs → dns-firewall-hUHaQ0DE.mjs} +8 -8
- package/dist/docs-BFVK88kB.mjs +3 -0
- package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-qsnRlRk6.mjs} +1 -1
- package/dist/{durable-objects-DF0MYpnV.mjs → durable-objects-D6R8S2Dk.mjs} +3 -3
- package/dist/email-auth--2KCzZNA.mjs +6 -0
- package/dist/email-routing-DzaExfVf.mjs +44 -0
- package/dist/{email-security-CnNa1YON.mjs → email-security-DwQJszzy.mjs} +71 -71
- package/dist/{email-sending-CpDSw-Eb.mjs → email-sending-mQd2qB-o.mjs} +21 -21
- package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
- package/dist/error-sanitization-D069tpKk.mjs +2 -0
- package/dist/errors-C_bGcR0X.mjs +11 -0
- package/dist/field-extractors-MVOizTlB.mjs +8 -0
- package/dist/{firewall-CY_oem-d.mjs → firewall-DtSIlkfL.mjs} +19 -19
- package/dist/flagship-9E5gwNki.mjs +24 -0
- package/dist/{fraud-CSUKLh8X.mjs → fraud-DjqhVJdf.mjs} +3 -3
- package/dist/generate-BzOnRBij.mjs +2 -0
- package/dist/generate-DfxZtpn9.mjs +2 -0
- package/dist/get-3XNn0upb.mjs +2 -0
- package/dist/{global-options-DiKj2cQy.mjs → global-options-4pyD17hd.mjs} +1 -1
- package/dist/{google-tag-gateway-C2skt6t-.mjs → google-tag-gateway-BM5GmCZa.mjs} +3 -3
- package/dist/gt-BV-jij5q.mjs +4 -0
- package/dist/healthchecks-CEZ5f3XJ.mjs +20 -0
- package/dist/{hyperdrive-FcBbpew4.mjs → hyperdrive-Da8hCcUw.mjs} +12 -12
- package/dist/{iam-8T74DNhH.mjs → iam-BK6N7NdQ.mjs} +31 -31
- package/dist/{images-C3JUaf6b.mjs → images-3bCWE6Ml.mjs} +33 -33
- package/dist/index.mjs +1 -1
- package/dist/init-BgCF9K8h.mjs +43 -0
- package/dist/intel-BQ58CJLt.mjs +62 -0
- package/dist/{interactive-CKHdGvkh.mjs → interactive-JBA3qOUa.mjs} +9 -9
- package/dist/{internal-CamuESs0.mjs → internal-CWPz0sBF.mjs} +2 -2
- package/dist/{ips-DinCNnWj.mjs → ips-3WYegiVW.mjs} +2 -2
- package/dist/k2-Bc_hjmiv.mjs +10 -0
- package/dist/kv-DbShBhhg.mjs +12 -0
- package/dist/{lazy-command-WB1FOuew.mjs → lazy-command-CbGyEqFK.mjs} +1 -1
- package/dist/leaked-credential-checks-DgPefxP9.mjs +16 -0
- package/dist/{live-B6AsI_E5.mjs → live-BTtMv1a6.mjs} +2 -2
- package/dist/load-balancers-C2hg52WA.mjs +84 -0
- package/dist/{local-CgBhtmON.mjs → local-B3zt9PXR.mjs} +1 -1
- package/dist/local-DRxctCh9.mjs +2 -0
- package/dist/local-runtime-BOnDiMDc.mjs +2 -0
- package/dist/{log-BWdaOGOW.mjs → log-Brx-wjJW.mjs} +3 -3
- package/dist/log-DBAHla_W.mjs +2 -0
- package/dist/login-CK3nn9a5.mjs +2 -0
- package/dist/{login-BJHaTERg.mjs → login-DiR-buzS.mjs} +3 -3
- package/dist/{logpush-qhlxsioM.mjs → logpush-CitvUX-J.mjs} +22 -22
- package/dist/{logs-bI54CJ0w.mjs → logs-CfWHu4Ir.mjs} +14 -16
- package/dist/magic-network-monitoring-gU6yzzML.mjs +34 -0
- package/dist/{magic-transit-BwDyySHJ.mjs → magic-transit-B3JY9u5o.mjs} +139 -139
- package/dist/{managed-defense-CsBBkfeQ.mjs → managed-defense-C_EQ-NYp.mjs} +9 -9
- package/dist/managed-transforms-DIGl6JkM.mjs +8 -0
- package/dist/{mcp-CyI0sDmL.mjs → mcp-DqhQJVaz.mjs} +15 -15
- package/dist/{mesh-Czr0UCP4.mjs → mesh-DXVZBNDC.mjs} +12 -12
- package/dist/{migrate-DKDWYrz2.mjs → migrate-CmXyk9vX.mjs} +1 -1
- package/dist/{monetization-NUgfDtSy.mjs → monetization-CWg-mySr.mjs} +9 -9
- package/dist/{network-interconnects-DuIBe8fK.mjs → network-interconnects-DhfKL5tG.mjs} +17 -19
- package/dist/{network-B42zrBic.mjs → network-jtgq5eb4.mjs} +24 -24
- package/dist/o11y-eYYs59X9.mjs +88 -0
- package/dist/oauth-BgDZMd72.mjs +5 -0
- package/dist/{oauth-BLQ1-y3R.mjs → oauth-V37G-PaV.mjs} +1 -1
- package/dist/{observability-BxhJQCgZ.mjs → observability-CB72eC4T.mjs} +2 -2
- package/dist/ohttp-gateway-K9ToEft8.mjs +8 -0
- package/dist/organizations-BllV7l_c.mjs +70 -0
- package/dist/output-hFMAotFl.mjs +2 -0
- package/dist/package-oNVeacC9.mjs +2 -0
- package/dist/page-rules-BVmi-ZFW.mjs +35 -0
- package/dist/pages-5spcBpX1.mjs +48 -0
- package/dist/pay-per-crawl-BgsdGcBi.mjs +36 -0
- package/dist/{pay-per-use-VatiU-Nt.mjs → pay-per-use-CzmI1kEA.mjs} +16 -16
- package/dist/pipelines-CbtmLRxt.mjs +40 -0
- package/dist/{precursor-D3VH2MXT.mjs → precursor-Dk8YOKf_.mjs} +2 -2
- package/dist/previews-Bv1HMMtO.mjs +6 -0
- package/dist/progress-DE_G09u2.mjs +2 -0
- package/dist/project-settings-D_S-UC8I.mjs +3 -0
- package/dist/prompt-D274Im1O.mjs +4 -0
- package/dist/queues-DGCYUr4g.mjs +52 -0
- package/dist/r2-DtCk-Nfi.mjs +112 -0
- package/dist/{radar-CvLtu-Vr.mjs → radar-1CwqOsMZ.mjs} +150 -150
- package/dist/raw-fetch-DhlyWQtk.mjs +2 -0
- package/dist/{ready-gsGEaWLL.mjs → ready-CcoEA7M7.mjs} +2 -2
- package/dist/{realtime-DiCEgFTC.mjs → realtime-DFUxwIG5.mjs} +80 -81
- package/dist/registrar-Cl1snz8z.mjs +43 -0
- package/dist/registrar-sandbox-Cne9BVCZ.mjs +58 -0
- package/dist/{reporting-BiHgnT8L.mjs → reporting-D9FC-Z-3.mjs} +7 -7
- package/dist/request-headers-Bopp5lH_.mjs +2 -0
- package/dist/request-tracers-CSSB9_aW.mjs +4 -0
- package/dist/resource-sharing-D8yuzJm7.mjs +36 -0
- package/dist/{rules-CRhe_ca9.mjs → rules-DzmOQ3MB.mjs} +8 -8
- package/dist/rulesets-DsTGcgbc.mjs +42 -0
- package/dist/{rum-BfnWHW_d.mjs → rum-DrJLI93T.mjs} +14 -14
- package/dist/run-C5yPsiO2.mjs +2 -0
- package/dist/run-CXWkMU3x.mjs +2 -0
- package/dist/schema-CfZOW8Zw.mjs +2 -0
- package/dist/{schema-cache-BIo0Gi2H.mjs → schema-cache-CtqAs0PP.mjs} +1 -1
- package/dist/schema-flags-DO3kLYBu.mjs +4 -0
- package/dist/scim-0OufLKru.mjs +16 -0
- package/dist/{secrets-store-DgtzZRze.mjs → secrets-store-BQeLzFxv.mjs} +11 -11
- package/dist/{security-insights-SlUGW3F_.mjs → security-insights-D2pj8-O-.mjs} +20 -20
- package/dist/{security-txt-C3YS0REz.mjs → security-txt-SKtgW4n-.mjs} +4 -4
- package/dist/session-COdP8BXD.mjs +2 -0
- package/dist/shared-D_2KLpP3.mjs +2 -0
- package/dist/{signed-url-ClLk45_J.mjs → signed-url-CcE2zQ4Y.mjs} +2 -2
- package/dist/smart-shield-Dod9Gs6T.mjs +22 -0
- package/dist/snippets-DrrdpLnS.mjs +18 -0
- package/dist/spawn-DNf-Ge8d.mjs +5 -0
- package/dist/{spectrum-Cj0BMtg2.mjs → spectrum-CHBGZbZF.mjs} +11 -11
- package/dist/{speed-BrVeZRyX.mjs → speed-vOlHyG3v.mjs} +11 -11
- package/dist/sql-BCuLxGSf.mjs +4 -0
- package/dist/src-ByCoEqOw.mjs +133 -0
- package/dist/{ssl-Bx4LCutF.mjs → ssl-BA_dcVwF.mjs} +60 -62
- package/dist/startup-profile-CyQk_f_L.mjs +2 -0
- package/dist/{startup-profile-DqaYNT0b.mjs → startup-profile-uh-F0HRS.mjs} +3 -3
- package/dist/state-B6r-b_-d.mjs +2 -0
- package/dist/{state-BmzOLELo.mjs → state-CTLznbVs.mjs} +1 -1
- package/dist/{containers-DINLx5_i.mjs → static-assets-DGDoaJf1.mjs} +216 -210
- package/dist/stream-CzlqY8hq.mjs +89 -0
- package/dist/{tags-xVzjZxdt.mjs → tags-BLeaslAb.mjs} +8 -8
- package/dist/telemetry-COlodX5Z.mjs +2 -0
- package/dist/{telemetry-CJ9URio3.mjs → telemetry-DF7A5Bpk.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-M7Fxqh2W.mjs → tenant-custom-nameservers-C5rh6jPf.mjs} +4 -4
- package/dist/tenants-CRirmhxS.mjs +13 -0
- package/dist/{tools-C-vmgYSv.mjs → tools-BRjRgZnj.mjs} +1 -1
- package/dist/tunnels-nLfIWPYT.mjs +27 -0
- package/dist/{turnstile-B_Ugzgom.mjs → turnstile-CZjXtBCr.mjs} +10 -10
- package/dist/ui-dWsVmFCG.mjs +2 -0
- package/dist/{update-check-DRr0eRhB.mjs → update-check-CXMdVBhW.mjs} +1 -1
- package/dist/{update-check-DHUo4FOJ.mjs → update-check-D_Oky9-u.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-CZRQH_pJ.mjs → url-normalization-DTKgJHE8.mjs} +4 -4
- package/dist/url-scanner-9XW3zLaU.mjs +16 -0
- package/dist/user-Bk1BIqZ5.mjs +103 -0
- package/dist/vectorize-CgOfmWYq.mjs +30 -0
- package/dist/verify-B9ILCohg.mjs +2 -0
- package/dist/verify-BCuWaO-L.mjs +2 -0
- package/dist/version-CcuBNjqg.mjs +2 -0
- package/dist/waiting-rooms-C3nTKfK9.mjs +52 -0
- package/dist/{web-assets-CgQXsp8m.mjs → web-assets-CWU3jrit.mjs} +29 -29
- package/dist/web3-CRpQ5sl4.mjs +26 -0
- package/dist/workers-BZMvamn0.mjs +39 -0
- package/dist/{workers-for-platforms-5RkV9MVp.mjs → workers-for-platforms-C7F2ev-5.mjs} +18 -18
- package/dist/{workers-vpc-Bt4OQbwM.mjs → workers-vpc-ztEKvWmq.mjs} +6 -6
- package/dist/workflows-Dd88_Nqc.mjs +48 -0
- package/dist/{wrangler-migration-BbmGOu8l.mjs → wrangler-migration-BzMTJPdI.mjs} +302 -293
- package/dist/zaraz-BFK0p28R.mjs +22 -0
- package/dist/zero-trust-Cdjfp0Ie.mjs +1008 -0
- package/dist/{zones-DTAcguf6.mjs → zones-DDn5jk6I.mjs} +51 -51
- package/package.json +20 -20
- package/dist/ai-DqEN_hhg.mjs +0 -30
- package/dist/ai-audit-BmzOgt6x.mjs +0 -6
- package/dist/ai-gateway-B0uiYVHq.mjs +0 -74
- package/dist/ai-search-DbZIxdio.mjs +0 -74
- package/dist/alerting-BjGwBxZT.mjs +0 -52
- package/dist/analytics-C7kT_H-W.mjs +0 -17
- package/dist/analytics-engine-BHpcNSdD.mjs +0 -4
- package/dist/api-X3wKppsT.mjs +0 -3
- package/dist/argo-D1VONzu-.mjs +0 -14
- package/dist/auth-CspwoBlp.mjs +0 -2
- package/dist/auth-D499YE2n.mjs +0 -7
- package/dist/auth-FK2eLQ02.mjs +0 -2
- package/dist/billing-DRNww0iC.mjs +0 -24
- package/dist/body-parser-BKcZS9iJ.mjs +0 -2
- package/dist/brand-protection-BVICLzBc.mjs +0 -26
- package/dist/browser-run-CEk-NIgP.mjs +0 -40
- package/dist/build-CRm2TQq8.mjs +0 -2
- package/dist/build-DO_GNhRl.mjs +0 -2
- package/dist/builds-CoazxuN-.mjs +0 -64
- package/dist/cache-jlLJLSu7.mjs +0 -36
- package/dist/cf-hP0SOgC6.mjs +0 -18
- package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +0 -363
- package/dist/cli-Nqf58-1c.mjs +0 -4
- package/dist/cloudforce-one-CCaIBOAo.mjs +0 -318
- package/dist/command-BASaTmJc.mjs +0 -2
- package/dist/command-Bih1HLr3.mjs +0 -2
- package/dist/command-ByYf12-8.mjs +0 -2
- package/dist/command-C0qCuw03.mjs +0 -2
- package/dist/command-C2FVMd1b.mjs +0 -2
- package/dist/command-C4OgtX_x.mjs +0 -2
- package/dist/command-C5Kqc5Km.mjs +0 -2
- package/dist/command-CFxyp8Uo.mjs +0 -2
- package/dist/command-CZAR85ba.mjs +0 -2
- package/dist/command-CelQVrZL.mjs +0 -2
- package/dist/command-CrAlzysj.mjs +0 -2
- package/dist/command-MxFFWqMg.mjs +0 -2
- package/dist/connector-interrupts-CrTeSyaM.mjs +0 -6
- package/dist/containers-BOBEs1Gk.mjs +0 -75
- package/dist/create-BtmuVqVL.mjs +0 -2
- package/dist/csam-scanner-DOOUBeBM.mjs +0 -8
- package/dist/custom-csrs-DtdFo5YZ.mjs +0 -18
- package/dist/custom-hostnames-ccdlELaD.mjs +0 -24
- package/dist/custom-nameservers-p3gDjfva.mjs +0 -12
- package/dist/custom-pages-DAkKVzgR.mjs +0 -38
- package/dist/d1-CDIyRdh4.mjs +0 -52
- package/dist/deploy-BaC5Ty7F.mjs +0 -2
- package/dist/deploy-context-DTTgNGro.mjs +0 -56
- package/dist/deploy-input-mAy06fAI.mjs +0 -2
- package/dist/dev-De-HszNT.mjs +0 -4
- package/dist/dialog-D5lus4M4.mjs +0 -2
- package/dist/discover-6kAmVMPp.mjs +0 -2
- package/dist/discover-C06Syc2B.mjs +0 -2
- package/dist/dns-wMjf1t6-.mjs +0 -152
- package/dist/docs-BA7qslb2.mjs +0 -3
- package/dist/email-auth-BShMFXn4.mjs +0 -6
- package/dist/email-domains-CDSbVclP.mjs +0 -14
- package/dist/email-routing-CBCkbg_F.mjs +0 -44
- package/dist/error-sanitization-B025CygB.mjs +0 -2
- package/dist/errors-DatLr-iR.mjs +0 -11
- package/dist/field-extractors-BwGdMnTr.mjs +0 -8
- package/dist/flagship-Bat5EZCk.mjs +0 -24
- package/dist/generate-CeeWW3eX.mjs +0 -3
- package/dist/generate-D6V4Q58z.mjs +0 -2
- package/dist/get-Be821dio.mjs +0 -2
- package/dist/gt-BQkaDQDq.mjs +0 -3
- package/dist/healthchecks-uC43QKQd.mjs +0 -20
- package/dist/init-BEVVz4_P.mjs +0 -43
- package/dist/intel-DRy4rHrt.mjs +0 -62
- package/dist/k2-wsanPL3y.mjs +0 -10
- package/dist/kv-BLSPcEnH.mjs +0 -12
- package/dist/leaked-credential-checks-CSZd9hBQ.mjs +0 -16
- package/dist/load-balancers-gap5u4b1.mjs +0 -84
- package/dist/local-CFsO9Tkg.mjs +0 -2
- package/dist/local-runtime-CmlJ20uJ.mjs +0 -2
- package/dist/log-DZfik9Jk.mjs +0 -2
- package/dist/login-BfuOf-Yi.mjs +0 -2
- package/dist/magic-network-monitoring-CX3TaMTu.mjs +0 -34
- package/dist/managed-transforms-CUC-uAbW.mjs +0 -8
- package/dist/o11y-oEUpMC3O.mjs +0 -86
- package/dist/oauth-BmSFLp_s.mjs +0 -4
- package/dist/organization-CEnlXwrl.mjs +0 -70
- package/dist/organizations-Dt86ToxE.mjs +0 -4
- package/dist/origin-post-quantum-encryption-lX-uaJSL.mjs +0 -6
- package/dist/output-BJEgbI0G.mjs +0 -2
- package/dist/package-CiRJBRHO.mjs +0 -2
- package/dist/page-rules-J6LhwR-s.mjs +0 -38
- package/dist/pages-BksdnChs.mjs +0 -48
- package/dist/pay-per-crawl-BLcbHRoR.mjs +0 -36
- package/dist/pipelines-B5AoB3f3.mjs +0 -40
- package/dist/previews-DzJ85fsr.mjs +0 -6
- package/dist/progress-DLri-rA7.mjs +0 -2
- package/dist/project-settings-nBMEx1f-.mjs +0 -3
- package/dist/prompt-D0dXwuME.mjs +0 -4
- package/dist/queues-BsAck4To.mjs +0 -52
- package/dist/r2-BYjdHDEZ.mjs +0 -112
- package/dist/raw-fetch-DQeDx1wT.mjs +0 -2
- package/dist/registrar-D4wdgWpo.mjs +0 -43
- package/dist/registrar-sandbox-B6yopzdG.mjs +0 -58
- package/dist/request-headers-CoxHUNcB.mjs +0 -2
- package/dist/request-tracers-817HTytF.mjs +0 -4
- package/dist/resource-sharing-CW9xxtq5.mjs +0 -36
- package/dist/rulesets-CKyc-Xlx.mjs +0 -42
- package/dist/run-Ciw_GIrC.mjs +0 -2
- package/dist/run-DD45EQTm.mjs +0 -2
- package/dist/schema-DuLIZRhA.mjs +0 -2
- package/dist/schema-flags-DrqvwQNw.mjs +0 -4
- package/dist/scim-C4iRWNYB.mjs +0 -16
- package/dist/session-D2yuwO4i.mjs +0 -2
- package/dist/shared--uVkAAd7.mjs +0 -2
- package/dist/smart-shield-Dn95hqUH.mjs +0 -22
- package/dist/snippets-BNUKOajz.mjs +0 -18
- package/dist/spawn-DuT4snxu.mjs +0 -5
- package/dist/sql-BX1pBqj3.mjs +0 -4
- package/dist/src-DPnUfK4c.mjs +0 -131
- package/dist/startup-profile-tZNb2HGz.mjs +0 -2
- package/dist/state-Uwfrmw5I.mjs +0 -2
- package/dist/stream-BRzr6yh0.mjs +0 -89
- package/dist/telemetry-Pt5GpCKD.mjs +0 -2
- package/dist/tunnels-DQVXKUKA.mjs +0 -27
- package/dist/ui-FYultowZ.mjs +0 -2
- package/dist/url-scanner-BH4PLy16.mjs +0 -16
- package/dist/user-Bn82Qw0Y.mjs +0 -103
- package/dist/vectorize-DoVVz_sh.mjs +0 -30
- package/dist/version-Zr2oF8mY.mjs +0 -2
- package/dist/waiting-rooms-QUW131o3.mjs +0 -52
- package/dist/web3-TY9s6Swn.mjs +0 -26
- package/dist/workers-B3uJqJKc.mjs +0 -39
- package/dist/workers-builds-BgGY0IGk.mjs +0 -14
- package/dist/workflows-6m85DdqF.mjs +0 -48
- package/dist/zaraz-8WSJ7l0L.mjs +0 -22
- package/dist/zero-trust-DK0cqDZv.mjs +0 -1022
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-D0dXwuME.mjs";import{n as g,t as _}from"./raw-fetch-DQeDx1wT.mjs";var v={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/available_alerts`};function y(e){return e.usage(`$0 alerting available-alerts list
|
|
3
|
-
|
|
4
|
-
Gets a list of all alert types for which an account is eligible.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`list`,describe:`Get Alert Types`,builder:y,handler:async e=>c({command:`alerting available-alerts list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting available-alerts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/available_alerts`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(v,{account_id:l}));a(u,{successLabel:`Loaded`})})},te={command:`available-alerts`,describe:`Operations for available-alerts`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ne={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/eligible`};function re(e){return e.usage(`$0 alerting destinations eligible get
|
|
5
|
-
|
|
6
|
-
Get a list of all delivery mechanism types for which an account is eligible.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Get delivery mechanism eligibility`,builder:re,handler:async e=>c({command:`alerting destinations eligible get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting destinations eligible get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/destinations/eligible`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ne,{account_id:l}));a(u,{successLabel:`Loaded`})})},b={command:`eligible`,describe:`Operations for destinations.eligible`,builder:e=>e.command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/pagerduty/connect`};function S(e){return e.usage(`$0 alerting destinations pagerduty create
|
|
7
|
-
|
|
8
|
-
Creates a new token for integrating with PagerDuty.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`create`,describe:`Create PagerDuty integration token`,builder:S,handler:async e=>c({command:`alerting destinations pagerduty create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting destinations pagerduty create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/destinations/pagerduty/connect`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(x,{account_id:l}));a(u,{successLabel:`Created`})})};var w={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/pagerduty`};function T(e){return e.usage(`$0 alerting destinations pagerduty delete
|
|
9
|
-
|
|
10
|
-
Deletes all the PagerDuty Services connected to the account.`).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`,describe:`Delete PagerDuty Services`,builder:T,handler:async e=>c({command:`alerting destinations pagerduty delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting destinations pagerduty delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/destinations/pagerduty`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes all PagerDuty services connected to the account.`}))return;let u=await s(`Deleting`,async()=>c.send(w,{account_id:l}));a(u,{successLabel:`Deleted`})})};var D={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/pagerduty`};function O(e){return e.usage(`$0 alerting destinations pagerduty get
|
|
11
|
-
|
|
12
|
-
Get a list of all configured PagerDuty services.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`List PagerDuty services`,builder:O,handler:async e=>c({command:`alerting destinations pagerduty get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting destinations pagerduty get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/destinations/pagerduty`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(D,{account_id:l}));a(u,{successLabel:`Loaded`})})};var A={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/pagerduty/connect/${t.token_id}`};function j(e){return e.usage(`$0 alerting destinations pagerduty link <token-id>
|
|
13
|
-
|
|
14
|
-
Links PagerDuty with the account using the integration token.`).positional(`token-id`,{type:`string`,description:`The token integration key`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`link <token-id>`,describe:`Connect PagerDuty`,builder:j,handler:async e=>c({command:`alerting destinations pagerduty link`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting destinations pagerduty link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/destinations/pagerduty/connect/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(A,{account_id:l,token_id:e[`token-id`]}));a(u,{successLabel:`Loaded`})})},N={command:`pagerduty`,describe:`Operations for destinations.pagerduty`,builder:e=>e.command(C).command(E).command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var P={method:`POST`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/webhooks`,body:`json`};function F(e){return e.usage(`$0 alerting destinations webhooks create
|
|
15
|
-
|
|
16
|
-
Creates a new webhook destination.`).option(`name`,{type:`string`,description:`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`}).option(`secret`,{type:`string`,description:"Optional secret that will be passed in the `cf-webhook-auth` header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body."}).option(`url`,{type:`string`,description:`The POST endpoint to call when dispatching a notification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`create`,describe:`Create a webhook`,builder:F,handler:async e=>c({command:`alerting destinations webhooks create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting destinations webhooks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/destinations/webhooks`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({name:f(e.name,`name`,`text`),secret:f(e.secret,`secret`,`text`),url:f(e.url,`url`,`text`)}):u(e.body),sensitiveBodyPaths:[[`secret`]]});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(P,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`)),e.url===void 0&&(e.url=await p(`url`,`The POST endpoint to call when dispatching a notification.`));let m=d({name:f(e.name,`name`,`text`),secret:f(e.secret,`secret`,`text`),url:f(e.url,`url`,`text`)}),h=await s(`Creating`,async()=>c.send(P,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var L={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/webhooks/${t.webhook_id}`};function R(e){return e.usage(`$0 alerting destinations webhooks delete <webhook-id>
|
|
17
|
-
|
|
18
|
-
Delete a configured webhook destination.`).positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,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 z={command:`delete <webhook-id>`,describe:`Delete a webhook`,builder:R,handler:async e=>c({command:`alerting destinations webhooks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting destinations webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/destinations/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the webhook destination.`}))return;let u=await s(`Deleting`,async()=>c.send(L,{account_id:l,webhook_id:e[`webhook-id`]}));a(u,{successLabel:`Deleted`})})};var B={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/webhooks/${t.webhook_id}`};function V(e){return e.usage(`$0 alerting destinations webhooks get <webhook-id>
|
|
19
|
-
|
|
20
|
-
Get details for a single webhooks destination.`).positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <webhook-id>`,describe:`Get a webhook`,builder:V,handler:async e=>c({command:`alerting destinations webhooks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting destinations webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/destinations/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(B,{account_id:l,webhook_id:e[`webhook-id`]}));a(u,{successLabel:`Loaded`})})};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/webhooks`};function W(e){return e.usage(`$0 alerting destinations webhooks list
|
|
21
|
-
|
|
22
|
-
Gets a list of all configured webhook destinations.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List webhooks`,builder:W,handler:async e=>c({command:`alerting destinations webhooks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting destinations webhooks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/destinations/webhooks`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(U,{account_id:l}));a(u,{successLabel:`Loaded`})})};var K={method:`PUT`,path:t=>e`/accounts/${t.account_id}/alerting/v3/destinations/webhooks/${t.webhook_id}`,body:`json`};function q(e){return e.usage(`$0 alerting destinations webhooks update <webhook-id>
|
|
23
|
-
|
|
24
|
-
Update a webhook destination.`).positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`}).option(`secret`,{type:`string`,description:"Optional secret that will be passed in the `cf-webhook-auth` header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body."}).option(`url`,{type:`string`,description:`The POST endpoint to call when dispatching a notification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`update <webhook-id>`,describe:`Update a webhook`,builder:q,handler:async e=>c({command:`alerting destinations webhooks update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting destinations webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/destinations/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({name:f(e.name,`name`,`text`),secret:f(e.secret,`secret`,`text`),url:f(e.url,`url`,`text`)}):u(e.body),sensitiveBodyPaths:[[`secret`]]});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(K,{body:t,account_id:l,webhook_id:e[`webhook-id`]}));a(n,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await p(`name`,`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`)),e.url===void 0&&(e.url=await p(`url`,`The POST endpoint to call when dispatching a notification.`));let m=d({name:f(e.name,`name`,`text`),secret:f(e.secret,`secret`,`text`),url:f(e.url,`url`,`text`)}),h=await s(`Updating`,async()=>c.send(K,{body:m,account_id:l,webhook_id:e[`webhook-id`]}));a(h,{successLabel:`Updated`})})},Y={command:`webhooks`,describe:`Operations for destinations.webhooks`,builder:e=>e.command(I).command(z).command(H).command(G).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ae={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(b).command(N).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var oe={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/history`,query:[`per_page`,`before`,`page`,`since`]};function se(e){return e.usage(`$0 alerting history list
|
|
25
|
-
|
|
26
|
-
Gets a list of history records for notifications sent to an account. The records are displayed for last \`x\` number of days based on the zone plan (free = 30, pro = 30, biz = 30, ent = 90).`).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`before`,{type:`string`,description:`Limit the returned results to history records older than the specified date. This must be a timestamp that conforms to RFC3339.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`since`,{type:`string`,description:`Limit the returned results to history records newer than the specified date. This must be a timestamp that conforms to RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`List History`,builder:se,handler:async e=>c({command:`alerting history list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={per_page:e[`per-page`],before:e.before,page:e.page,since:e.since};if(e.dryRun){let e=await r();o({command:`cf alerting history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(oe,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},le={command:`history`,describe:`Operations for history`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies`,body:`json`};function ue(e){return e.usage(`$0 alerting policies create
|
|
27
|
-
|
|
28
|
-
Creates a new Notification policy.`).option(`alert-interval`,{type:`string`,description:`Optional specification of how often to re-alert from the same incident, not support on all alert types.`}).option(`alert-type`,{type:`string`,description:`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,choices:/* @__PURE__ */ `abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`)}).coerce(`alert-type`,e=>f(e,`alert-type`,`text`)).option(`description`,{type:`string`,description:`Optional description for the Notification policy.`}).option(`enabled`,{type:`boolean`,description:`Whether or not the Notification policy is enabled.`,default:!0}).option(`filters-actions`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-affected-asns`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-affected-components`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-affected-locations`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-airport-code`,{type:`string`,array:!0,description:`Used for configuring maintenance_event_notification`}).option(`filters-alert-trigger-preferences`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-alert-trigger-preferences-value`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-enabled`,{type:`string`,array:!0,description:`Used for configuring load_balancing_pool_enablement_alert`}).option(`filters-environment`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event-source`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-event-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-group-by`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-health-check-id`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-incident-impact`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-input-id`,{type:`string`,array:!0,description:`Used for configuring stream_live_notifications`}).option(`filters-insight-class`,{type:`string`,array:!0,description:`Used for configuring security_insights_alert`}).option(`filters-limit`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-logo-tag`,{type:`string`,array:!0,description:`Used for configuring logo_match_alert`}).option(`filters-megabits-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-new-health`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-new-status`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-packets-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-pool-id`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-pop-names`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-product`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-project-id`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-protocol`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-query-tag`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-requests-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-selectors`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-services`,{type:`string`,array:!0,description:`Used for configuring clickhouse_alert_fw_ent_anomaly`}).option(`filters-slo`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-status`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-target-hostname`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-target-ip`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-target-zone-name`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-token-id`,{type:`string`,array:!0,description:`Access service token IDs to include for expiring_service_token_alert. Omit this property to include all current and future service tokens.`}).option(`filters-traffic-exclusions`,{type:`string`,array:!0,description:`Used for configuring traffic_anomalies_alert`}).option(`filters-tunnel-id`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-tunnel-name`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-where`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-zones`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`mechanisms-email`,{type:`string`,description:`The mechanisms.email field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`mechanisms-pagerduty`,{type:`string`,description:`The mechanisms.pagerduty field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`mechanisms-webhooks`,{type:`string`,description:`The mechanisms.webhooks field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Name of the policy.`}).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 de={command:`create`,describe:`Create a Notification policy`,builder:ue,handler:async e=>c({command:`alerting policies create`,classification:{safeFlags:[`alert-type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({alert_interval:f(e[`alert-interval`],`alert-interval`,`text`),alert_type:e[`alert-type`],description:f(e.description,`description`,`text`),enabled:e.enabled,filters:{actions:e[`filters-actions`],affected_asns:e[`filters-affected-asns`],affected_components:e[`filters-affected-components`],affected_locations:e[`filters-affected-locations`],airport_code:e[`filters-airport-code`],alert_trigger_preferences:e[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:e[`filters-alert-trigger-preferences-value`],enabled:e[`filters-enabled`],environment:e[`filters-environment`],event:e[`filters-event`],event_source:e[`filters-event-source`],event_type:e[`filters-event-type`],group_by:e[`filters-group-by`],health_check_id:e[`filters-health-check-id`],incident_impact:e[`filters-incident-impact`],input_id:e[`filters-input-id`],insight_class:e[`filters-insight-class`],limit:e[`filters-limit`],logo_tag:e[`filters-logo-tag`],megabits_per_second:e[`filters-megabits-per-second`],new_health:e[`filters-new-health`],new_status:e[`filters-new-status`],packets_per_second:e[`filters-packets-per-second`],pool_id:e[`filters-pool-id`],pop_names:e[`filters-pop-names`],product:e[`filters-product`],project_id:e[`filters-project-id`],protocol:e[`filters-protocol`],query_tag:e[`filters-query-tag`],requests_per_second:e[`filters-requests-per-second`],selectors:e[`filters-selectors`],services:e[`filters-services`],slo:e[`filters-slo`],status:e[`filters-status`],target_hostname:e[`filters-target-hostname`],target_ip:e[`filters-target-ip`],target_zone_name:e[`filters-target-zone-name`],token_id:e[`filters-token-id`],traffic_exclusions:e[`filters-traffic-exclusions`],tunnel_id:e[`filters-tunnel-id`],tunnel_name:e[`filters-tunnel-name`],type:e[`filters-type`],where:e[`filters-where`],zones:e[`filters-zones`]},mechanisms:{email:l(e[`mechanisms-email`],`mechanisms-email`),pagerduty:l(e[`mechanisms-pagerduty`],`mechanisms-pagerduty`),webhooks:l(e[`mechanisms-webhooks`],`mechanisms-webhooks`)},name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(X,{body:t,account_id:h}));a(n,{successLabel:`Created`});return}if(e[`alert-type`]===void 0&&(e[`alert-type`]=await m(`alert-type`,`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,/* @__PURE__ */ `abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`))),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await p(`name`,`Name of the policy.`));let g=d({alert_interval:f(e[`alert-interval`],`alert-interval`,`text`),alert_type:e[`alert-type`],description:f(e.description,`description`,`text`),enabled:e.enabled,filters:{actions:e[`filters-actions`],affected_asns:e[`filters-affected-asns`],affected_components:e[`filters-affected-components`],affected_locations:e[`filters-affected-locations`],airport_code:e[`filters-airport-code`],alert_trigger_preferences:e[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:e[`filters-alert-trigger-preferences-value`],enabled:e[`filters-enabled`],environment:e[`filters-environment`],event:e[`filters-event`],event_source:e[`filters-event-source`],event_type:e[`filters-event-type`],group_by:e[`filters-group-by`],health_check_id:e[`filters-health-check-id`],incident_impact:e[`filters-incident-impact`],input_id:e[`filters-input-id`],insight_class:e[`filters-insight-class`],limit:e[`filters-limit`],logo_tag:e[`filters-logo-tag`],megabits_per_second:e[`filters-megabits-per-second`],new_health:e[`filters-new-health`],new_status:e[`filters-new-status`],packets_per_second:e[`filters-packets-per-second`],pool_id:e[`filters-pool-id`],pop_names:e[`filters-pop-names`],product:e[`filters-product`],project_id:e[`filters-project-id`],protocol:e[`filters-protocol`],query_tag:e[`filters-query-tag`],requests_per_second:e[`filters-requests-per-second`],selectors:e[`filters-selectors`],services:e[`filters-services`],slo:e[`filters-slo`],status:e[`filters-status`],target_hostname:e[`filters-target-hostname`],target_ip:e[`filters-target-ip`],target_zone_name:e[`filters-target-zone-name`],token_id:e[`filters-token-id`],traffic_exclusions:e[`filters-traffic-exclusions`],tunnel_id:e[`filters-tunnel-id`],tunnel_name:e[`filters-tunnel-name`],type:e[`filters-type`],where:e[`filters-where`],zones:e[`filters-zones`]},mechanisms:{email:l(e[`mechanisms-email`],`mechanisms-email`),pagerduty:l(e[`mechanisms-pagerduty`],`mechanisms-pagerduty`),webhooks:l(e[`mechanisms-webhooks`],`mechanisms-webhooks`)},name:f(e.name,`name`,`text`)}),_=await s(`Creating`,async()=>c.send(X,{body:g,account_id:h}));a(_,{successLabel:`Created`})})};var fe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies/${t.policy_id}`};function pe(e){return e.usage(`$0 alerting policies delete <policy-id>
|
|
29
|
-
|
|
30
|
-
Delete a Notification policy.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,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 me={command:`delete <policy-id>`,describe:`Delete a Notification policy`,builder:pe,handler:async e=>c({command:`alerting policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the notification policy.`}))return;let u=await s(`Deleting`,async()=>c.send(fe,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Deleted`})})};function he(e){return e.usage(`$0 alerting policies email details <policy-id>
|
|
31
|
-
|
|
32
|
-
Shows details for unsubscribing an email address from a notification policy.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`email`,{type:`string`,description:`Email`,demandOption:!0}).option(`token`,{type:`string`,description:`Token`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`details <policy-id>`,describe:`Show email unsubscribe details`,builder:he,handler:async e=>c({command:`alerting policies email details`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let a={email:e.email,token:e.token};if(e.dryRun){let t=await r();o({command:`cf alerting policies email details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}/email/unsubscribe`,pathParams:{"policy-id":String(e[`policy-id`]??``)},query:a,bodyKind:`none`});return}await n(e);let c=e.local?t:await i();e.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>_(`/accounts/${c}/alerting/v3/policies/${encodeURIComponent(String(e[`policy-id`]))}/email/unsubscribe${l?`?`+l:``}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));g(u.toString(`utf-8`))})};function _e(e){return e.usage(`$0 alerting policies email unsubscribe <policy-id>
|
|
33
|
-
|
|
34
|
-
Unsubscribes an email address from a notification policy.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`email`,{type:`string`,description:`Email`,demandOption:!0}).option(`token`,{type:`string`,description:`Token`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`unsubscribe <policy-id>`,describe:`Unsubscribe email from a Notification policy`,builder:_e,handler:async e=>c({command:`alerting policies email unsubscribe`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let a={email:e.email,token:e.token};if(e.dryRun){let t=await r();o({command:`cf alerting policies email unsubscribe`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}/email/unsubscribe`,pathParams:{"policy-id":String(e[`policy-id`]??``)},query:a,bodyKind:`none`});return}await n(e);let c=e.local?t:await i();e.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Creating`,async()=>_(`/accounts/${c}/alerting/v3/policies/${encodeURIComponent(String(e[`policy-id`]))}/email/unsubscribe${l?`?`+l:``}`,{method:`POST`,local:e.local===!0,persistTo:e.persistTo}));g(u.toString(`utf-8`))})},ye={command:`email`,describe:`Operations for policies.email`,builder:e=>e.command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var be={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies/${t.policy_id}`};function xe(e){return e.usage(`$0 alerting policies get <policy-id>
|
|
35
|
-
|
|
36
|
-
Get details for a single policy.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get <policy-id>`,describe:`Get a Notification policy`,builder:xe,handler:async e=>c({command:`alerting policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(be,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Loaded`})})};var Ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies`};function we(e){return e.usage(`$0 alerting policies list
|
|
37
|
-
|
|
38
|
-
Get a list of all Notification policies.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`list`,describe:`List Notification policies`,builder:we,handler:async e=>c({command:`alerting policies list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/policies`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Ce,{account_id:l}));a(u,{successLabel:`Loaded`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies/${t.policy_id}/test`,body:`json`};function Ee(e){return e.usage(`$0 alerting policies test <policy-id>
|
|
39
|
-
|
|
40
|
-
Send a test notification for a policy to verify delivery mechanisms are working as expected.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`severity`,{type:`number`,description:`Severity level for the test alert. Defaults to INFO (1) if omitted.`}).option(`source`,{type:`string`,description:`Source identifier for the test alert.`}).option(`state-correlation-id`,{type:`string`,description:`Correlation ID for stateful test alerts. Required when state_event is set.`}).option(`state-event`,{type:`number`,description:`State event type for stateful test alerts. Use with state_correlation_id.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Optional configuration for the test notification. When omitted, a default INFO-severity test alert is sent.`})}const De={command:`test <policy-id>`,describe:`Test a Notification policy`,builder:Ee,handler:async e=>c({command:`alerting policies test`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting policies test`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}/test`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({severity:e.severity,source:f(e.source,`source`,`text`),state_correlation_id:f(e[`state-correlation-id`],`state-correlation-id`,`text`),state_event:e[`state-event`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(Z,{body:t,account_id:l,policy_id:e[`policy-id`]}));a(n,{successLabel:`Created`});return}let p=d({severity:e.severity,source:f(e.source,`source`,`text`),state_correlation_id:f(e[`state-correlation-id`],`state-correlation-id`,`text`),state_event:e[`state-event`]}),m=await s(`Creating`,async()=>c.send(Z,{body:p,account_id:l,policy_id:e[`policy-id`]}));a(m,{successLabel:`Created`})})};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/alerting/v3/policies/${t.policy_id}`,body:`json`};function Oe(e){return e.usage(`$0 alerting policies update <policy-id>
|
|
41
|
-
|
|
42
|
-
Update a Notification policy.`).positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`alert-interval`,{type:`string`,description:`Optional specification of how often to re-alert from the same incident, not support on all alert types.`}).option(`alert-type`,{type:`string`,description:`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,choices:/* @__PURE__ */ `abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`)}).coerce(`alert-type`,e=>f(e,`alert-type`,`text`)).option(`description`,{type:`string`,description:`Optional description for the Notification policy.`}).option(`enabled`,{type:`boolean`,description:`Whether or not the Notification policy is enabled.`}).option(`filters-actions`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-affected-asns`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-affected-components`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-affected-locations`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-airport-code`,{type:`string`,array:!0,description:`Used for configuring maintenance_event_notification`}).option(`filters-alert-trigger-preferences`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-alert-trigger-preferences-value`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-enabled`,{type:`string`,array:!0,description:`Used for configuring load_balancing_pool_enablement_alert`}).option(`filters-environment`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event-source`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-event-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-group-by`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-health-check-id`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-incident-impact`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-input-id`,{type:`string`,array:!0,description:`Used for configuring stream_live_notifications`}).option(`filters-insight-class`,{type:`string`,array:!0,description:`Used for configuring security_insights_alert`}).option(`filters-limit`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-logo-tag`,{type:`string`,array:!0,description:`Used for configuring logo_match_alert`}).option(`filters-megabits-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-new-health`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-new-status`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-packets-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-pool-id`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-pop-names`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-product`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-project-id`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-protocol`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-query-tag`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-requests-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-selectors`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-services`,{type:`string`,array:!0,description:`Used for configuring clickhouse_alert_fw_ent_anomaly`}).option(`filters-slo`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-status`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-target-hostname`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-target-ip`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-target-zone-name`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-token-id`,{type:`string`,array:!0,description:`Access service token IDs to include for expiring_service_token_alert. Omit this property to include all current and future service tokens.`}).option(`filters-traffic-exclusions`,{type:`string`,array:!0,description:`Used for configuring traffic_anomalies_alert`}).option(`filters-tunnel-id`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-tunnel-name`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-where`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-zones`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`mechanisms-email`,{type:`string`,description:`The mechanisms.email field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`mechanisms-pagerduty`,{type:`string`,description:`The mechanisms.pagerduty field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`mechanisms-webhooks`,{type:`string`,description:`The mechanisms.webhooks field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Name of the policy.`}).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 ke={command:`update <policy-id>`,describe:`Update a Notification policy`,builder:Oe,handler:async e=>c({command:`alerting policies update`,classification:{safeFlags:[`alert-type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({alert_interval:f(e[`alert-interval`],`alert-interval`,`text`),alert_type:e[`alert-type`],description:f(e.description,`description`,`text`),enabled:e.enabled,filters:{actions:e[`filters-actions`],affected_asns:e[`filters-affected-asns`],affected_components:e[`filters-affected-components`],affected_locations:e[`filters-affected-locations`],airport_code:e[`filters-airport-code`],alert_trigger_preferences:e[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:e[`filters-alert-trigger-preferences-value`],enabled:e[`filters-enabled`],environment:e[`filters-environment`],event:e[`filters-event`],event_source:e[`filters-event-source`],event_type:e[`filters-event-type`],group_by:e[`filters-group-by`],health_check_id:e[`filters-health-check-id`],incident_impact:e[`filters-incident-impact`],input_id:e[`filters-input-id`],insight_class:e[`filters-insight-class`],limit:e[`filters-limit`],logo_tag:e[`filters-logo-tag`],megabits_per_second:e[`filters-megabits-per-second`],new_health:e[`filters-new-health`],new_status:e[`filters-new-status`],packets_per_second:e[`filters-packets-per-second`],pool_id:e[`filters-pool-id`],pop_names:e[`filters-pop-names`],product:e[`filters-product`],project_id:e[`filters-project-id`],protocol:e[`filters-protocol`],query_tag:e[`filters-query-tag`],requests_per_second:e[`filters-requests-per-second`],selectors:e[`filters-selectors`],services:e[`filters-services`],slo:e[`filters-slo`],status:e[`filters-status`],target_hostname:e[`filters-target-hostname`],target_ip:e[`filters-target-ip`],target_zone_name:e[`filters-target-zone-name`],token_id:e[`filters-token-id`],traffic_exclusions:e[`filters-traffic-exclusions`],tunnel_id:e[`filters-tunnel-id`],tunnel_name:e[`filters-tunnel-name`],type:e[`filters-type`],where:e[`filters-where`],zones:e[`filters-zones`]},mechanisms:{email:l(e[`mechanisms-email`],`mechanisms-email`),pagerduty:l(e[`mechanisms-pagerduty`],`mechanisms-pagerduty`),webhooks:l(e[`mechanisms-webhooks`],`mechanisms-webhooks`)},name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(Q,{body:t,account_id:p,policy_id:e[`policy-id`]}));a(n,{successLabel:`Updated`});return}let m=d({alert_interval:f(e[`alert-interval`],`alert-interval`,`text`),alert_type:e[`alert-type`],description:f(e.description,`description`,`text`),enabled:e.enabled,filters:{actions:e[`filters-actions`],affected_asns:e[`filters-affected-asns`],affected_components:e[`filters-affected-components`],affected_locations:e[`filters-affected-locations`],airport_code:e[`filters-airport-code`],alert_trigger_preferences:e[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:e[`filters-alert-trigger-preferences-value`],enabled:e[`filters-enabled`],environment:e[`filters-environment`],event:e[`filters-event`],event_source:e[`filters-event-source`],event_type:e[`filters-event-type`],group_by:e[`filters-group-by`],health_check_id:e[`filters-health-check-id`],incident_impact:e[`filters-incident-impact`],input_id:e[`filters-input-id`],insight_class:e[`filters-insight-class`],limit:e[`filters-limit`],logo_tag:e[`filters-logo-tag`],megabits_per_second:e[`filters-megabits-per-second`],new_health:e[`filters-new-health`],new_status:e[`filters-new-status`],packets_per_second:e[`filters-packets-per-second`],pool_id:e[`filters-pool-id`],pop_names:e[`filters-pop-names`],product:e[`filters-product`],project_id:e[`filters-project-id`],protocol:e[`filters-protocol`],query_tag:e[`filters-query-tag`],requests_per_second:e[`filters-requests-per-second`],selectors:e[`filters-selectors`],services:e[`filters-services`],slo:e[`filters-slo`],status:e[`filters-status`],target_hostname:e[`filters-target-hostname`],target_ip:e[`filters-target-ip`],target_zone_name:e[`filters-target-zone-name`],token_id:e[`filters-token-id`],traffic_exclusions:e[`filters-traffic-exclusions`],tunnel_id:e[`filters-tunnel-id`],tunnel_name:e[`filters-tunnel-name`],type:e[`filters-type`],where:e[`filters-where`],zones:e[`filters-zones`]},mechanisms:{email:l(e[`mechanisms-email`],`mechanisms-email`),pagerduty:l(e[`mechanisms-pagerduty`],`mechanisms-pagerduty`),webhooks:l(e[`mechanisms-webhooks`],`mechanisms-webhooks`)},name:f(e.name,`name`,`text`)}),h=await s(`Updating`,async()=>c.send(Q,{body:m,account_id:p,policy_id:e[`policy-id`]}));a(h,{successLabel:`Updated`})})},Ae={command:`policies`,describe:`Operations for policies`,builder:e=>e.command(de).command(me).command(Se).command(Te).command(De).command(ke).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var je={method:`POST`,path:t=>e`/accounts/${t.account_id}/alerting/v3/silences`,body:`json`};function Me(e){return e.usage(`$0 alerting silences create
|
|
43
|
-
|
|
44
|
-
Creates a new silence for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ne={command:`create`,describe:`Create Silences`,builder:Me,handler:async e=>c({command:`alerting silences create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting silences create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/silences`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(je,{body:t,account_id:l}));a(n,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var Pe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/alerting/v3/silences/${t.silence_id}`};function $(e){return e.usage(`$0 alerting silences delete <silence-id>
|
|
45
|
-
|
|
46
|
-
Deletes an existing silence for an account.`).positional(`silence-id`,{type:`string`,description:`Silence 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 Fe={command:`delete <silence-id>`,describe:`Delete Silence`,builder:$,handler:async e=>c({command:`alerting silences delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting silences delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/silences/${e[`silence-id`]==null?`<silence-id>`:encodeURIComponent(String(e[`silence-id`]))}`,pathParams:{"silence-id":String(e[`silence-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the notification silence.`}))return;let u=await s(`Deleting`,async()=>c.send(Pe,{account_id:l,silence_id:e[`silence-id`]}));a(u,{successLabel:`Deleted`})})};var Ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/silences/${t.silence_id}`};function Le(e){return e.usage(`$0 alerting silences get <silence-id>
|
|
47
|
-
|
|
48
|
-
Gets a specific silence for an account.`).positional(`silence-id`,{type:`string`,description:`Silence ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <silence-id>`,describe:`Get Silence`,builder:Le,handler:async e=>c({command:`alerting silences get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting silences get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/silences/${e[`silence-id`]==null?`<silence-id>`:encodeURIComponent(String(e[`silence-id`]))}`,pathParams:{"silence-id":String(e[`silence-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Ie,{account_id:l,silence_id:e[`silence-id`]}));a(u,{successLabel:`Loaded`})})};var ze={method:`GET`,path:t=>e`/accounts/${t.account_id}/alerting/v3/silences`};function Be(e){return e.usage(`$0 alerting silences list
|
|
49
|
-
|
|
50
|
-
Gets a list of silences for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`list`,describe:`List Silences`,builder:Be,handler:async e=>c({command:`alerting silences list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf alerting silences list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/alerting/v3/silences`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ze,{account_id:l}));a(u,{successLabel:`Loaded`})})};var He={method:`PUT`,path:t=>e`/accounts/${t.account_id}/alerting/v3/silences`,body:`json`};function Ue(e){return e.usage(`$0 alerting silences update
|
|
51
|
-
|
|
52
|
-
Updates existing silences for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const We={command:`update`,describe:`Update Silences`,builder:Ue,handler:async e=>c({command:`alerting silences update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf alerting silences update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/alerting/v3/silences`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(He,{body:t,account_id:l}));a(n,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ge={command:`silences`,describe:`Operations for silences`,builder:e=>e.command(Ne).command(Fe).command(Re).command(Ve).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`alerting`,describe:`alerting`,builder:e=>e.command(te).command(ae).command(le).command(Ae).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ke as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as u,n as d,t as f}from"./body-parser-BKcZS9iJ.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m}from"./prompt-D0dXwuME.mjs";var h={method:`GET`,path:t=>e`/zones/${t.zone_id}/analytics/latency/colos`};function g(e){return e.usage(`$0 analytics latency colos get
|
|
3
|
-
|
|
4
|
-
Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Argo Analytics for a zone at different PoPs`,builder:g,handler:async e=>l({command:`analytics latency colos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(h,{zone_id:r}));o(a,{successLabel:`Loaded`})})},v={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`GET`,path:t=>e`/zones/${t.zone_id}/analytics/latency`,query:[`bins`]};function b(e){return e.usage(`$0 analytics latency get
|
|
5
|
-
|
|
6
|
-
Retrieves aggregate Argo Smart Routing analytics for a zone, including latency improvements, bandwidth savings, and routing statistics.`).option(`bins`,{type:`string`,description:`Bins`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Argo Analytics for a zone`,builder:b,handler:async e=>l({command:`analytics latency get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={bins:e.bins};if(e.dryRun){s({command:`cf analytics latency get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),a=await i({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a;let l=await c(`Loading`,async()=>r.send(y,{zone_id:a,...t}));o(l,{successLabel:`Loaded`})})},S={command:`latency`,describe:`Argo Smart Routing latency analytics showing time-to-first-byte improvements`,builder:e=>e.command(x).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/data-security/content-findings/top-n`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function w(e){return e.usage(`$0 analytics query data-security content-findings top-n
|
|
7
|
-
|
|
8
|
-
Returns the top N integrations ranked by total content findings.`).option(`filters`,{type:`string`,description:"Filters to apply. `findingType = content` is applied automatically for CASB data. Provide as a JSON array of objects or @path/to/file.json."}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`limit`,{type:`number`,description:`Maximum number of integrations to return.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Returns the top N integrations for content findings.`})}const T={command:`top-n`,describe:`Top integrations by content findings`,builder:w,handler:async e=>l({command:`analytics query data-security content-findings top-n`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query data-security content-findings top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/data-security/content-findings/top-n`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),n:e.limit,to:p(e.to,`to`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(C,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(e.from===void 0&&(e.from=await m(`from`,`Start of the query time range (inclusive). RFC3339.`)),e.limit===void 0)throw Error(`--limit is required (or pass --body with this field set).`);e.to===void 0&&(e.to=await m(`to`,`End of the query time range (exclusive). RFC3339.`));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),n:e.limit,to:p(e.to,`to`,`text`)}),g=await c(`Creating`,async()=>i.send(C,{body:h,account_id:l}));o(g,{successLabel:`Created`})})},E={command:`content-findings`,describe:`Operations for query.data-security.content-findings`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var D={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/data-security/findings/summary`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function O(e){return e.usage(`$0 analytics query data-security findings summary
|
|
9
|
-
|
|
10
|
-
Returns aggregate current-period and previous-period totals for CASB findings.`).option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for aggregate findings summary.`})}const k={command:`summary`,describe:`Data security findings summary`,builder:O,handler:async e=>l({command:`analytics query data-security findings summary`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query data-security findings summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/data-security/findings/summary`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),to:p(e.to,`to`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(D,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);e.from===void 0&&(e.from=await m(`from`,`Start of the query time range (inclusive). RFC3339.`)),e.to===void 0&&(e.to=await m(`to`,`End of the query time range (exclusive). RFC3339.`));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),to:p(e.to,`to`,`text`)}),g=await c(`Creating`,async()=>i.send(D,{body:h,account_id:l}));o(g,{successLabel:`Created`})})};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/data-security/findings/timeseries`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function j(e){return e.usage(`$0 analytics query data-security findings timeseries
|
|
11
|
-
|
|
12
|
-
Returns merged time-bucketed CASB findings.`).option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for findings timeseries.`})}const M={command:`timeseries`,describe:`Data security findings timeseries`,builder:j,handler:async e=>l({command:`analytics query data-security findings timeseries`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query data-security findings timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/data-security/findings/timeseries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),to:p(e.to,`to`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(A,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);e.from===void 0&&(e.from=await m(`from`,`Start of the query time range (inclusive). RFC3339.`)),e.to===void 0&&(e.to=await m(`to`,`End of the query time range (exclusive). RFC3339.`));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),to:p(e.to,`to`,`text`)}),g=await c(`Creating`,async()=>i.send(A,{body:h,account_id:l}));o(g,{successLabel:`Created`})})},N={command:`findings`,describe:`Operations for query.data-security.findings`,builder:e=>e.command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`data-security`,describe:`Operations for query.data-security`,builder:e=>e.command(E).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/${t.dataset}/summary`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function I(e){return e.usage(`$0 analytics query summary <dataset>
|
|
13
|
-
|
|
14
|
-
Returns aggregate summary stats for a dataset. Includes current-period and previous-period totals for trend comparison.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).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 L={command:`summary <dataset>`,describe:`Query analytics summary`,builder:I,handler:async e=>l({command:`analytics query summary`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/${e.dataset==null?`<dataset>`:encodeURIComponent(String(e.dataset))}/summary`,pathParams:{dataset:String(e.dataset??``)},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(F,{body:t,account_id:l,dataset:e.dataset}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(e.from===void 0&&(e.from=await m(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),e[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(e.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);e.to===void 0&&(e.to=await m(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`)}),g=await c(`Creating`,async()=>i.send(F,{body:h,account_id:l,dataset:e.dataset}));o(g,{successLabel:`Created`})})};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/${t.dataset}/timeseries`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function z(e){return e.usage("$0 analytics query timeseries <dataset>\n\nReturns time-bucketed analytics data for a dataset. Includes time slots, each containing the requested stats, group-by dimensions, and resolution-controlled bucket size (e.g. `hour`, `day`).").positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`resolution`,{type:`string`,description:`Time bucket size for grouping results. Controls the granularity of the returned time slots.
|
|
15
|
-
`}).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:`timeseries <dataset>`,describe:`Query analytics timeseries`,builder:z,handler:async e=>l({command:`analytics query timeseries`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/${e.dataset==null?`<dataset>`:encodeURIComponent(String(e.dataset))}/timeseries`,pathParams:{dataset:String(e.dataset??``)},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`),resolution:p(e.resolution,`resolution`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(R,{body:t,account_id:l,dataset:e.dataset}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(e.from===void 0&&(e.from=await m(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),e[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(e.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);e.to===void 0&&(e.to=await m(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),e.resolution===void 0&&(e.resolution=await m(`resolution`,`Time bucket size for grouping results. Controls the granularity of the returned time slots. `));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`),resolution:p(e.resolution,`resolution`,`text`)}),g=await c(`Creating`,async()=>i.send(R,{body:h,account_id:l,dataset:e.dataset}));o(g,{successLabel:`Created`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics/query/${t.dataset}/top-n`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function H(e){return e.usage(`$0 analytics query top-n <dataset>
|
|
16
|
-
|
|
17
|
-
Returns the top N results for a dataset by a specified stat. Includes an array of result rows, each containing the requested stats and group-by dimensions.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`limit`,{type:`number`,description:`Maximum number of results to return.`}).option(`order-by`,{type:`string`,description:`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`top-n <dataset>`,describe:`Query analytics top-N`,builder:H,handler:async e=>l({command:`analytics query top-n`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf analytics query top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics/query/${e.dataset==null?`<dataset>`:encodeURIComponent(String(e.dataset))}/top-n`,pathParams:{dataset:String(e.dataset??``)},bodyKind:`json`,body:e.body===void 0?f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`),n:e.limit,orderBy:p(e[`order-by`],`order-by`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(V,{body:t,account_id:l,dataset:e.dataset}));o(n,{successLabel:`Created`});return}if(e.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(e.from===void 0&&(e.from=await m(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),e[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(e.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);if(e.to===void 0&&(e.to=await m(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),e.limit===void 0)throw Error(`--limit is required (or pass --body with this field set).`);e[`order-by`]===void 0&&(e[`order-by`]=await m(`order-by`,`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`));let h=f({filters:u(e.filters,`filters`),from:p(e.from,`from`,`text`),groupBy:e[`group-by`],stats:e.stats,to:p(e.to,`to`,`text`),n:e.limit,orderBy:p(e[`order-by`],`order-by`,`text`)}),g=await c(`Creating`,async()=>i.send(V,{body:h,account_id:l,dataset:e.dataset}));o(g,{successLabel:`Created`})})},W={command:`query`,describe:`Operations for query`,builder:e=>e.command(L).command(B).command(U).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`analytics`,describe:`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,builder:e=>e.command(S).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";var f={method:`POST`,path:t=>e`/accounts/${t.account_id}/analytics_engine/sql`,errors:{400:`BadRequestError`,403:`ForbiddenError`,422:`UnprocessableEntityError`,429:`TooManyRequestsError`,500:`InternalServerError`,503:`ServiceUnavailableError`,504:`GatewayTimeoutError`}};function p(e){return e.usage(`$0 analytics-engine sql query
|
|
3
|
-
|
|
4
|
-
Executes a SQL query against Workers Analytics Engine data. Pass the SQL query in the request body as plain text. The response uses newline-delimited JSON (NDJSON) by default, or a single JSON object when the query includes a FORMAT JSON clause. Prefer this method for longer queries that may exceed URL length limits.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const m={command:`query`,describe:`Execute an Analytics Engine SQL query via request body`,builder:p,handler:async e=>l({command:`analytics-engine sql query`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf analytics-engine sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/analytics_engine/sql`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),p=e.local?t:await a();if(e.accountId=p,e.file){let t=d(e.file),r=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${p}/analytics_engine/sql`,{body:t,headers:{"Content-Type":`text/plain`}}));o(r,{successLabel:`Loaded`});return}if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${p}/analytics_engine/sql`,{body:t,headers:{"Content-Type":`text/plain`}}));o(r,{successLabel:`Loaded`});return}let m=await c(`Loading`,async()=>l.send(f,{account_id:p}));o(m,{successLabel:`Loaded`})})},h={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`analytics-engine`,describe:`analytics-engine`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
package/dist/api-X3wKppsT.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
function e(e){return{headers:e.headers,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url}}const t={headers:new Headers,redirected:!1,status:499,statusText:`Client Closed Request`,type:`error`,url:``},n={headers:new Headers,redirected:!1,status:0,statusText:`Unknown Error`,type:`error`,url:``};function r({message:e,statusCode:t,body:n}){let r=[];return e!=null&&r.push(e),t!=null&&r.push(`Status code: ${t.toString()}`),n!=null&&r.push(`Body: ${JSON.stringify(n,void 0,2)}`),r.join(`
|
|
3
|
-
`)}var i=class extends Error{statusCode;body;rawResponse;constructor(e){super(r(e)),Object.setPrototypeOf(this,new.target.prototype),this.name=`ApiError`,this.statusCode=e.statusCode,this.body=e.body,this.rawResponse=e.rawResponse,e.cause!==void 0&&e.cause!==null&&Object.defineProperty(this,"cause",{value:e.cause,writable:!0,configurable:!0})}get requestId(){return this.rawResponse?.headers?.get(`x-request-id`)??void 0}},a=class extends i{constructor(e,t){super({message:e,cause:t?.cause}),Object.setPrototypeOf(this,new.target.prototype),this.name=`ApiTimeoutError`}};function o(e,t,n,r){let a=new i({message:e,statusCode:t,body:n,rawResponse:r});return a.name=e,a}function s(e){if(!e)return e;let t=+!!e.startsWith(`/`),n=e.endsWith(`/`)?e.length-1:e.length;return t===0&&n===e.length?e:e.slice(t,n)}function c(e,t){return e.endsWith(`/`)?e+t:`${e}/${t}`}function l(e,t){let n=e;for(let e of t){let t=s(e);t&&(n=c(n,t))}return t.at(-1)?.endsWith(`/`)&&!n.endsWith(`/`)&&(n+=`/`),n}function u(e,...t){if(!e)return``;if(t.length===0)return e;if(!e.includes(`://`))return l(e,t);let n;try{n=new URL(e)}catch{return l(e,t)}for(let e of t){let t=s(e);t&&(n.pathname=c(n.pathname,t))}return t.at(-1)?.endsWith(`/`)&&!n.pathname.endsWith(`/`)&&(n.pathname+=`/`),n.toString()}function d(e){return e==null?``:encodeURIComponent(String(e))}function f(e,t,n){let r=[];for(let[i,a]of Object.entries(e)){let e=t?`${t}[${i}]`:i;if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;if(n){let t=a.filter(e=>e!=null).map(d);t.length>0&&r.push(`${encodeURIComponent(e)}=${t.join(`,`)}`);continue}for(let t of a)t!=null&&(typeof t==`object`&&!Array.isArray(t)?r.push(...f(t,e,n)):r.push(`${encodeURIComponent(e)}=${d(t)}`))}else if(typeof a==`object`){if(Object.keys(a).length===0)continue;r.push(...f(a,e,n))}else r.push(`${encodeURIComponent(e)}=${d(a)}`)}}return r}function p(e,t=[]){let n=/* @__PURE__ */ new Map;for(let[t,r]of e){if(r==null)continue;let e=f({[t]:r},``,!1).join(`&`);e.length>0&&n.set(t,e)}for(let[r,i]of e){if(!t.includes(r)||i==null)continue;let e=f({[r]:i},``,!0).join(`&`);e.length>0&&n.set(r,e)}return[...n.values()].join(`&`)}function m(t,n){if(typeof t!=`object`||!t||Array.isArray(t)||!(`success`in t))return t;let r=e=>Reflect.get(t,e);if(r(`success`)===!1){let a=r(`errors`),o=(Array.isArray(a)?a:[]).map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`&&`message`in e){let t=Reflect.get(e,`message`);return typeof t==`string`?t:void 0}}).filter(e=>typeof e==`string`&&e.length>0).join(`, `)||`Cloudflare API request failed`,s=new i({message:o,statusCode:n?.ok===!1?n.status:void 0,body:t,rawResponse:n?e(n):void 0});throw s.name=`ApiEnvelopeError`,s.message=o,s}if(!(`result`in t))return t;let a=r(`result`);return Array.isArray(a)?{result:a,result_info:r(`result_info`)}:a}function h(e){let t={get bodyUsed(){return e.bodyUsed},stream:()=>e.body,arrayBuffer:e.arrayBuffer.bind(e),blob:e.blob.bind(e)};return`bytes`in e&&typeof e.bytes==`function`&&(t.bytes=e.bytes.bind(e)),t}async function g(e,t){if(t===`binary-response`)return h(e);if(t===`text`)return await e.text();let n=await e.text();if(n.length===0)return;let r;try{r=JSON.parse(n)}catch{return{ok:!1,error:{reason:`non-json`,statusCode:e.status,rawBody:n}}}return m(r,e)}const _=/* @__PURE__ */ new Set([`application/hal+json`,`application/json`,`application/ld+json`,`application/problem+json`,`application/vnd.api+json`,`text/json`]);async function v(e){let t=e.headers.get(`Content-Type`)?.toLowerCase();if(t==null||t.length===0)return g(e);if(t.includes(`;`)&&(t=t.split(`;`)[0]?.trim()??``),_.has(t)||t.startsWith(`application/vnd.`)&&t.endsWith(`+json`)){let t=await e.text();return t.length>0?JSON.parse(t):void 0}return await e.text()}function y(e){let t=new AbortController;for(let n of e)if(n.aborted||(n.addEventListener(`abort`,()=>t.abort(n.reason),{signal:t.signal}),n.aborted))return t.abort(n.reason),t.signal;return t.signal}async function b(e,t,n,r,i){let a=[],o;if(r!==void 0){let e=new AbortController;o=setTimeout(()=>e.abort(`timeout`),r),a.push(e.signal)}i!==void 0&&a.push(i);try{return await e(t,{...n,signal:y(a)})}finally{o!==void 0&&clearTimeout(o)}}const x=[408,429,502,503,504];function S(e,t){let n=e.headers.get(`Retry-After`);if(n){let e=parseInt(n,10);if(!Number.isNaN(e)&&e>0)return Math.min(e*1e3,6e4);let t=new Date(n);if(!Number.isNaN(t.getTime())){let e=t.getTime()-Date.now();if(e>0)return Math.min(e,6e4)}}let r=e.headers.get(`X-RateLimit-Reset`);if(r){let e=parseInt(r,10);if(!Number.isNaN(e)){let t=e*1e3-Date.now();if(t>0)return Math.min(t,6e4)*(1+Math.random()*.2)}}return Math.min(1e3*2**t,6e4)*(1+(Math.random()-.5)*.2)}async function C(e,t,n,r){let i=await b(e,t,n,r.timeoutMs,r.signal);for(let a=0;a<(r.maxRetries??2)&&x.includes(i.status);a++)await new Promise(e=>setTimeout(e,S(i,a))),i=await b(e,t,n,r.timeoutMs,r.signal);return i}function w(...e){let t={};for(let n of e)if(n!=null)for(let[e,r]of Object.entries(n)){let n=e.toLowerCase();r==null?n in t&&delete t[n]:t[n]=r}return t}var T=class{#e;constructor(e){this.#e=e}get baseUrl(){return this.#e.baseUrl}async#t(){return(await this.#e.auth?.())?.headers??{}}async send(r,s={},c){let l=new Set(r.pathParams),d=r.path(s),f=d.replace(/^\//,``),m=[];for(let e of r.query??[])l.add(e),m.push([e,s[e]]);let h={};for(let e of r.headers??[])l.add(e),h[e]=s[e];let _,y;if(r.body===`json`){_=s.body;let e=typeof _==`object`&&!!_&&!Array.isArray(_);r.constants!==void 0&&(_===void 0||e)&&(_={..._,...r.constants})}else if(r.body===`form`){y=new FormData;for(let[e,t]of Object.entries(s))!l.has(e)&&t!=null&&y.append(e,typeof t==`object`?JSON.stringify(t):String(t))}let b=u(this.#e.baseUrl,f),x=p(m,r.joined),S=new Headers;S.set(`Accept`,r.response===`text`?`text/plain`:`*/*`),_!==void 0&&r.body!==`form`&&S.set(`Content-Type`,r.contentType??`application/json`);let T=w(await this.#t(),this.#e.headers,Object.fromEntries(Object.entries(h).filter(([,e])=>e!=null)),c?.headers);for(let[e,t]of Object.entries(T))S.set(e,typeof t==`string`?t:`${t}`);let E={method:r.method,headers:S};y===void 0?_!==void 0&&(E.body=JSON.stringify(_)):(E.body=y,E.duplex=`half`);let D=c?.timeoutInSeconds??this.#e.timeoutInSeconds??60,O=c?.abortSignal,k;try{let t=await C(this.#e.fetch??fetch,x?`${b}?${x}`:b,E,{timeoutMs:D*1e3,signal:O,maxRetries:c?.maxRetries??this.#e.maxRetries}),n=e(t);if(t.status<200||t.status>=400){let e=await v(t),a=r.errors?.[String(t.status)];throw a===void 0?new i({statusCode:t.status,body:e,rawResponse:n}):o(a,t.status,e,n)}k=await g(t,r.response===!1?void 0:r.response)}catch(e){throw e instanceof i?e:O?.aborted?new i({message:`The user aborted a request`,rawResponse:t,cause:e}):e instanceof Error&&e.name===`AbortError`?new a(`Timeout exceeded when calling ${r.method} ${d}.`,{cause:e}):new i({message:e instanceof Error?e.message:JSON.stringify(e),rawResponse:n,cause:e})}if(r.response!==!1)return k}async fetch(e,t,n){let r=e instanceof URL?e.toString():e,i=r.startsWith(`http://`)||r.startsWith(`https://`)?r:u(this.#e.baseUrl,r),a={};for(let[e,t]of Object.entries(this.#e.headers??{}))t!=null&&(a[e.toLowerCase()]=`${t}`);for(let[e,t]of Object.entries(await this.#t()))a[e.toLowerCase()]=t;if(t?.headers!==void 0&&t.headers!==null){let e=t.headers instanceof Headers?Object.fromEntries(t.headers.entries()):Array.isArray(t.headers)?Object.fromEntries(t.headers):t.headers;for(let[t,n]of Object.entries(e))n!=null&&(a[t.toLowerCase()]=n)}for(let[e,t]of Object.entries(n?.headers??{}))a[e.toLowerCase()]=t;let o=n?.timeoutInSeconds??this.#e.timeoutInSeconds,s={method:t?.method??`GET`,headers:a};return t?.body!==void 0&&t.body!==null&&(s.body=t.body),C(this.#e.fetch??fetch,i,s,{timeoutMs:o===void 0?void 0:o*1e3,signal:n?.abortSignal??t?.signal??void 0,maxRetries:n?.maxRetries??this.#e.maxRetries})}};export{i as n,T as t};
|
package/dist/argo-D1VONzu-.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{i as p}from"./prompt-D0dXwuME.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/argo/count_zones_enabled`};function h(e){return e.usage(`$0 argo smart-routing count-zones-enabled-for-account
|
|
3
|
-
|
|
4
|
-
Returns the number of zones that have Argo Smart Routing enabled for the specified account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`count-zones-enabled-for-account`,describe:`Get count of zones with Argo Smart Routing enabled for account`,builder:h,handler:async e=>l({command:`argo smart-routing count-zones-enabled-for-account`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf argo smart-routing count-zones-enabled-for-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/argo/count_zones_enabled`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(m,{account_id:l}));o(u,{successLabel:`Loaded`})})};var _={method:`GET`,path:()=>`/user/argo/count_zones_enabled`};function v(e){return e.usage(`$0 argo smart-routing count-zones-enabled-for-user
|
|
5
|
-
|
|
6
|
-
Returns the number of zones that have Argo Smart Routing enabled for the authenticated user.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`count-zones-enabled-for-user`,describe:`Get count of zones with Argo Smart Routing enabled for user`,builder:v,handler:async e=>l({command:`argo smart-routing count-zones-enabled-for-user`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf argo smart-routing count-zones-enabled-for-user`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/argo/count_zones_enabled`,pathParams:{},bodyKind:`none`});return}let t=await n(e),r=await c(`Loading`,async()=>t.send(_));o(r,{successLabel:`Loaded`})})};var b={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/argo/smart_routing`,body:`json`};function x(e){return e.usage(`$0 argo smart-routing edit
|
|
7
|
-
|
|
8
|
-
Configures the value of the Argo Smart Routing enablement setting.`).option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).coerce(`value`,e=>f(e,`value`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const S={command:`edit`,describe:`Patch Argo Smart Routing setting`,builder:x,handler:async e=>l({command:`argo smart-routing edit`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({value:e.value}):u(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=u(e.body),i=await c(`Updating`,async()=>t.send(b,{body:n,zone_id:r}));o(i,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await p(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let a=d({value:e.value}),l=await c(`Updating`,async()=>t.send(b,{body:a,zone_id:r}));o(l,{successLabel:`Updated`})})};var C={method:`GET`,path:t=>e`/zones/${t.zone_id}/argo/smart_routing`};function w(e){return e.usage(`$0 argo smart-routing get
|
|
9
|
-
|
|
10
|
-
Retrieves the value of Argo Smart Routing enablement setting.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Get Argo Smart Routing setting`,builder:w,handler:async e=>l({command:`argo smart-routing get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf argo smart-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(C,{zone_id:r}));o(a,{successLabel:`Loaded`})})},E={command:`smart-routing`,describe:`Route traffic through the fastest network paths to your origin using real-time latency data`,builder:e=>e.command(g).command(y).command(S).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var D={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/argo/tiered_caching`,body:`json`};function O(e){return e.usage(`$0 argo tiered-caching edit
|
|
11
|
-
|
|
12
|
-
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`).option(`value`,{type:`string`,description:`Enables Tiered Caching.`,choices:[`on`,`off`]}).coerce(`value`,e=>f(e,`value`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Tiered Caching.`})}const k={command:`edit`,describe:`Patch Tiered Caching setting`,builder:O,handler:async e=>l({command:`argo tiered-caching edit`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf argo tiered-caching edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({value:e.value}):u(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=u(e.body),i=await c(`Updating`,async()=>t.send(D,{body:n,zone_id:r}));o(i,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await p(`value`,`Enables Tiered Caching.`,[`on`,`off`]));let a=d({value:e.value}),l=await c(`Updating`,async()=>t.send(D,{body:a,zone_id:r}));o(l,{successLabel:`Updated`})})};var A={method:`GET`,path:t=>e`/zones/${t.zone_id}/argo/tiered_caching`};function j(e){return e.usage(`$0 argo tiered-caching get
|
|
13
|
-
|
|
14
|
-
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Get Tiered Caching setting`,builder:j,handler:async e=>l({command:`argo tiered-caching get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf argo tiered-caching get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(A,{zone_id:r}));o(a,{successLabel:`Loaded`})})},N={command:`tiered-caching`,describe:`Reduce origin load by having upper-tier data centers serve cache misses before reaching your origin`,builder:e=>e.command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`argo`,describe:`Network optimization features that speed up and improve reliability of traffic to your origins`,builder:e=>e.command(E).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|
package/dist/auth-CspwoBlp.mjs
DELETED
package/dist/auth-D499YE2n.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./agent-context-Dtyy4aKL.mjs";import{c as n}from"./chunk-SOBRPAPT-BKzUiNx_.mjs";import{i as r}from"./blocks-C8vyXIAT.mjs";import"./ui-FYultowZ.mjs";import{t as i}from"./cf-hP0SOgC6.mjs";import{t as a}from"./log-BWdaOGOW.mjs";import{d as o,f as s,i as c,r as l,t as u}from"./oauth-BmSFLp_s.mjs";import{t as d}from"./auth-token-BwpERbnG.mjs";import{t as f}from"./output-BJEgbI0G.mjs";import{n as p}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as m,o as h,s as g}from"./schema-cache-BIo0Gi2H.mjs";import{a as _,c as v,i as y,n as b,o as x,r as S,s as C,t as w}from"./login-BJHaTERg.mjs";const T={command:`logout`,describe:`Log out and remove stored credentials`,handler:async t=>{y(t,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let n=l();n!=="default"&&a.warn(`This directory has profile "${n}" active. ${e.code(`cf auth logout`)} removes the default profile's token, not "${n}". To delete "${n}", run:`,`cf auth delete ${n}`),await o(`default`)}},E=`oauth-scopes`;function D(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let{id:e,name:r,category:i}=n??{};typeof e==`string`&&t.push({id:e,name:typeof r==`string`?r:e,...typeof i==`string`&&{category:i}})}return t.length>0?t:void 0}function O(e){return new Map(e.map(e=>[e.id,e]))}async function k(e){let t=h(E,[],864e5,D);if(t)return O(t);let[n,{default:r}]=await Promise.all([e(),import(`./list-4MfEFwJN.mjs`)]),i=await n.send(r),a=D(typeof i==`object`&&i&&`result`in i?i.result:i);if(!a)throw Error(`the API returned an unexpected scope catalogue`);return g(E,[],a),O(a)}const A={account_and_billing:`Account & Billing`,ai_and_machine_learning:`AI & Machine Learning`,analytics_and_logs:`Analytics & Logs`,app_security:`App Security`,cache_and_performance:`Cache & Performance`,cloudflare_one_and_zero_trust:`Cloudflare One / Zero Trust`,developer_platform:`Developer Platform`,dns_and_zones:`DNS & Zones`,email_and_messaging:`Email & Messaging`,media:`Media`,network_services:`Network Services`,other:`Other`,rules_and_configuration:`Rules & Configuration`},j=`Uncategorized`,M=[`Other`,j],N=new Set(i),P=/* @__PURE__ */ new Set([`read`,`metadata_read`]),F=/^(.+)([.:])([^.:]+)$/;function I(e){return A[e]??e.split(`_`).map(e=>e===`and`?`&`:e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function L(e,t){return M.indexOf(e)-M.indexOf(t)||e.localeCompare(t)}function R(e){return e.some(e=>F.test(e))}function z(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=F.exec(r);if(!e?.[1]||!e[3])continue;let i=t.get(r),a=i?.category?I(i.category):j,o=n.get(a)??[];o.push({scope:r,resource:e[1],action:e[3]}),n.set(a,o)}return n}function B(e,t,n){let r=t.get(e)??[],i=n.get(e)?.length??0,a=r.filter(({scope:e})=>N.has(e)).length,o=r.length-a,s=i>0?[`${a}/${i}`]:[];return o>0&&s.push(`${o} custom`),s.join(` + `)}function V(t,n){let r=z(t,n),a=z(i,n),o=[...r.keys()].sort(L);if(o.length===0)return``;let s=Math.max(...o.map(e=>e.length));return o.map(t=>`${e.bold(e.info(t.padEnd(s)))} ${e.muted(B(t,r,a))}`).join(`
|
|
3
|
-
`)}const H=e=>` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `)}`,U=e=>e.toLowerCase().replaceAll(`_`,`-`);function W(e,t){return H(e).includes(H(t).trimEnd())}function G(e){let t=/* @__PURE__ */ new Set([j]);for(let{category:n}of e.values())n&&t.add(I(n));return[...t].sort(L)}function K(t,n,{product:r=``,filter:a=``}={}){let o=z(t,n),s=z(i,n),c=[];for(let t of[...o.keys()].sort(L)){if(!W(t,r))continue;let n=(o.get(t)??[]).filter(({scope:e})=>U(e).includes(U(a)));if(n.length===0)continue;let i=[`${e.bold(e.info(t))} ${e.muted(`(${B(t,o,s)})`)}`],l=/* @__PURE__ */ new Map,u=[...n].sort((e,t)=>Number(!P.has(e.action))-Number(!P.has(t.action))||e.action.localeCompare(t.action));for(let{scope:t,resource:n,action:r}of u){let i=(P.has(r)?e.muted(r):e.warning(r))+(N.has(t)?``:e.muted(` (custom)`));l.set(n,(l.get(n)??/* @__PURE__ */ new Set).add(i))}let d=Math.max(...[...l.keys()].map(e=>e.length));for(let[e,t]of[...l].sort(([e],[t])=>e.localeCompare(t)))i.push(` ${e.padEnd(d)} ${[...t].join(`, `)}`);c.push(i.join(`
|
|
4
|
-
`))}return c.join(`
|
|
5
|
-
|
|
6
|
-
`)}function q(e){let t=l();return t==="default"?e?`cf auth login --force`:`cf auth login`:`cf auth create ${t}`}function J(t){let n=t?.statusCode;return n===401||n===403?`your login was rejected; run ${e.code(q(!0))} to log in again`:m(t)}const Y={command:`scopes [product]`,describe:`Show the OAuth scopes granted to the current login, by product`,builder:e=>e.positional(`product`,{type:`string`,description:`Show the granted permissions in product areas matching this name, such as dns or developer`}).option(`all`,{type:`boolean`,description:`Show every granted permission, grouped by product`,default:!1}).option(`filter`,{type:`string`,description:`Show the granted permissions whose scope contains this term`}),handler:async t=>{if(t[`temporary-account`]||t[`event-code`]!==void 0)throw Error(`--temporary-account and --event-code are not supported by cf auth scopes.`);if(n({allowGlobalAuthKey:!1})!==void 0){a.warn(`${e.code(`CLOUDFLARE_API_TOKEN`)} is set, so its own permissions apply rather than OAuth scopes.`);return}let r=s();if(r?.oauth_token===void 0){a.info(`Not logged in. Run ${e.code(q(!1))} to log in.`);return}let{scopes:i}=r;if(!i){a.info(`This login didn't record its scopes. Run ${e.code(q(!0))} to log in again.`);return}if(!R(i)){a.info(`No product scopes granted. Run ${e.code(q(!0))} to log in with the default scopes.`);return}let o;try{o=await k(async()=>{let{createCommandClient:e}=await import(`./auth-CspwoBlp.mjs`);return e(t)})}catch(e){a.warn(`Couldn't load Cloudflare's scope catalogue (${J(e)}), so scopes are listed without product groups.`),console.log(i.join(`
|
|
7
|
-
`));return}if(t.product===void 0&&!t.all&&t.filter===void 0){console.log(V(i,o)),a.info(`Run ${e.code(`cf auth scopes <product>`)} to see a product's permissions, or ${e.code(`cf auth scopes --all`)} for every granted product.`);return}let{product:c}=t;c!==void 0&&!G(o).some(e=>W(e,c))?a.info(`No product area matches "${c}". Run ${e.code(`cf auth scopes --filter ${c}`)} to search scope names instead.`):console.log(K(i,o,{product:t.product,filter:t.filter})||e.muted(`No granted scopes match.`))}},X={command:`whoami`,describe:`Show current user and authentication status`,handler:async e=>{if(e[`temporary-account`]||e[`event-code`]!==void 0)throw Error(`--temporary-account and --event-code are not supported by cf auth whoami.`);let n=process.env.CLOUDFLARE_API_TOKEN,i=s(),a;a=n?`CLOUDFLARE_API_TOKEN environment variable`:i?.oauth_token?`OAuth token from ${c()}`:`none`;let o;try{o=await d()}catch{f({authenticated:!1,error:`Not logged in`}),a===`none`&&t().isAgentic&&console.error(r('Ask the user: "I can put this online for 60 minutes without you signing in. To keep it, complete the temporary-account claim before it expires. Would you like me to deploy it that way?" (https://developers.cloudflare.com/workers/platform/claim-deployments/) If they agree, run `cf deploy --temporary-account`.'));return}let{createCloudflareClientWithToken:l}=await import(`./auth-CspwoBlp.mjs`),{default:p}=await import(`./get-BTisquA3.mjs`),m=l({apiToken:o}),h,g=[],[_,v]=await Promise.allSettled([m.send(p),u()]);if(_.status===`fulfilled`){let e=_.value;e&&`email`in e&&typeof e.email==`string`&&(h=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,_.reason);v.status===`fulfilled`?g=v.value:process.env.DEBUG&&console.error(`Account lookup error:`,v.reason);let y=_.status===`fulfilled`||v.status===`fulfilled`,b={authenticated:!0,authSource:a,tokenValid:y,...h&&{email:h},accounts:g};i?.oauth_token&&(b.scopes=i.scopes,b.expiresAt=i.expiration_time),f(b)}},Z={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(p(w,{command:`auth login`,classification:b})).command(Q(T,`auth logout`)).command(Q(X,`auth whoami`)).command(Q(Y,`auth scopes`,[`all`])).command(Q(_,`auth create`,[`browser`,`device`])).command(Q(C,`auth delete`)).command(Q(S,`auth activate`)).command(Q(x,`auth deactivate`)).command(Q(v,`auth list`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e,t,n=[],r){return p(e,{command:t,classification:{safeFlags:n,shortFlagAliases:r}})}export{Z as default};
|
package/dist/auth-FK2eLQ02.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{K as e}from"./dist-D5qkmHhC.mjs";import{n as t,t as n}from"./api-X3wKppsT.mjs";import{a as r,n as i}from"./context-Dp4CXG22.mjs";import{l as a}from"./oauth-BmSFLp_s.mjs";import{t as o}from"./auth-token-BwpERbnG.mjs";import{n as s}from"./request-headers-CoxHUNcB.mjs";const c=6e4;function l(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream}var u={method:`GET`,path:()=>`/accounts`,query:[`name`,`page`,`per_page`,`direction`]},d={method:`GET`,path:()=>`/memberships`,query:[`account.name`,`page`,`per_page`,`order`,`direction`,`name`,`status`]};function f(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function p(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function m(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function h(e,t,n){if(n!=null&&n!==``){if(Array.isArray(n))for(let r of n)h(e,t,r);else e.append(t,String(n))}}function g(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))h(t,n,r);return t.toString()}function _(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=g(n??{});return a&&(i.search=a),i.toString()}const v=/* @__PURE__ */ new WeakMap,y=/* @__PURE__ */ new WeakMap;async function b(e,n,r,i={}){let a=e.baseUrl,o=_(r,a,i.query),s={...i.headers},c;i.body!==void 0&&(f(i.body)||typeof i.body==`string`&&p(s)?c=i.body:(s[`Content-Type`]??=`application/json`,c=JSON.stringify(i.body)));let u=i.timeout===void 0&&l(c)?y.get(e):void 0,d=i.timeout??v.get(e)??6e4,h;try{h=await(u??e).fetch(o,{method:n,headers:s,body:c,signal:i.signal},{timeoutInSeconds:i.timeout===void 0?void 0:i.timeout/1e3,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e===`timeout`||e instanceof Error&&e.name===`AbortError`?Error(u?`Request timed out`:`Request timed out after ${d}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!h.ok)throw new t({statusCode:h.status,body:await m(h),rawResponse:{status:h.status,statusText:h.statusText,url:h.url||o,headers:h.headers,redirected:h.redirected,type:h.type}});if(h.status===204)return null;let g=h.headers.get(`content-type`)??``;if(!g.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await h.arrayBuffer());let b=await h.text();if(b===``)return null;if(!g.includes(`application/json`))return b;let x=JSON.parse(b);if(x.success===!1){let e=x.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`;throw new t({message:`API error: ${e}`,statusCode:h.status,body:x})}return`result`in x?x.result:x}function x(e){let t={baseUrl:e.baseURL??`https://api.cloudflare.com/client/v4`,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??6e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch},r=new n(t);return v.set(r,e.timeout??6e4),e.timeout===void 0&&y.set(r,new n({...t,timeoutInSeconds:void 0})),r}async function S(t){if(a())return;let n=await r();if(n)return n;try{let n=await o(),r=e({compliance_region:await i()}),a=t-Date.now();if(a<=0)return;let c=x({apiToken:n,baseURL:r,defaultHeaders:s()}),l={timeoutInSeconds:a/1e3,maxRetries:0},[f,p]=await Promise.allSettled([c.send(u,{per_page:50},l),c.send(d,{per_page:50},l)]);if(f.status===`rejected`)return;let m=f.value;if((m.result_info?.total_count??m.result.length)>m.result.length)return;let h=m.result;if(p.status===`fulfilled`){let e=p.value.result??[];if((p.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));h=h.filter(e=>t.has(e.id))}return h.length===1?h[0]?.id:void 0}catch{return}}async function C(t){if(t.dryRun&&a())throw Error(`This command's dry run cannot be used with --temporary-account. Remove --dry-run to run the command for real.`);let n=e({compliance_region:await i()});if(t.local){let{createLocalFetch:e}=await import(`./local-CFsO9Tkg.mjs`);return x({apiToken:`cf-local-mode-no-auth`,baseURL:n,defaultHeaders:s(),fetch:e({persistTo:t.persistTo,apiBaseUrl:n})})}return x({apiToken:await o(),baseURL:n,defaultHeaders:s()})}export{S as a,l as c,b as i,c as l,C as n,d as o,g as r,u as s,x as t};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as u,n as d,s as f,t as p}from"./body-parser-BKcZS9iJ.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-D0dXwuME.mjs";var v={method:`POST`,path:()=>`/billing/address-validation`,body:`json`};function y(e){return e.usage(`$0 billing addresses validate
|
|
3
|
-
|
|
4
|
-
Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.`).option(`address`,{type:`string`,description:`Address line 1.`}).option(`address2`,{type:`string`,description:`Address line 2.`}).option(`city`,{type:`string`,description:`City.`}).option(`country`,{type:`string`,description:`Country code.`}).option(`state`,{type:`string`,description:`State or province.`}).option(`zipcode`,{type:`string`,description:`Postal or zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`validate`,describe:`Validate Billing Address`,builder:y,handler:async e=>l({command:`billing addresses validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf billing addresses validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/billing/address-validation`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),city:m(e.city,`city`,`text`),country:m(e.country,`country`,`text`),state:m(e.state,`state`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}):d(e.body)});return}let t=await r(e);if(e.body){let n=d(e.body),r=await c(`Validating`,async()=>t.send(v,{body:n}));o(r,{successLabel:`Validated`});return}let n=p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),city:m(e.city,`city`,`text`),country:m(e.country,`country`,`text`),state:m(e.state,`state`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}),i=await c(`Validating`,async()=>t.send(v,{body:n}));o(i,{successLabel:`Validated`})})},b={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/billing/profile/payment-method`};function S(e){return e.usage(`$0 billing profiles create-payment-intent
|
|
5
|
-
|
|
6
|
-
Creates a Stripe payment intent for adding or updating a payment method on the account's billing profile. Returns a client secret for frontend payment method collection.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`create-payment-intent`,describe:`Create Payment Intent for Billing Profile`,builder:S,handler:async e=>l({command:`billing profiles create-payment-intent`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf billing profiles create-payment-intent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile/payment-method`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Creating`,async()=>n.send(x,{account_id:l}));o(u,{successLabel:`Created`})})};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function w(e){return e.usage(`$0 billing profiles create
|
|
7
|
-
|
|
8
|
-
Creates a billing profile for an account.`).option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const T={command:`create`,describe:`Create Billing Profile`,builder:w,handler:async e=>l({command:`billing profiles create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),billing_email:m(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:m(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:m(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:m(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:m(e.city,`city`,`text`),company:m(e.company,`company`,`text`),country:m(e.country,`country`,`text`),first_name:m(e[`first-name`],`first-name`,`text`),h_captcha_response:m(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:m(e[`last-name`],`last-name`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:m(e.state,`state`,`text`),tax_id_type:m(e[`tax-id-type`],`tax-id-type`,`text`),telephone:m(e.telephone,`telephone`,`text`),vat:m(e.vat,`vat`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(C,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let u=p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),billing_email:m(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:m(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:m(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:m(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:m(e.city,`city`,`text`),company:m(e.company,`company`,`text`),country:m(e.country,`country`,`text`),first_name:m(e[`first-name`],`first-name`,`text`),h_captcha_response:m(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:m(e[`last-name`],`last-name`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:m(e.state,`state`,`text`),tax_id_type:m(e[`tax-id-type`],`tax-id-type`,`text`),telephone:m(e.telephone,`telephone`,`text`),vat:m(e.vat,`vat`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}),f=await c(`Creating`,async()=>n.send(C,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var E={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/billing/profile`,response:!1};function D(e){return e.usage(`$0 billing profiles delete
|
|
9
|
-
|
|
10
|
-
Deletes the billing profile for an account.`).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`,describe:`Delete Billing Profile`,builder:D,handler:async e=>l({command:`billing profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf billing profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>n.send(E,{account_id:l}));o(u,{successLabel:`Deleted`})})};var k={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/profile`};function A(e){return e.usage(`$0 billing profiles get
|
|
11
|
-
|
|
12
|
-
Gets the current billing profile for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get`,describe:`Get Billing Profile`,builder:A,handler:async e=>l({command:`billing profiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf billing profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(k,{account_id:l}));o(u,{successLabel:`Loaded`})})};var M={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function N(e){return e.usage(`$0 billing profiles update-email
|
|
13
|
-
|
|
14
|
-
Updates the billing email addresses and preferred locale for an account.`).option(`billing-email`,{type:`string`,description:`The billing_email field`}).option(`preferred-locale`,{type:`string`,description:`The preferred_locale field`}).option(`secondary-billing-email`,{type:`string`,description:`The secondary_billing_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`update-email`,describe:`Update Billing Email`,builder:N,handler:async e=>l({command:`billing profiles update-email`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing profiles update-email`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({billing_email:m(e[`billing-email`],`billing-email`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(M,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}let u=p({billing_email:m(e[`billing-email`],`billing-email`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`)}),f=await c(`Updating`,async()=>n.send(M,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})};var F={method:`PUT`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function I(e){return e.usage(`$0 billing profiles update
|
|
15
|
-
|
|
16
|
-
Updates the billing profile for an account.`).option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const L={command:`update`,describe:`Update Billing Profile`,builder:I,handler:async e=>l({command:`billing profiles update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),billing_email:m(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:m(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:m(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:m(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:m(e.city,`city`,`text`),company:m(e.company,`company`,`text`),country:m(e.country,`country`,`text`),first_name:m(e[`first-name`],`first-name`,`text`),h_captcha_response:m(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:m(e[`last-name`],`last-name`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:m(e.state,`state`,`text`),tax_id_type:m(e[`tax-id-type`],`tax-id-type`,`text`),telephone:m(e.telephone,`telephone`,`text`),vat:m(e.vat,`vat`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(F,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}let u=p({address:m(e.address,`address`,`text`),address2:m(e.address2,`address2`,`text`),billing_email:m(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:m(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:m(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:m(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:m(e.city,`city`,`text`),company:m(e.company,`company`,`text`),country:m(e.country,`country`,`text`),first_name:m(e[`first-name`],`first-name`,`text`),h_captcha_response:m(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:m(e[`last-name`],`last-name`,`text`),preferred_locale:m(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:m(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:m(e.state,`state`,`text`),tax_id_type:m(e[`tax-id-type`],`tax-id-type`,`text`),telephone:m(e.telephone,`telephone`,`text`),vat:m(e.vat,`vat`,`text`),zipcode:m(e.zipcode,`zipcode`,`text`)}),f=await c(`Updating`,async()=>n.send(F,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})},R={command:`profiles`,describe:`Billing profile with payment method, address, and invoice preferences`,builder:e=>e.command(T).command(te).command(O).command(j).command(L).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var z={method:`GET`,path:t=>e`/billing/rate_plans/${t.public_key}`};function B(e){return e.usage(`$0 billing rate-plans get <public-key>
|
|
17
|
-
|
|
18
|
-
Gets a rate plan's details by its public key (e.g., 'teams_free', 'cf_pro_20_20'). This is a public catalog endpoint, so authentication is not enforced and credentials are accepted but not required.`).positional(`public-key`,{type:`string`,description:`The public key identifier for the rate plan.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <public-key>`,describe:`Get Rate Plan by Public Key`,builder:B,handler:async e=>l({command:`billing rate-plans get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf billing rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/billing/rate_plans/${e[`public-key`]==null?`<public-key>`:encodeURIComponent(String(e[`public-key`]))}`,pathParams:{"public-key":String(e[`public-key`]??``)},bodyKind:`none`});return}let t=await r(e),n=await c(`Loading`,async()=>t.send(z,{public_key:e[`public-key`]}));o(n,{successLabel:`Loaded`})})},H={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/spend-policies/activity`,query:[`limit`,`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function W(e){return e.usage(`$0 billing spend-policies activity list
|
|
19
|
-
|
|
20
|
-
Returns configuration history from immutable policy revisions for the account, including deleted policies. Entries contain before/after values and verified actor attribution. Pages use descending revision IDs, not event or commit order; refresh the first page for new entries. This cursor is not an incremental consumer checkpoint.`).option(`limit`,{type:`number`,description:`Maximum number of audit entries to return. Defaults to 50. Values above 100 are capped at 100 rather than rejected.`}).option(`cursor`,{type:`string`,description:`Opaque token from the preceding response's result_info.cursor. Pass it unchanged to retrieve older entries.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List Spend Policy Activity`,builder:W,handler:async e=>l({command:`billing spend-policies activity list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,cursor:e.cursor};if(e.dryRun){let e=await i();s({command:`cf billing spend-policies activity list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/spend-policies/activity`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(U,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})},K={command:`activity`,describe:`Operations for spend-policies.activity`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/spend-policies/${t.policy_id}/audit`,query:[`limit`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function J(e){return e.usage("$0 billing spend-policies audit list\n\nReturns the policy's evaluation history, newest first. At most one entry is recorded per trigger (`approaching_limit` or `limit_reached`), policy version and billing period, so a policy update can record a new entry without any change in balance. Disabled policies still return their history; deleted policies return `404`. There is no pagination: use `limit` to set how many entries come back.").option(`policy-id`,{type:`string`,description:`Identifies the spend policy.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Maximum number of audit entries to return. Defaults to 50. Values above 100 are capped at 100 rather than rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List Spend Policy Audit Entries`,builder:J,handler:async e=>l({command:`billing spend-policies audit list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit};if(e.dryRun){let t=await i();s({command:`cf billing spend-policies audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/spend-policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}/audit`,pathParams:{"policy-id":String(e[`policy-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(q,{account_id:u,policy_id:e[`policy-id`],...n}));o(d,{successLabel:`Loaded`})})},X={command:`audit`,describe:`Operations for spend-policies.audit`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/billing/spend-policies`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function ne(e){return e.usage("$0 billing spend-policies create\n\nCreates a spend policy. Each account can have only one enabled `usage_block` policy per product. A second one returns `409`. There is no limit on `notification` policies.").option(`action`,{type:`string`,description:"The action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.",choices:[`notification`,`usage_block`]}).coerce(`action`,e=>m(e,`action`,`text`)).option(`enabled`,{type:`boolean`,description:`Whether the policy is evaluated.`}).option(`name`,{type:`string`,description:`Display name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.`}).option(`notification-email`,{type:`string`,description:"Email address that receives notifications. Required when `action` is `notification`. When set, it must be a bare address (`user@example.com`); display-name forms such as `Name <user@example.com>` are rejected."}).option(`product-id`,{type:`string`,description:"The product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.",choices:[`workers`,`durable_objects`]}).coerce(`product-id`,e=>m(e,`product-id`,`text`)).option(`threshold-cents`,{type:`number`,description:`The spend threshold for the current billing period, in US cents. Must be greater than zero.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A spend policy as sent on create and on full replacement. Unknown fields and trailing JSON are rejected. Only the first 1 MiB of the body is read.`})}const re={command:`create`,describe:`Create Spend Policy`,builder:ne,handler:async e=>l({command:`billing spend-policies create`,classification:{safeFlags:[`action`,`enabled`,`product-id`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing spend-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/spend-policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({action:e.action,enabled:e.enabled,name:m(e.name,`name`,`text`),notification_email:m(e[`notification-email`],`notification-email`,`text`),product_id:e[`product-id`],threshold_cents:e[`threshold-cents`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Z,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.action===void 0&&(e.action=await g(`action`,"The action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.",[`notification`,`usage_block`])),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await h(`name`,`Display name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.`)),e[`product-id`]===void 0&&(e[`product-id`]=await g(`product-id`,"The product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.",[`workers`,`durable_objects`])),e[`threshold-cents`]===void 0)throw Error(`--threshold-cents is required (or pass --body with this field set).`);let u=p({action:e.action,enabled:e.enabled,name:m(e.name,`name`,`text`),notification_email:m(e[`notification-email`],`notification-email`,`text`),product_id:e[`product-id`],threshold_cents:e[`threshold-cents`]}),f=await c(`Creating`,async()=>n.send(Z,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};function ie(e){return e.usage("$0 billing spend-policies delete <policy-id>\n\nSoft-deletes the spend policy. The policy is disabled and no longer appears in list, get or audit responses. The `If-Match` header must equal the policy's current `version`.").positional(`policy-id`,{type:`string`,description:`Identifies the spend policy.`,demandOption:!0}).option(`if-match`,{type:`string`,description:'The policy `version` the change is based on, as returned in `ETag`. Quoted (`"3"`) and bare (`3`) values are both accepted. Weak ETags (`W/"3"`) and `*` are not.',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 ae={command:`delete <policy-id>`,describe:`Delete Spend Policy`,builder:ie,handler:async e=>l({command:`billing spend-policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`if-match`]!==void 0&&(l[`If-Match`]=String(e[`if-match`])),e.dryRun){let t=await i();s({command:`cf billing spend-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/spend-policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await _({force:!!e.force}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/billing/spend-policies/${encodeURIComponent(String(e[`policy-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};var oe={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/spend-policies/${t.policy_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function se(e){return e.usage("$0 billing spend-policies get <policy-id>\n\nReturns one spend policy. The `ETag` response header holds the current `version`; send it as `If-Match` on a later update or delete.").positional(`policy-id`,{type:`string`,description:`Identifies the spend policy.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <policy-id>`,describe:`Get Spend Policy`,builder:se,handler:async e=>l({command:`billing spend-policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing spend-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/spend-policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(oe,{account_id:l,policy_id:e[`policy-id`]}));o(u,{successLabel:`Loaded`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/spend-policies`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function ue(e){return e.usage("$0 billing spend-policies list\n\nReturns every spend policy on the account that has not been deleted, including disabled ones. Results are sorted by `name`, then `id`. There is no pagination.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List Spend Policies`,builder:ue,handler:async e=>l({command:`billing spend-policies list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf billing spend-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/spend-policies`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(le,{account_id:l}));o(u,{successLabel:`Loaded`})})};function fe(e){return e.usage("$0 billing spend-policies update <policy-id>\n\nReplaces the whole spend policy. Every field is required, as on create; there are no partial updates and `PATCH` is not supported. The `If-Match` header must equal the policy's current `version`. On success, `version` goes up by one and the new value is returned in `ETag`.").positional(`policy-id`,{type:`string`,description:`Identifies the spend policy.`,demandOption:!0}).option(`if-match`,{type:`string`,description:'The policy `version` the change is based on, as returned in `ETag`. Quoted (`"3"`) and bare (`3`) values are both accepted. Weak ETags (`W/"3"`) and `*` are not.',demandOption:!0}).option(`action`,{type:`string`,description:"The action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.",choices:[`notification`,`usage_block`]}).coerce(`action`,e=>m(e,`action`,`text`)).option(`enabled`,{type:`boolean`,description:`Whether the policy is evaluated.`}).option(`name`,{type:`string`,description:`Display name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.`}).option(`notification-email`,{type:`string`,description:"Email address that receives notifications. Required when `action` is `notification`. When set, it must be a bare address (`user@example.com`); display-name forms such as `Name <user@example.com>` are rejected."}).option(`product-id`,{type:`string`,description:"The product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.",choices:[`workers`,`durable_objects`]}).coerce(`product-id`,e=>m(e,`product-id`,`text`)).option(`threshold-cents`,{type:`number`,description:`The spend threshold for the current billing period, in US cents. Must be greater than zero.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A spend policy as sent on create and on full replacement. Unknown fields and trailing JSON are rejected. Only the first 1 MiB of the body is read.`})}const pe={command:`update <policy-id>`,describe:`Update Spend Policy`,builder:fe,handler:async e=>l({command:`billing spend-policies update`,classification:{safeFlags:[`action`,`enabled`,`product-id`,`dry-run`]}},e,async()=>{let l={};if(e[`if-match`]!==void 0&&(l[`If-Match`]=String(e[`if-match`])),e.dryRun){let t=await i();s({command:`cf billing spend-policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/spend-policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({action:e.action,enabled:e.enabled,name:m(e.name,`name`,`text`),notification_email:m(e[`notification-email`],`notification-email`,`text`),product_id:e[`product-id`],threshold_cents:e[`threshold-cents`]}):d(e.body)});return}let u=await r(e),_=e.local?t:await a();if(e.accountId=_,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${_}/billing/spend-policies/${encodeURIComponent(String(e[`policy-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}if(e.action===void 0&&(e.action=await g(`action`,"The action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.",[`notification`,`usage_block`])),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await h(`name`,`Display name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.`)),e[`product-id`]===void 0&&(e[`product-id`]=await g(`product-id`,"The product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.",[`workers`,`durable_objects`])),e[`threshold-cents`]===void 0)throw Error(`--threshold-cents is required (or pass --body with this field set).`);let v={};e.action!==void 0&&f(v,[`action`],e.action),e.enabled!==void 0&&f(v,[`enabled`],e.enabled),e.name!==void 0&&f(v,[`name`],m(e.name,`name`,`text`)),e[`notification-email`]!==void 0&&f(v,[`notification_email`],m(e[`notification-email`],`notification-email`,`text`)),e[`product-id`]!==void 0&&f(v,[`product_id`],e[`product-id`]),e[`threshold-cents`]!==void 0&&f(v,[`threshold_cents`],e[`threshold-cents`]);let y=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${_}/billing/spend-policies/${encodeURIComponent(String(e[`policy-id`]))}`,{body:v,headers:Object.keys(l).length>0?l:void 0}));o(y,{successLabel:`Updated`})})},me={command:`spend-policies`,describe:`Operations for spend-policies`,builder:e=>e.command(re).command(ae).command(ce).command(de).command(pe).command(K).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var he={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable/usage/billable-metrics`,query:[`from`,`to`]};function ge(e){return e.usage("$0 billing usage get-account-billable-metrics\n\nLists billable metrics available to the account through contracts and subscriptions that overlap the requested period. Results are deduplicated and ordered. If no qualifying contract exists, the result is an empty array. When `from` and `to` are omitted, the period defaults to the start of the current month through today. The maximum date range is 31 days.").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 _e={command:`get-account-billable-metrics`,describe:`List Account Billable Metrics (Version 2, Alpha, Restricted)`,builder:ge,handler:async e=>l({command:`billing usage get-account-billable-metrics`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to};if(e.dryRun){let e=await i();s({command:`cf billing usage get-account-billable-metrics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable/usage/billable-metrics`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(he,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var ve={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable/usage`,query:[`from`,`to`]};function ye(e){return e.usage("$0 billing usage get-account-usage-v2\n\nReturns cost and usage data for a single Cloudflare account, 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. **Note:** This endpoint serves `usage` records only; cost and pricing fields are absent from responses. To retrieve rated costs, use `POST` on the same path with `Metric: cost`. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.").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 be={command:`get-account-usage-v2`,describe:`Get Account Usage (Version 2, Alpha, Restricted)`,builder:ye,handler:async e=>l({command:`billing usage get-account-usage-v2`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to};if(e.dryRun){let e=await i();s({command:`cf billing usage get-account-usage-v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable/usage`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ve,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var xe={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable-usage/info`};function Q(e){return e.usage(`$0 billing usage get-info-v1
|
|
21
|
-
|
|
22
|
-
Returns high-level usage information for the account, including coverage, and subscription metadata.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get-info-v1`,describe:`Get Account Billable Usage Info (Version 1, Alpha)`,builder:Q,handler:async e=>l({command:`billing usage get-info-v1`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf billing usage get-info-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable-usage/info`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(xe,{account_id:l}));o(u,{successLabel:`Loaded`})})};var Ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable-usage`,query:[`from`,`to`]};function we(e){return e.usage(`$0 billing usage get-v1
|
|
23
|
-
|
|
24
|
-
Returns billable usage data for the account. When no query parameters are provided, returns usage for the current billing period.`).option(`from`,{type:`string`,description:`Start date for the usage query (ISO 8601). The provided time range must include the subscription billing cycle anchor day, otherwise no usage data is returned. Use the info endpoint to retrieve the subscription anchor day.`}).option(`to`,{type:`string`,description:`End date for the usage query (ISO 8601).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get-v1`,describe:`Get Account Billable Usage (Version 1, Alpha)`,builder:we,handler:async e=>l({command:`billing usage get-v1`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to};if(e.dryRun){let e=await i();s({command:`cf billing usage get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable-usage`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Ce,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var $={method:`POST`,path:t=>e`/accounts/${t.account_id}/billable/usage`,body:`json`};function Ee(e){return e.usage("$0 billing usage query\n\nReturns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. This is the filterable counterpart to `GET` on the same path. It is a read-only operation and requires only the `#billing:read` permission; `POST` is used so that filter criteria can be supplied in a request body rather than in the query string. 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. **Note:** Cost and pricing fields are populated only when `Metric` is `cost`; otherwise they are absent from responses. The request body is optional. When it is omitted, or when `TimePeriod` is omitted, the range defaults to the start of the current month through today. The maximum date range is 31 days. Filters of different kinds are combined with AND. Values within one tag filter are combined with OR. Filter values that do not match usage produce an empty result set. Results can be grouped by up to two groups, in any combination of dimension keys and resource-tag keys. Tag groups are returned in the `Tags` field. Usage without a requested tag remains in an untagged group, with that key omitted from `Tags`. Requests that use tag filtering or tag grouping return HTTP 400 when the underlying usage data source does not support tags. Requests that use dimension grouping return HTTP 400 when the underlying usage data source does not support dimensions.").option(`filter-by-billable-metric-ids`,{type:`string`,array:!0,description:"Restrict results to rows whose `x_BillableMetricId` matches one of these billable metric ids (e.g. `workers_standard_requests`). Values must be unique."}).option(`filter-by-product-family-ids`,{type:`string`,array:!0,description:`Restrict results to billable metrics belonging to these product families. Values must be unique UUIDs.`}).option(`filter-by-tags`,{type:`string`,description:`Restrict results by resource tags. Filters for different keys are combined with AND, while values within one filter are combined with OR. Keys must be unique and are case-sensitive. Provide as a JSON array of objects or @path/to/file.json.`}).option(`group-by`,{type:`string`,description:`Grouping definitions used to split result rows. At most two unique keys may be supplied. Provide as a JSON array of objects or @path/to/file.json.`}).option(`metric`,{type:`string`,description:"Type of cost/usage records to retrieve. `usage` returns unrated usage quantities. `cost` returns rated usage with cost and pricing fields; it is available only on `POST` account usage and only when the underlying usage data source is ClickHouse (other sources return an empty result set). Requests that combine `cost` with `GroupBy` or `FilterBy.Tags` return HTTP 400. Unrelated to `FilterBy.BillableMetricIds`. Defaults to `usage` when omitted.",choices:[`usage`,`cost`],default:`usage`}).coerce(`metric`,e=>m(e,`metric`,`text`)).option(`time-period-from`,{type:`string`,description:"Start of the range (ISO 8601). Required if `To` is set."}).option(`time-period-to`,{type:`string`,description:"End of the range (ISO 8601). Required if `From` is set. Must be after `From` and no more than 31 days after it."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter criteria for a usage query. Every field is optional; an empty object is equivalent to omitting the body entirely. Unknown fields are rejected.`})}const De={command:`query`,describe:`Query Account Usage (Version 2, Alpha, Restricted)`,builder:Ee,handler:async e=>l({command:`billing usage query`,classification:{safeFlags:[`metric`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf billing usage query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billable/usage`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({FilterBy:{BillableMetricIds:e[`filter-by-billable-metric-ids`],ProductFamilyIds:e[`filter-by-product-family-ids`],Tags:u(e[`filter-by-tags`],`filter-by-tags`)},GroupBy:u(e[`group-by`],`group-by`),Metric:e.metric,TimePeriod:{From:m(e[`time-period-from`],`time-period-from`,`text`),To:m(e[`time-period-to`],`time-period-to`,`text`)}}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Loading`,async()=>n.send($,{body:t,account_id:l}));o(r,{successLabel:`Loaded`});return}let f=p({FilterBy:{BillableMetricIds:e[`filter-by-billable-metric-ids`],ProductFamilyIds:e[`filter-by-product-family-ids`],Tags:u(e[`filter-by-tags`],`filter-by-tags`)},GroupBy:u(e[`group-by`],`group-by`),Metric:e.metric,TimePeriod:{From:m(e[`time-period-from`],`time-period-from`,`text`),To:m(e[`time-period-to`],`time-period-to`,`text`)}}),h=await c(`Loading`,async()=>n.send($,{body:f,account_id:l}));o(h,{successLabel:`Loaded`})})},Oe={command:`usage`,describe:`Metered usage data for billed services — requests, bandwidth, and feature consumption`,builder:e=>e.command(_e).command(be).command(Se).command(Te).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`billing`,describe:`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,builder:e=>e.command(b).command(R).command(H).command(me).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ke as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{readFileSync as e}from"node:fs";import{resolve as t}from"node:path";function n(e,t,n){if(t.length===0)return;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e]??``;r[n]&&typeof r[n]==`object`||(r[n]={}),r=r[n]}let i=t[t.length-1]??``;r[i]=n}function r(e,t=[]){let n=(e,r)=>{if(Array.isArray(e)||typeof e!=`object`||!e)return e;let i=Object.entries(e).flatMap(([e,i])=>{let a=[...r,e],o=t.some(e=>e.length===a.length&&e.every((e,t)=>e===a[t])),s=o?i:n(i,a);return s===void 0||!o&&typeof s==`object`&&s&&!Array.isArray(s)&&Object.keys(s).length===0?[]:[[e,s]]});return Object.fromEntries(i)};return n(e,[])}function i(n,r){let i=r.startsWith(`--`)?r:`--${r}`,a=n;if(n.startsWith(`@`)){let r=n.slice(1);if(r.length===0)throw Error(`${i} '@' must be followed by a file path (got empty path)`);let o=t(r);try{a=e(o,`utf-8`)}catch(e){let t=e instanceof Error?e.message:`unknown read error`;throw Error(`${i}: cannot read file at '${r}': ${t}`)}}try{return JSON.parse(a)}catch{throw Error(`Invalid JSON in ${i}. Expected valid JSON.`)}}function a(e,t=[]){let n=i(e,`body`);for(let{path:e,flag:r}of t){let t=n;for(let n of e)t=o(t)&&Object.hasOwn(t,n)?t[n]:void 0;if(!o(t))throw Error(`--body must include a JSON object at ${e.join(`.`)} (for --${r}).`)}return n}function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function s(n,r){if(n===void 0)return;let i=r.startsWith(`--`)?r:`--${r}`;if(typeof n!=`string`)throw Error(`${i} must be provided once as a scalar value.`);let a=n;if(n.startsWith(`@`)){let r=n.slice(1);if(r.length===0)throw Error(`${i} '@' must be followed by a file path (got empty path)`);try{a=e(t(r),`utf-8`)}catch(e){let t=e instanceof Error?e.message:`unknown read error`;throw Error(`${i}: cannot read file at '${r}': ${t}`)}}let o;try{o=JSON.parse(a)}catch{return a}if(typeof o!=`string`&&typeof o!=`number`&&typeof o!=`boolean`)throw Error(`${i} must be a JSON scalar or plain string.`);return o}function c(e,t,n=!1){let r=t.startsWith(`--`)?t:`--${t}`;if(e===void 0){if(n)throw Error(`${r} is required (or pass --body with this field set).`);return}if(typeof e!=`string`)throw Error(`${r} must be provided once as a JSON object.`);let a=i(e,t);if(!o(a))throw Error(`${r} must be a JSON object.`);return a}function l(e,t){return d(e,t,`objects`)}function u(e,t){return d(e,t,`arrays`)}function d(e,t,n){if(e===void 0)return;let r=t.startsWith(`--`)?t:`--${t}`;if(typeof e!=`string`)throw Error(`${r} must be provided once as a JSON array of ${n}.`);let a=i(e,t);if(!Array.isArray(a)||a.some(e=>n===`arrays`?!Array.isArray(e):!o(e)))throw Error(`${r} must be a JSON array of ${n}.`);return a}export{l as a,u as i,a as n,s as o,c as r,n as s,r as t};
|